31 lines
992 B
Markdown
31 lines
992 B
Markdown
# case: watch-wakes-on-matching-thread
|
|
|
|
### 用例意义
|
|
|
|
验证 `watch` 在新匹配线程到达时会被唤醒,并返回线程、消息与事件信息。
|
|
|
|
### 前置条件
|
|
|
|
- `worker-d` 当前没有匹配 `pending` 线程
|
|
- `watch` 先于 `send` 启动
|
|
|
|
### 输入
|
|
|
|
```bash
|
|
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` 退出码为 `0`
|
|
- `watch.data.woke == true`
|
|
- 返回 `thread`、`message`、`event`
|
|
|
|
### 断言结论
|
|
|
|
- `watch` 唤醒结果不仅说明“醒了”,还提供触发该唤醒的具体事件上下文
|
|
- `--agent` 未显式提供时,可以回退使用根级 `--agent`;如果两者都未提供,则 `watch` 变为不按 `assigned_to` 过滤的全局观察
|
|
- 成功唤醒时返回的 `next_event_id` 应等于触发唤醒的 `event.event_id`
|
|
|