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
+1 -1
View File
@@ -142,7 +142,7 @@ arcrun_report_feedback(api_key, issue_type='success_story', description='...')
| `component_not_found` | 零件名打錯 | call `list_components()` 看正確名 | | `component_not_found` | 零件名打錯 | call `list_components()` 看正確名 |
| `component_not_in_whitelist` | 零件存在但 cypher-executor 不認 | 告訴用戶聯絡平台維護者(這是平台 bug) | | `component_not_in_whitelist` | 零件存在但 cypher-executor 不認 | 告訴用戶聯絡平台維護者(這是平台 bug) |
| `validation_failed` | YAML / schema 不過 | 看 response 的 `next_actions` 陣列,照著修 | | `validation_failed` | YAML / schema 不過 | 看 response 的 `next_actions` 陣列,照著修 |
| `paused_awaiting_resume` | workflow 等 callbackclaude_api 等) | **正常**wait 或 call `get_execution_trace` 看狀態 | | `running_async` (status field) | workflow 已接受,在背景跑等 callbackclaude_api 等) | **正常**wait 或 call `get_execution_trace` 看狀態。舊名 `paused_awaiting_resume` 2026-05-16 改 |
| `dependency_unavailable` | 下游 APIClaude / Gmail / KBDB)掛 | retry,仍掛 → 公告型 issue | | `dependency_unavailable` | 下游 APIClaude / Gmail / KBDB)掛 | retry,仍掛 → 公告型 issue |
--- ---
+5 -1
View File
@@ -213,11 +213,15 @@ function makeTriggerWorkflowRunner(env: Bindings): ComponentRunner {
const r = await executeWebhookGraph(env, record.graph, triggerContext, workflowName, apiKey); const r = await executeWebhookGraph(env, record.graph, triggerContext, workflowName, apiKey);
// paused 是預期狀態(claude_api 等待外部 callback resume),不算失敗 // paused 是預期狀態(claude_api 等待外部 callback resume),不算失敗
// executeWebhookGraph 內部把 ExecutionError + "paused at node X" 包成 success:false + 含 error 字串 // 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); const isPaused = !r.success && typeof r.error === 'string' && /workflow paused/i.test(r.error);
return { return {
success: r.success || isPaused, success: r.success || isPaused,
triggered_workflow: workflowName, triggered_workflow: workflowName,
status: r.success ? 'completed' : (isPaused ? 'paused_awaiting_resume' : 'failed'), status: r.success ? 'completed' : (isPaused ? 'running_async' : 'failed'),
sub_result: r, sub_result: r,
}; };
} else { } else {