feat(core): add Fleet contracts and in-process preview - #8859
Conversation
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
|
The in-process Fleet path looks coherent, and I verified that read-only teammates are constrained both when tool declarations are prepared and again through One non-blocking contract issue: Might be worth making view support explicit—e.g. a typed optional |
|
#8804 now covers the in-process coordination experience this preview was meant to introduce. The additional |
What this PR does
This PR implements Fleet Stage 1A and exposes it as an independently usable in-process preview. Enabling
experimental.fleetmakes the/coordinatebundled workflow available and automatically enables the underlying team collaboration tools, so users do not need to understand or separately enableexperimental.agentTeam./coordinatecreates a bounded team of up to three named read-only investigation teammates. They share tasks, exchange messages, and appear in the existing Agent View tabs. Their read-only capability is enforced at both tool declaration and execution time: workspace inspection and team coordination remain available, while shell execution, file writes, memory, scheduling, deferred tools, and nested agents are unavailable. The leader reconciles their evidence and performs any resulting changes.Underneath that preview, the core session, runtime, and view contracts are exercised by the existing in-process path. Team coordination and the agent-tab UI consume those contracts, turns carry correlated IDs, confirmation details are serializable, and approvals are routed through a one-shot registry. The legacy in-process backend remains as a compatibility adapter for Arena.
Why it's needed
Stage 1A previously established the contracts but exposed its only new behavior through the unrelated Agent Team flag. That made the PR safe as infrastructure but not a coherent Fleet increment. Moving the Fleet gate and
/coordinateentry forward gives this PR its own usable product boundary while keeping the high-risk subprocess, supervisor, and socket work isolated in Stage 1B.Reviewer Test Plan
How to verify
experimental.fleettotruewithout enablingexperimental.agentTeam, restart Qwen Code, and confirm/coordinateis available./coordinatewith two independent repository investigation workstreams. Confirm the existing Agent View tabs show the named teammates, shared tasks and messages flow between them, and the leader consolidates their evidence.experimental.fleet, restart, and confirm/coordinateis hidden while ordinary subagents remain unchanged. The legacyexperimental.agentTeamsetting continues to enable its low-level tools for existing users.Evidence (Before & After)
Before: Stage 1A had no Fleet-specific user entry; exercising the read-only teammate behavior required enabling the separate Agent Team experiment directly.
After:
experimental.fleetis the single preview switch. It exposes/coordinate, enables its internal collaboration dependencies, and runs the bounded workflow through the in-process Fleet contracts. No new visual component is introduced.Tested on
Environment (optional)
Node.js v22.22.0, local non-sandboxed workspace. Focused verification passed 489 Stage 1A tests, 501 Core configuration tests, and 362 CLI configuration/skill-loader tests; Core and CLI typechecks and builds also passed.
Risk & Scope
Linked Issues
Refs #8840. Implements the in-process preview boundary for Stage 1A of the architecture in #8719.
中文说明
本 PR 做了什么
本 PR 实现 Fleet 阶段 1A,并把它作为可独立使用的进程内 Preview 暴露出来。启用
experimental.fleet后,/coordinate内置工作流会出现,同时底层 Team 协作工具会自动启用,因此用户不需要理解或另行开启experimental.agentTeam。/coordinate会创建一个最多包含三个命名只读调查队友的有界团队。队友共享任务、交换消息,并显示在现有 Agent View 标签页中。只读能力同时在工具声明层和执行层强制生效:保留工作区检查与团队协作能力,禁止 shell 执行、文件写入、memory、定时任务、延迟加载工具和嵌套 agent。leader 负责核对证据,并完成由调查结果产生的修改。在 Preview 底层,核心 session、runtime 和 view 契约已经由现有进程内路径实际使用。团队协调和 Agent 标签页 UI 改为消费这些契约;轮次携带关联 ID;确认详情可序列化;审批通过一次性 registry 路由。原有进程内 backend 继续作为 Arena 的兼容适配层。
为什么需要
此前 Stage 1A 建立了契约,但唯一新增行为需要通过无关的 Agent Team 开关才能使用。这使 PR 可以作为安全的基础设施变更,却不是一个语义完整的 Fleet 增量。把 Fleet 开关与
/coordinate入口前移后,当前 PR 获得独立可用的产品边界,同时仍将高风险的 subprocess、supervisor 和 socket 工作隔离在 Stage 1B。Reviewer 测试计划
如何验证
experimental.agentTeam的情况下设置experimental.fleet: true,重启 Qwen Code,确认/coordinate可用。/coordinate执行两个独立的仓库调查工作流。确认现有 Agent View 标签页显示命名队友,共享任务和消息可以流转,leader 能汇总队友证据。experimental.fleet并重启,确认/coordinate被隐藏,而普通 sub-agent 不受影响。原有experimental.agentTeam设置仍继续为现有用户启用底层工具。证据(修改前与修改后)
修改前:Stage 1A 没有 Fleet 专属用户入口;验证只读队友行为需要直接启用另一个 Agent Team 实验。
修改后:
experimental.fleet成为唯一 Preview 开关。它会暴露/coordinate、自动启用内部协作依赖,并通过进程内 Fleet 契约运行有界工作流。本 PR 不新增可视组件。测试平台
环境(可选)
Node.js v22.22.0,本地非沙箱工作区。聚焦验证通过 489 个 Stage 1A 测试、501 个 Core 配置测试和 362 个 CLI 配置/skill loader 测试;Core 与 CLI 类型检查和构建也全部通过。
风险与范围
关联 Issue
参考 #8840。实现 #8719 架构中 Stage 1A 的进程内 Preview 边界。