992 B
992 B
case: watch-wakes-on-matching-thread
用例意义
验证 watch 在新匹配线程到达时会被唤醒,并返回线程、消息与事件信息。
前置条件
worker-d当前没有匹配pending线程watch先于send启动
输入
inbox --db TMPDIR/coord.db --json watch --agent worker-d --status pending --timeout-seconds 2
inbox --db TMPDIR/coord.db --json send --from leader --to worker-d --subject "Build admin editor" --summary "Create the first editor screen"
预期输出
watch退出码为0watch.data.woke == true- 返回
thread、message、event
断言结论
watch唤醒结果不仅说明“醒了”,还提供触发该唤醒的具体事件上下文--agent未显式提供时,可以回退使用根级--agent;如果两者都未提供,则watch变为不按assigned_to过滤的全局观察- 成功唤醒时返回的
next_event_id应等于触发唤醒的event.event_id