feat(cypher-executor): trigger_workflow status paused_awaiting_resume → running_async (LI roadmap 自評)

第一份 arcrun-roadmap (block e924c231) 提的建議:
  「paused_awaiting_resume 容易被誤讀成掛起出問題,
    考慮改成更清楚的 status(如 completed_with_checkpoint)」

我採折衷命名:running_async — 強調「workflow 已接受,正在背景跑」,
不像 completed_with_checkpoint 容易被誤讀為已完成。

範圍:
- trigger_workflow component-loader.ts status field rename
- AGENTS.md §6 common errors table 同步
- arcrun-mcp arcrun_run_workflow tool 回傳 status 同步
- error_code (telemetry classification) 仍保留 paused_awaiting_resume
  (SDD §1.4 error_code enum '可加不可刪' 承諾)

向下相容性:status 是 user-facing field,前面 dogfood 只有 weekly_review
一個 consumer 用 trigger_workflow,已同步更新。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-16 21:54:41 +08:00
parent 8b54ebb68a
commit a7d36933e6
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -213,11 +213,15 @@ function makeTriggerWorkflowRunner(env: Bindings): ComponentRunner {
const r = await executeWebhookGraph(env, record.graph, triggerContext, workflowName, apiKey);
// paused 是預期狀態(claude_api 等待外部 callback resume),不算失敗
// executeWebhookGraph 內部把 ExecutionError + "paused at node X" 包成 success:false + 含 error 字串
//
// 2026-05-16 rename per LI roadmap (block e924c231) 自評建議:
// 舊 `paused_awaiting_resume` 容易被誤讀成「掛起出問題」
// 新 `running_async` 強調「已接受,繼續在背景跑」— 行為一致,命名更清楚
const isPaused = !r.success && typeof r.error === 'string' && /workflow paused/i.test(r.error);
return {
success: r.success || isPaused,
triggered_workflow: workflowName,
status: r.success ? 'completed' : (isPaused ? 'paused_awaiting_resume' : 'failed'),
status: r.success ? 'completed' : (isPaused ? 'running_async' : 'failed'),
sub_result: r,
};
} else {