当 Multi-agent 不再是一团乱麻
AI coding 的瓶颈已经不是模型,而是人的注意力。拆解 Factory 的 Missions:写在代码之前的 validation contract、串行胜过并行,以及为每个角色挑对模型。
其他语言: English · Tiếng Việt · 한국어 · 日本語

给忙碌人士的 TL;DR
Luke Alvoeiro——此前打造了 Goose(Block 的开源 coding agent,现已捐赠给 AI Agentic AI Foundation),目前在 Factory 负责核心 agent harness——刚刚展示了一个名为 Missions 的 multi-agent 架构,在生产环境中连续运行了 16 天,其中一个 Slack 克隆项目达到了 90% test coverage。Factory 刚完成 1.5 亿美元 C 轮融资,估值 15 亿美元(Khosla Ventures 领投,Sequoia/Blackstone 跟投),客户包括 Nvidia、Adobe、Morgan Stanley、EY、MongoDB、Bayer、Adyen。
1. 问题:为什么再优秀的工程师一天也只能推进几个任务?

Luke 开场的观察非常贴近现实:即使是最强的工程师,每天也只能推进几个任务,哪怕 backlog 里有 50 个 feature。为什么?每个任务都需要注意力,每个 commit 都需要 review。今天的模型已经聪明到能解决这 50 个任务——但人类没有足够的带宽去监督它们。
这个论点值得细品。过去几年,所有关于 AI coding 的讨论都围绕 benchmark:哪个模型写的代码更干净、修 bug 更快。但如果 Luke 说得对,那么竞争优势已经从模型层转移到了 orchestration 层——这也正是 Factory 押注 15 亿美元的论点。
Factory 给自己提出的问题:"What if a human decides what to build and then a system figures out how to do so?" 一个 agent 可以跑上几小时、几天,你只需要回来验收结果。
2. Multi-agent 的 5 种模式分类——给混乱起个名字
这场演讲最有价值的贡献之一,是一套分类法(taxonomy),给那些零散的模式起了名字。正如 Luke 所说,这个领域 "is a bit of a mess"——每个框架都有自己的术语和主张。五种模式:

| 模式 | 本质 | 典型用例 |
|---|---|---|
| Delegation | Parent agent 派生 child agent,接收返回结果 | Sub-agents、coding 工具(最简单,大家最先做的就是它) |
| Creator-Verifier | 一个 agent 构建,另一个 agent 检查 | Code review——全新的 context 比带有 "cost bias" 的 agent 更容易发现 bug |
| Direct Communication | Agent 之间不经协调者直接对话 | 很难做对,因为状态分散,没有 single source of truth |
| Negotiation | Agent 围绕共享资源进行协商 | 多个 agent 同时修改代码库同一部分时——最好是 positive-sum |
| Broadcast | 一个 agent 向多个 agent 发送信息 | 状态更新、共享约束——不起眼,但对连贯性必不可少 |
Delegation 模式正是 Anthropic 在 orchestrator-workers cookbook 中描述的——一个中心 LLM 分析任务,动态拆分子任务,再委派给专门的 worker。这也是 Anthropic 在他们的 multi-agent research system 中使用的模式,在内部评测中相比单 agent 的 Claude Opus 4 提升了 90.2%。
Luke 强调的一个要点:negotiation 不一定是对抗性的。最好的用例是 positive-sum trading——agent 之间实现双赢。对那些曾以为 multi-agent = 相互竞争的 agent 的人(比如我)来说,这是个新鲜的视角。
3. Missions:5 种模式用了 4 种 + 3 角色架构

