feat(mesh): bind dispatcher runs to agent turns - #11252
Conversation
32c97a9
into
codex/multi-agent-mesh-foundation
No admission decision — this PR merged before triage ranTimeline, from the API:
So there was nothing to gate. I am not issuing an approval or a request-changes here: on merged code an approval is a no-op and a request-changes cannot be acted on, and either would read as an admission verdict that was never actually available. The stages below are what I could still establish, because this commit reaches Gate facts (Stage 0 / guardrails). All 17 files are core paths, so the two-tier core gate is in scope by path. It does not bite: the title is Test evidence: none exists, and I want to be blunt about that. There are zero What I could verify statically (reading the merge-commit tree, not running it). The central mechanism is sound, and better than I expected before reading it:
One finding worth carrying into #11206 — the binding is persisted before the dispatch is known to succeed. In The reason this is not merely untidy: Minor, non-blocking. The six thread-tool names are now enumerated in five places: On direction and scope. Nothing to raise. This is the minimum seam the stated goal needs — no speculative recovery, cancellation, REST or Web Shell surface, all of which the PR explicitly puts out of scope. The isolation argument holds: ordinary subagents keep the tools hidden, and the coupling stays inside Suggest the two items above — the binding-order question and a first automated pass — get picked up on #11206, where there is still a gate to satisfy and CI will actually run. 中文说明未做准入判定 —— 本 PR 在 triage 运行前已合并时间线(均来自 API):
因此没有可准入的对象。这里不会给出 approve 或 request-changes:对已合并的代码,approve 是空操作,request-changes 无法被执行,两者都会被误读成一个实际上并不存在的准入结论。下面各阶段是我仍能确认的内容,因为这个 commit 会通过仍处于 open 状态的主交付 PR #11206( Gate 事实(Stage 0 / 护栏)。 17 个文件全部落在核心路径,按路径确实触发两级核心 gate,但都不构成阻断:标题是 测试证据:完全不存在,这里直说。 静态可确认的部分(只读合并后的代码树,未运行)。 核心机制是成立的,而且比我读 diff 之前预期的更好:
一个值得带到 #11206 的发现 —— binding 在 dispatch 确认成功之前就已落盘。 之所以不只是「不整洁」: 次要、不阻断。 六个 thread 工具名现在出现在五处: 方向与范围。 没有异议。这是达成目标所需的最小接缝 —— 没有投机性的恢复、取消、REST 或 Web Shell 面,PR 也明确把这些划到范围外。隔离论证成立:普通 subagent 看不到这些工具,耦合留在 建议上面两项 —— binding 顺序问题,以及第一次自动化验证 —— 在 #11206 上补齐;那里仍有需要满足的 gate,CI 也会真正运行。 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
What this PR does
Connects the mesh dispatcher to the real background-agent turn boundary. Each mesh turn receives its persisted workspace/thread/run/attempt identity, sees the six thread tools, records correlated delivery and token usage, and terminalizes its run when the background body returns.
Launch and cold-revive prompts are committed when the runtime accepts the initial turn. Resident continuations use structured external input keyed by the run id and advance the delivery watermark only when the runtime emits the matching consumed event.
Why it's needed
The mesh rules and dispatcher were already durable, but the actual agent loop did not know which shared thread it was serving. That left the thread tools hidden and could leave successful work permanently marked running. This is the minimum runtime seam required before the two-agent live demo can run.
Reviewer Test Plan
How to verify
Review the live path for these outcomes: the first model turn can call a thread tool; a resident second turn is bound to the new thread rather than the previous one; the correlated external-message event advances accepted/consumed message ids; usage rounds land on the active attempt; and a plain-text exit becomes an unclosed run while an explicit review/wait/block close reaches a terminal state.
Evidence (Before & After)
N/A — this is runtime plumbing with no UI surface.
Tested on
Risk & Scope
Linked Issues
Parent delivery PR: #11206. Base:
codex/multi-agent-mesh-foundation.中文说明
这个 PR 做什么
把 mesh dispatcher 接到真实的后台 agent turn 边界。每个 mesh turn 都会拿到持久化的 workspace/thread/run/attempt 身份、看到六个 thread 工具、记录带关联 id 的消息消费与 token 用量,并在后台执行体返回时把 run 推到终态。
首次启动和冷恢复的 prompt 在 runtime 接受首轮时提交。resident 续跑使用以 run id 为关联 id 的结构化外部输入,只有 runtime 发出匹配的 consumed event 后才推进 delivery watermark。
为什么需要
mesh 的规则和 dispatcher 已经能持久化,但真实 agent loop 之前不知道自己正在处理哪条共享 thread。这会导致 thread 工具不可见,也会让成功完成的工作一直停在 running。这个 PR 只补上双 agent 真模型 demo 之前必需的最小 runtime 接缝。
Reviewer Test Plan
如何验证
检查真实链路是否满足:第一轮模型可以调用 thread 工具;resident 第二轮绑定到新 thread 而不是上一条;匹配的 external-message event 推进 accepted/consumed message ids;usage round 落到当前 attempt;纯文本退出成为 unclosed run,而显式 review/wait/block 收尾能进入终态。
证据(Before & After)
N/A——这是 runtime 接线,没有 UI。
测试环境
风险与范围
关联
主交付 PR:#11206。Base:
codex/multi-agent-mesh-foundation。