Files
ai-workflow-skill/docs/tests/orch/reconcile/reconcile-maps-done-or-failed-thread-to-terminal-task-state.md
T

1.4 KiB

Case: reconcile-maps-done-or-failed-thread-to-terminal-task-state

用例意义

验证 reconcile 会把 worker 侧 thread 的终态同步到 orch 任务,并刷新 run 聚合状态。

前置条件

  • 已存在 run 和已 dispatch 的任务
  • worker 已对该 thread 完成 donefail

输入

orch --db TMPDIR/coord.db --json run init --run run_blog_001 --goal "Build blog MVP"
orch --db TMPDIR/coord.db --json task add --run run_blog_001 --task T1 --title "Implement retry policy" --default-to worker-a
orch --db TMPDIR/coord.db --json dispatch --run run_blog_001 --task T1 --body "Implement retry handling for the HTTP client."
inbox --db TMPDIR/coord.db --json claim --agent worker-a --thread THREAD_ID
inbox --db TMPDIR/coord.db --json done --agent worker-a --thread THREAD_ID --summary "Retry policy implemented" --body "The HTTP client now retries transient failures."
orch --db TMPDIR/coord.db --json reconcile --run run_blog_001
orch --db TMPDIR/coord.db --json status --run run_blog_001

预期输出

  • reconcile 退出码为 0
  • data.updated_tasks 包含 T1
  • T1.status == "done";若输入是 fail,则应为 failed
  • 后续 status.data.run.status 与终态任务聚合结果一致

断言结论

  • 任务终态依赖 reconcile 落回 orch,而不是由 worker 直接改写 task 表
  • run 级聚合状态会随终态任务一并刷新