Missions 是 delegation + creator-verifier + broadcast + negotiation 的组合(没有 direct communication——这是有意为之,后面会解释)。工作流程:
mermaidflowchart LR
A["用户描述目标"] --> B["通过对话确定范围"]
B --> C["批准计划"]
C --> D["系统运行数小时、数天"]核心是 3 角色架构:
mermaidflowchart LR
O["Orchestrator: 计划 + validation contract"] --> W["Worker: 逐个实现 feature"]
W --> H["Structured handoff"]
H --> V["Validators: scrutiny + user testing"]
V -->|"未通过"| F["Follow-up features"]
F --> W
V -->|"通过"| N["下一个 milestone"]3.1. Orchestrator——负责规划
当你描述目标时,orchestrator 充当一个 sounding board:提出战略性问题,澄清模糊的需求,并产出一份包含以下内容的计划:
Features
需要构建的功能。
Milestones
各个检查点。
Validation contract
在写任何一行代码之前定义什么是 "done"。
最后这一项是核心创新。我会在第 4 部分再回来讲。
3.2. Workers——负责实现
每个 feature 分配给一个拥有 clean context, no accumulated baggage 的 worker。Worker 读 spec、实现、通过 Git 提交。下一个 worker 继承一个干净的代码库。
这就是 Missions 选择串行执行(serial execution)的原因(第 5 部分会分析)——不是不想并行,而是因为代码库是共享状态。
3.3. Validators——负责验证
大多数系统只跑 lint、type check、测试,也许再加个 code review。Missions 做了所有这些,外加行为验证(behavior validation)——不只是"代码语法对不对",而是"这个功能是否真的端到端可用"。
4. Validation contract——Missions 最重要的改进
这是我觉得最有实际价值的部分,也是我已经应用到 ClaudeKit 里的部分。
问题:在实现之后才写的测试没用

Luke 一针见血地点出了 vibe coding 中一个常见的反模式:
"An agent builds a feature. It writes some tests. The tests pass. There's full coverage. But the tests were shaped by the code, not by what the code was attempting to actually do. Tests written after implementation don't catch bugs. They confirm decisions."
这句话值得裱起来挂在墙上。当同一个 agent 既写代码又写测试时,测试只是在为 agent 已经做出的决定作证——而不是对正确性的独立检查。
这也正是近期学术论文指出的问题:在 Nexus 框架(arxiv 2510.26423) 中,作者称之为 "specification-based oracles that verify correctness against intended behavior rather than existing implementation"——而他们不得不搭建一整套 multi-agent pipeline,只为解决 test oracle synthesis(*)这个问题。
解决方案:在写代码之前写好 validation contract
Validation contract 是在规划阶段、写任何代码之前编写的。它独立于实现来定义正确性。对于复杂项目,它可能包含数百条 assertion,每个 feature 分配到一条或多条。所有 feature 加起来必须覆盖全部 assertion。
这个想法并不完全新鲜——它是测试驱动开发(Test-Driven Development)应用在 agent 上的变体。
Jeff Monnette 在 2025 年 6 月的一篇 Medium 文章中称之为 "Test-Driven Agentic Development":"Behavioral test suites... become the behavioral specification that agents must satisfy." Dev.to 上的 AppDeploy 最近也采用了相同的理念:"the catch is execution: the same agent that builds the feature will cut corners when it runs the plan. So you split responsibilities: generation can be shared, verification must be independent."
锁定章节: 每个 milestone 之后运行的两类 validator
锁定章节: 5. 为什么串行胜过并行?——关于速度的一课
锁定章节: Feature 串行执行
锁定章节: 在单个 feature 内
锁定章节: 在 validators 内
锁定章节: 6. Structured handoffs——连接组织
锁定章节: 7. Droid whispering——为每个角色挑选模型
锁定章节: Planning
锁定章节: Implementation
锁定章节: Validation
锁定章节: 8. Bitter lesson——架构必须随着每次模型发布变得更好
锁定章节: 9. 真实生产数据——Slack 克隆案例
锁定章节: 10. Mission Control 与异步开发
锁定章节: 11. 经济学的反转
锁定章节: 12. 个人评价及对 ClaudeKit 的启示
锁定章节: Luke 的结束语
锁定章节: 引用与延伸阅读
其余内容仅限 Knowledges 会员
另有 17 个章节(约 8 分钟)仅限会员
你正在阅读约前三分之一。Knowledges、组合和社区方案可阅读付费文章全文;Zuey AI 方案仅可阅读预览。