channel_wait
Waits for new messages from a specified peer, replays missed messages first, then listens over WebSocket until timeout, returning message bodies or a timeout status without polling the model.
Instructions
等待指定对端的新消息:先补读,随后以 WebSocket 等待,不轮询模型。
纯读、不自动 ACK。返回正文后,等待此工具的当前回合可继续;不能唤醒已经结束 的 Desktop 回合。超时不自动重开等待。取消或连接故障会结束本次订阅。 调用方应让 MCP 请求超时大于 timeout_seconds + 4 * io_timeout_seconds + 5 秒。 客户端若提前超时,须发送 MCP cancel 或关闭连接;仅本地超时服务端无法感知。
返回 status=messages 或 timeout,附正文列表、has_more、next_cursor 与 delivery_source(replay=初始补读,event=WS 事件后补读,timeout_read=到期 后的末次补读,可为空)。游标失效直接报错,不静默跳页。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"channel": "<channel>",
"reader": "<reader>",
"sender": "<sender>"
},
"name": "channel_wait"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | 最多返回的消息数,范围 1-200,默认 50。 | |
| since | No | 首次调用的 ISO 8601 时间下界;与 cursor 至少传一个,续读使用 cursor。 | |
| cursor | No | 上次实际处理页的 next_cursor;按数据库插入序续读,不用时间戳替代。 | |
| reader | Yes | 收件角色标识,如 leader-codex,不是 session_id。 | |
| sender | Yes | 对端角色标识,如 leader-cc;不能与 reader 相同。 | |
| channel | Yes | 专线频道名,如 team:aiteam-os-bridge。 | |
| project_id | No | 项目 id;留空按既有 cwd 规则解析,解析不到则拒绝。 | |
| timeout_seconds | No | 等待新消息的秒数,范围 (0, 7200],默认 45;不含连接与补读开销。 空闲长挂前确认客户端工具超时足够(Codex 为 tool_timeout_sec)。 | |
| io_timeout_seconds | No | 连接、订阅确认和单次 HTTP 读取各自的秒数预算,范围 (0, 60],默认 10。 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||