Improve orch status reconciliation view
This commit is contained in:
@@ -4,4 +4,5 @@
|
||||
|
||||
| Case Slug | File | Coverage Note |
|
||||
| --- | --- | --- |
|
||||
| `status-returns-run-summary-and-task-list` | [status-returns-run-summary-and-task-list.md](./status-returns-run-summary-and-task-list.md) | returns aggregate run status plus the per-task status list |
|
||||
| `status-returns-run-summary-and-task-list` | [status-returns-run-summary-and-task-list.md](./status-returns-run-summary-and-task-list.md) | returns aggregate run status plus the per-task status list and latest attempt context |
|
||||
| `status-auto-reconciles-and-includes-blocked-context` | [status-auto-reconciles-and-includes-blocked-context.md](./status-auto-reconciles-and-includes-blocked-context.md) | auto-reconciles inbox state and exposes blocked-task attempt and question context |
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
# 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-a` 已 `claim` 对应线程,并写入一次 `blocked` 问题
|
||||
- leader 尚未显式执行 `reconcile`
|
||||
|
||||
## 输入
|
||||
|
||||
```bash
|
||||
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 --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 与问题摘要,减少二次查询
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## 用例意义
|
||||
|
||||
验证 `status` 会返回 run 聚合视图以及任务明细列表,是 leader 端的完整状态检查入口。
|
||||
验证 `status` 会返回 run 聚合视图、任务明细列表以及最新 attempt/message 上下文,是 leader 端的完整状态检查入口。
|
||||
|
||||
## 前置条件
|
||||
|
||||
@@ -30,8 +30,13 @@ orch --db TMPDIR/coord.db --json status --run run_blog_001
|
||||
- 返回 `data.tasks` 数组
|
||||
- `data.tasks[0].task_id == "T1"`
|
||||
- `data.tasks[0].status == "done"`
|
||||
- `data.tasks[0].latest_attempt.assigned_to == "worker-a"`
|
||||
- `data.tasks[0].latest_attempt.status == "done"`
|
||||
- `data.tasks[0].latest_message.kind == "result"`
|
||||
- `data.tasks[0].latest_message.summary == "Retry policy implemented"`
|
||||
|
||||
## 断言结论
|
||||
|
||||
- `status` 比 `run show` 更完整,适合做 run 级收口检查
|
||||
- 任务清单与 run 聚合状态应保持一致,不应出现 run 已完成而任务仍显示旧状态的结果
|
||||
- leader 不必再单独查询 attempt 或 thread 历史,常见收口信息可直接从 `status` 拿到
|
||||
|
||||
Reference in New Issue
Block a user