From a7d36933e6ef983655157242db7133e9a39a1ca0 Mon Sep 17 00:00:00 2001 From: richblack Date: Sat, 16 May 2026 21:54:41 +0800 Subject: [PATCH] =?UTF-8?q?feat(cypher-executor):=20trigger=5Fworkflow=20s?= =?UTF-8?q?tatus=20paused=5Fawaiting=5Fresume=20=E2=86=92=20running=5Fasyn?= =?UTF-8?q?c=20(LI=20roadmap=20=E8=87=AA=E8=A9=95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 第一份 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 --- AGENTS.md | 2 +- cypher-executor/src/lib/component-loader.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 1c7de8c..4144f34 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -142,7 +142,7 @@ arcrun_report_feedback(api_key, issue_type='success_story', description='...') | `component_not_found` | 零件名打錯 | call `list_components()` 看正確名 | | `component_not_in_whitelist` | 零件存在但 cypher-executor 不認 | 告訴用戶聯絡平台維護者(這是平台 bug) | | `validation_failed` | YAML / schema 不過 | 看 response 的 `next_actions` 陣列,照著修 | -| `paused_awaiting_resume` | workflow 在等 callback(claude_api 等) | **正常**,wait 或 call `get_execution_trace` 看狀態 | +| `running_async` (status field) | workflow 已接受,在背景跑等 callback(claude_api 等) | **正常**,wait 或 call `get_execution_trace` 看狀態。舊名 `paused_awaiting_resume` 2026-05-16 改 | | `dependency_unavailable` | 下游 API(Claude / Gmail / KBDB)掛 | retry,仍掛 → 公告型 issue | --- diff --git a/cypher-executor/src/lib/component-loader.ts b/cypher-executor/src/lib/component-loader.ts index 960e8e8..feb838f 100644 --- a/cypher-executor/src/lib/component-loader.ts +++ b/cypher-executor/src/lib/component-loader.ts @@ -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 {