Files
ai-workflow-skill/docs/tests/orch/status/status-auto-reconciles-and-includes-blocked-context.md
T

2.0 KiB

Case: status-auto-reconciles-and-includes-blocked-context

用例意义

验证 status 在返回结果前会先 reconcile 当前 inbox 线程状态,并附带 blocked 任务的 latest attempt、latest message 与 latest blocked question 上下文,方便 leader 直接判断谁在执行、卡在什么问题上。

前置条件

  • 已存在 run run_blog_002
  • 任务 T1 已 dispatch 到 worker-a
  • worker-aclaim 对应线程,并写入一次 blocked 问题
  • leader 尚未显式执行 reconcile

输入

orch --db TMPDIR/coord.db --json run init --run run_blog_002 --goal "Build blog MVP"
orch --db TMPDIR/coord.db --json task add --run run_blog_002 --task T1 --title "Implement retry policy" --default-to worker-a
orch --db TMPDIR/coord.db --json dispatch --run run_blog_002 --task T1 --execution-mode analysis --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 update --agent worker-a --thread THREAD_ID --status blocked --summary "Need logging decision" --payload-json '{"question":"Should retry attempts be logged?"}'
orch --db TMPDIR/coord.db --json status --run run_blog_002

预期输出

  • status 退出码为 0
  • data.run.status == "blocked"
  • data.tasks[0].status == "blocked"
  • data.tasks[0].latest_attempt.thread_id == THREAD_ID
  • data.tasks[0].latest_attempt.status == "blocked"
  • data.tasks[0].latest_message.kind == "question"
  • data.tasks[0].latest_message.summary == "Need logging decision"
  • data.tasks[0].blocked_question.kind == "question"
  • data.tasks[0].blocked_question.summary == "Need logging decision"

断言结论

  • status 现在是更偏 operational 的 leader 视图,而不是只读的任务列表查询
  • leader 在常见排障场景里,不必先手工 reconcile 再额外跑 blocked
  • enriched task context 能直接暴露当前 attempt 与问题摘要,减少二次查询