feat(mesh): ship shared-thread demo and runtime flow - #11260
Conversation
|
Demo-first main-flow update: correlated mid-run delivery now reaches the exact ambient run; delivery misses are detached and rebooked; restart and three-minute no-activity recovery retry once; late attempt callbacks are guarded; definitively dead hidden host sessions are replaced. Child blocked/failed/cancelled/done transitions now report to a waiting parent, not only in_review. Commits: 6808980 and b819ee7. No local tests, lint, typecheck, build, or CI wait were run. |
aeefa63
into
codex/multi-agent-mesh-foundation
|
Triage started at 07:37:56Z; this PR merged into I did finish reading the code and the CI signal, and there's one thing worth acting on before this reaches The merged tree does not typecheck
I traced each one to a line in this diff. All 8 are real and all 8 are from this PR's code — none is pre-existing infra noise:
const groups: ThreadGroup[] = [ /* … */ ];
return groups.filter((group) => group.threads.length > 0);
They also look unrelated to a mesh shared-thread demo. Together with the CI never ran the suite on this PR
That's the part I'd flag for #11206: the break is now sitting in that PR's head branch, and #11206 → Tests38 files, ~5104 production lines changed, zero test files — nothing matching Size and riskProduction lines: ~5104 (docs 306, tests 0, generated/schema 0), across The route file itself reads carefully —
What would actually settle the behavioural claimsThe description is candid that recovery, correlated resume/revival delivery, atomic cancellation and tree closure, runtime-generation fencing, retention-gap reporting and the saved-but-not-started UI path "are implemented from source inspection but have not been exercised in another runtime pass". Those are the load-bearing claims of this PR and neither the diff nor CI substantiates any of them — the suite that would have run didn't run. Sandboxed verification would settle this:
Failing excerpt, identical in both red jobs: Not verified: runtime behaviour of the dispatcher, cancellation, recovery, generation fencing and the Web Shell surfaces — no lane ran them, and I did not execute any PR code (static review only, per the gate's no-execute rule). 中文说明Triage 于 07:37:56Z 启动,而本 PR 已在 07:37:20Z 合入 代码和 CI 信号我读完了,有一件事值得在它进入 合并后的树无法通过类型检查。 我逐个定位到了本 diff 中的具体行,8 个全部来自本 PR 的代码,没有一个是既有的环境噪音:
这些改动看起来也和 mesh 共享线程 demo 无关。连同 CI 从未在本 PR 上跑过测试套件。 这一点是我认为需要提醒 #11206 的:这个失败现在就在该 PR 的 head 分支上,而 #11206 → 测试。 38 个文件、约 5104 行生产代码改动,测试文件为 0——diff 中没有任何 规模与风险。 生产行数约 5104(文档 306、测试 0、生成/schema 0),横跨 路由文件本身写得谨慎——每个 handler 都走
什么才能真正验证行为层面的主张。 PR 描述坦承:恢复、resume/revival 关联投递、原子取消与线程树关闭、runtime generation 防护、retention gap 报告以及"已保存但未启动"的 UI 路径,"仅做了源码检查,还没有再跑一轮 runtime"。这些正是本 PR 最关键的主张,而 diff 和 CI 都无法佐证任何一条——本该跑的套件没有跑。 沙箱验证可以解决这一点: 未验证:dispatcher、取消、恢复、generation fencing 以及 Web Shell 各界面的运行时行为——没有任何验证通道跑过它们,我也没有执行任何 PR 代码(按门禁的禁止执行规则,只做静态审查)。 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
What this PR does
This delivers the usable shared-thread mesh demo on top of the foundation in #11206. A workspace can create, enable, disable, and remove persistent agent identities. Creating the first identity establishes its hidden host; disabling rejects new work while draining existing bookings; removal clears the resident body and transcripts while preserving historical post attribution, and removing the last identity releases the now-unused host. Daemon restart restores hosts only for non-empty rosters. It can atomically create, assign, and reassign work against the live roster, watch agents collaborate across root and child threads, interject while a run is active, inspect per-run transcript slices, cancel work, and mark reviewed threads done.
Durable bookings reach a workspace-qualified hidden host through ACP. The dispatcher handles new launches, resident continuation, direct input to a running agent, parent reports, FIFO backpressure, delivery-race rebooking, one restart/stall recovery attempt, source-first cancellation, stale host replacement, and startup replay. Launch, resident continuation, paused resume, and cold revival carry the durable run id through the same structured external-message path, and child-review reports retain the source run across their system-authored parent hop. Failed and cancelled runs remain terminal, cancellation and thread-tree closure are admitted atomically, an accepted replay reuses an existing same-parent/same-title child instead of duplicating work, inert unassigned children cannot strand a waiting parent, and the hidden owner stops when its workspace runtime generation is replaced. Runtime mutation remains guarded by the ambient workspace/thread/run/attempt binding. Tool responses distinguish queued work from a started peer and do not promise channel notification while its destination remains undecided.
The Web Shell uses the resolver's status and reason directly, previews new assignments and reply routing with the production rules, preserves deleted authors as tombstones, and keeps child threads and run history beside the shared ledger. Durable mutations whose immediate background processing fails are reported as saved-but-not-processed instead of disappearing behind polling.
Why it's needed
The earlier mesh steps established rules, storage, capabilities, and runtime seams but did not give a person a usable product loop. This PR is the smallest browser-driven path that demonstrates persistent identities collaborating on one shared thread while a person can observe, redirect, stop, and review the work.
Reviewer Test Plan
How to verify
qwen servefor a trusted workspace and open its Web Shell.in_review.cancelled, is not rebooked by a later dispatcher sweep, and the next FIFO run can start.thread_block; confirm the question and the resolver's waiting-for-a-person reason are visible. Open a completed run and confirm only its transcript byte range is rendered.name (removed). Remove the final identity and confirm the hidden host is released.Evidence (Before & After)
Before: the mesh foundation had no person-facing shared-thread workflow.
After: a real daemon and Web Shell completed
alice-demo -> bob-demo child -> alice-demo parent continuation. Both threads reachedin_review; the root showed the attributed result, inline child, and two collapsed past runs. Separate browser passes showed a blocked question, exact run transcript range16990..22071, running-to-cancelled control flow, inline children, mark-done, and deleted-agent tombstones. A final latest-source smoke previewedWill start @alice, durably created and assigned a thread, replayed its queued run after daemon restart, and showed Alice's attributedthread_reviewresult ascompleted/reviewwith the threadin_review. The later recovery, correlated resume/revival delivery, atomic cancellation/tree closure, runtime-generation fencing, internal retention-gap reporting, and saved-but-not-started UI paths are implemented from source inspection but have not been exercised in another runtime pass.No local unit tests, lint, typecheck, or CI wait were run for the latest demo-first changes. Only the ACP bridge package output was refreshed because the shared worktree dependency still pointed at its older build.
Tested on
Environment (optional)
Local source-mode daemon and Vite Web Shell against a temporary workspace.
Risk & Scope
codex/multi-agent-mesh-foundationand is not intended to merge directly tomain.Linked Issues
Part of #11206.
中文说明
这个 PR 做了什么
这个 PR 在 #11206 的 foundation 上交付可用的 shared-thread mesh demo。一个工作区可以创建、启用、停用和删除持久 Agent 身份;创建首个身份会建立隐藏 host;停用只拒绝新工作,已经 booking 的工作继续 drain;删除会清除驻留执行体和 transcript,同时保留历史帖子署名,删除最后一个身份时还会释放不再需要的隐藏 host;daemon 重启只为非空 roster 恢复 host。它会依据锁内最新 roster 原子地创建、指派和重新指派工作,观察 Agent 在根线程和子线程之间协作,在 run 进行中随时插话,查看单个 run 的 transcript slice,取消工作,并把验收后的线程标记为 done。
持久 booking 通过 ACP 到达 workspace-qualified 的隐藏 host。派发器处理首次启动、驻留续跑、向运行中 Agent 直接投递、父级报告、FIFO 背压、投递竞态重订、一次重启/卡死恢复、source-first 取消、陈旧 host 替换和启动重放。首次启动、驻留续跑、暂停恢复和冷复活都通过同一条结构化外部消息路径携带持久 run id,子线程 review 报告经过 system-authored 的父级跳转时也保留来源 run。失败与取消保持终态,取消与线程树关闭在同一个事务内准入,已接受输入的重放会复用同父级同标题的既有子线程而不会重复派工,未指派的惰性子线程不会让父 Agent 永久等待,隐藏 owner 会在工作区 runtime generation 被替换时停止。所有运行时写操作继续由 ambient workspace/thread/run/attempt 绑定保护。工具返回会区分“已排队”和“对方已启动”,在通知目标未决定前也不会承诺 channel notification。
Web Shell 直接使用 resolver 返回的状态和原因,用生产规则预览新指派和回复路由,删除 Agent 后保留历史署名,并把子线程和 run 历史放在共享 ledger 旁边。持久写入成功但后台处理失败时会明确显示“已保存但后台处理失败”,不会被轮询静默清掉。
为什么需要
此前的 mesh 步骤建立了规则、存储、能力边界和 runtime 接缝,但没有人可以操作的完整产品闭环。这个 PR 用最小浏览器路径展示持久身份如何在一个共享线程上协作,同时人可以观察、纠偏、停止和验收。
Reviewer 验证计划
如何验证
qwen serve并打开 Web Shell。in_review。cancelled,后续 dispatcher 扫描不会重新 booking,且下一个 FIFO run 可以启动。thread_block,确认问题和“等待人处理”的 resolver 原因可见。打开已完成 run,确认只渲染它自己的 transcript 字节范围。name (removed);删除最后一个身份后,隐藏 host 应被释放。证据(Before & After)
Before:mesh foundation 没有人可以使用的 shared-thread 工作流。
After:真实 daemon 和 Web Shell 完成了
alice-demo -> bob-demo child -> alice-demo parent continuation。两个线程都进入in_review;根线程显示了归属清晰的结果、inline child 和两次折叠的历史 run。其他浏览器路径展示了 blocked 问题、精确 run transcript 范围16990..22071、running 到 cancelled 的控制流、inline child、mark-done 和删除 Agent 后的历史署名。最后一轮 latest-source smoke 还预览了Will start @alice,持久创建并指派线程,在 daemon 重启后重放 queued run,并在 Web Shell 中看到 Alice 的署名thread_review结果;run 为completed/review,线程为in_review。之后补充的恢复/复活关联投递、原子取消/线程树关闭、runtime generation 防护、内部 retention gap 报告和“已保存但未启动”提示仅做了源码检查,还没有再跑一轮 runtime。最新 demo-first 改动没有运行本地单测、lint、typecheck,也没有等待 CI。只刷新了 ACP bridge 包产物,因为共享 worktree dependency 仍指向旧 build。
测试环境
环境(可选)
本地 source mode daemon 和 Vite Web Shell,对应一个临时工作区。
风险与范围
codex/multi-agent-mesh-foundation,不直接合入main。关联 Issue
#11206 的一部分。