1.3 KiB
1.3 KiB
Case: dispatch-creates-attempt-and-thread-for-ready-task
用例意义
验证 dispatch 在任务已 ready 时,会创建 attempt、映射 inbox thread,并写入首条任务消息。
前置条件
- 已存在 run
run_blog_001 - 已存在无依赖任务
T1
输入
orch --db TMPDIR/coord.db --json run init --run run_blog_001 --goal "Build blog MVP" --summary "Public blog plus admin CRUD"
orch --db TMPDIR/coord.db --json task add --run run_blog_001 --task T1 --title "Implement retry policy" --summary "Add retry policy to HTTP client" --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."
预期输出
dispatch退出码为0data.task.status == "dispatched"data.attempt.attempt_no == 1- 返回
data.attempt.thread_id data.attempt.assigned_to == "worker-a"data.thread.thread_id与data.attempt.thread_id一致data.message.kind == "task"
断言结论
dispatch是把调度意图物化为一次 attempt 和 inbox thread 的命令- 任务进入
dispatched后,leader 可以用 thread 映射等待 worker 侧进展
补充约束
- 未显式传
--to时,会回退使用任务的default_to --body与--body-file互斥;不可读的--body-file应返回invalid_input