1009 B
1009 B
Case: fail-marks-thread-failed
用例意义
验证租约拥有者可以把线程推进到 failed 终态,并生成失败结果消息。
前置条件
worker-b已成功claim线程THREAD_ID
输入
inbox --db TMPDIR/coord.db --json fail --agent worker-b --thread THREAD_ID --summary "Migration failed" --body "The migration cannot proceed because the prior schema is inconsistent."
预期输出
- 命令退出码为
0 thread.status == "failed"message.kind == "result"
断言结论
fail与done共享结果消息模型,但进入的是失败终态- 成功
fail后会释放当前活跃 lease,避免线程停留在失败终态却仍显示被占用
补充约束
- 当
--agent未显式提供时,可以回退使用根级--agent fail生成的result消息会发回线程创建者,而不是发给当前执行者自己- 如果线程没有活跃 lease,
fail应返回invalid_state,而不是lease_conflict