工作日早上 7 点读 AI,周日早上 8 点读周报订阅邮件

METAL LAB

AgentRoom: Concurrent Multi-Agent Coding in a CRDT-Backed Shared Workspace

arXiv:2608.237402026-08-26

让多个AI编程智能体在同一工作区实时协作,比按顺序执行或无协调地并行执行效果更好

AgentRoom是一种协议,让多个编程AI智能体在由CRDT(一种能自动无冲突合并并发修改的数据结构)支撑的共享文件系统上同时工作,通过文件占用、状态查看、消息广播等功能进行协调。研究者用五个前沿编程模型在四项后端编程任务上测试,发现配备协调机制的双智能体方案比单智能体放弃任务的比例更低,运行结果也更稳定。作者认为,真正起作用的是协调机制本身,而不是并行执行或CRDT合并本身。

METAL LAB 解读图

AgentRoom协调结构与六条件对比

证据状态已报告实测结果

  1. 共享CRDT工作区N个编程智能体共享一个文件系统,pycrdt(基于Yrs的CRDT)自动在字符级别合并并发编辑。
  2. MCP协调工具room_claim(文件占用)、room_broadcast/read(消息广播与查看)、room_state(同伴状态查询)等五个工具支持智能体间的显式协调。
  3. 六种对比条件质量分排序为:ChatDev式顺序交接(0.333)<并行合并(0.456)<单智能体(0.544)<仅共享(0.575)<无MCP协作(0.588)<AgentRoom(0.669)。
  4. 抑制任务放弃汇总12个模型×任务组合的统计显示,采用AgentRoom后单智能体常见的提前放弃失败的几率降低了13.7倍。
  5. 智能体数量扩展质量分在2个智能体时达到峰值,之后在3个、4个智能体时下降,而消息交换量在超过3个智能体后呈超线性增长。
这是 METAL LAB 制作的解读图,并非论文作者提供的原图。

他们做了什么

  1. 研究团队构建了AgentRoom,让多个AI编程智能体在同一个共享文件系统上并发工作,并把文件占用(claim)、状态查询、消息广播等协调功能作为MCP工具(一种让模型调用外部工具的标准接口)暴露出来。
  2. 团队用五个前沿编程CLI模型(Claude Sonnet 4.6、Haiku 4.5、Codex GPT-5.4等)执行认证系统、市场API、金融账本、交易平台等后端任务,比较了单智能体、无协调并行合并、ChatDev式顺序交接、AgentRoom等六种条件。
  3. 单智能体在困难任务上常常只写出一个文件骨架就放弃;将全部12个模型×任务组合汇总统计(Cochran-Mantel-Haenszel检验)后发现,单智能体放弃任务的几率是AgentRoom的13.7倍(95%置信区间3.9至48,p<10^-5)。
  4. 在相同计算量条件下,AgentRoom的平均质量分比无协调并行执行高出0.213分(Welch t=3.35,p=0.003),也高于保留CRDT和协作提示但去掉MCP协调工具的条件,说明协调工具本身是提升效果的关键。
  5. 将智能体数量从1个扩展到4个后发现,质量分在2个智能体时达到峰值,之后下降;而消息交换量在超过3个智能体后呈超线性增长,暗示单一广播通道可能成为瓶颈。
Figure 1: T4 six-condition coordination ablation: AgentRoom is the top condition, while concurrency without coordination (parallel-merge) and sequential hand-off (ChatDev-style) fall below the single-agent baseline.
Figure 1: T4 six-condition coordination ablation: AgentRoom is the top condition, while concurrency without coordination (parallel-merge) and sequential hand-off (ChatDev-style) fall below the single-agent baseline.
Table 1: T4 Sonnet 4.6 six-condition ablation (LLM-judge composite, budget-fair 30–700 s pool). Parallel-merge vs AgentRoom: +0.213, Welch t=3.35, 𝐩=0.003. The shared+collab-noMCP probe ran under a 1200 s wall budget; its runs are filtered to the same 30–700 s envelope as every other cell (Appendix B.13). Cross-model replication in Appendix B, Table 8.
ConditionMeannσNote
ChatDev-style (sequential 3-phase)0.33360.197sequential paradigm baseline
Parallel merge (2 indep + union)0.456120.178concurrent, no coordination
Solo (1 agent)0.544320.222single-agent baseline
Shared only (2 agents, no MCP)0.575110.155shared CRDT, no signalling
Shared + collab prompt, noMCP0.58870.188+ prompt, no MCP tools
AgentRoom (2 agents, full)0.669140.140CRDT + room MCP + collab prompt
Figure 2: AgentRoom architecture: N coding agents share a workspace mediated by a CRDT; the MCP server exposes claim, release, broadcast, state, read.
Figure 2: AgentRoom architecture: N coding agents share a workspace mediated by a CRDT; the MCP server exposes claim, release, broadcast, state, read.
Table 2: Cross-model T4 ES with bootstrap 95% CI (10 000 resamples), AST-scored subsample of the full pool (≥30 s elapsed). n is smaller than the LLM-scored pools because the AST scorer covers a subsample. Headline scorer is AST (TypeScript compiler API); regex-scorer values after the slash for cross-check. ∗ CI excludes 1. Two CLI-unstable models (Gemini, GPT-5.4-mini) excluded (see §4.4). Reported as exploratory conjecture: only Haiku T4 clears the CI under the AST scorer.
ModelSWE-bench V.Solo (n)×2 (n)ES (AST / regex)95% CI (AST)
Haiku 4.573.3%0.520 (13)0.929 (8)1.79× / 1.58×[1.24, 3.35]∗
Codex GPT-5.4∼80%0.248 (9)0.487 (13)1.96× / 1.07×[0.85, 8.85]
Sonnet 4.679.6%0.463 (11)0.630 (15)1.36× / 1.14×[0.84, 2.29]
Figure 3: Real-time CRDT merge during a single T4 Sonnet AgentRoom ×2 run. The MCP-mediated chat (left) drives concurrent character-level edits in the shared file (right); both α’s and β’s insertions co-exist on the same line via the Yrs CRDT, with no byte-level conflict raised in this run. Per-message Bezier leaders link each chat broadcast to the code line it talks about.
Figure 3: Real-time CRDT merge during a single T4 Sonnet AgentRoom ×2 run. The MCP-mediated chat (left) drives concurrent character-level edits in the shared file (right); both α’s and β’s insertions co-exist on the same line via the Yrs CRDT, with no byte-level conflict raised in this run. Per-message Bezier leaders link each chat broadcast to the code line it talks about.
Table 3: Sonnet 4.6 ES across the difficulty gradient (regex/AST scorer, outlier-filtered ≥0.3).
TaskSolo (n)×2 (n)ES
T10.919 (4)0.910 (7)0.99×
T20.840 (3)0.904 (4)1.08×
T30.887 (3)0.943 (4)1.06×
T40.796 (10)0.958 (10)1.20×
T50.697 (7)0.810 (7)1.16×
Figure 4: Solo (slate) vs AgentRoom ×2 (rust) score distributions for the three CLI-stable models on T4 (LLM-judge composite, budget-fair pool). σ contracts by ∼30–45% under AgentRoom in every panel (Sonnet 0.23→0.14, Haiku 0.25→0.17, Codex 0.27→0.15); mean shift varies by model.
Figure 4: Solo (slate) vs AgentRoom ×2 (rust) score distributions for the three CLI-stable models on T4 (LLM-judge composite, budget-fair pool). σ contracts by ∼30–45% under AgentRoom in every panel (Sonnet 0.23→0.14, Haiku 0.25→0.17, Codex 0.27→0.15); mean shift varies by model.
Table 4: Heterogeneous vs. homogeneous ×2 on T4 (LLM-judge, budget-fair). Tests is the mean over all budget-fair runs in the cell (n=17/4/3), which is not the LLM-scored n shown in the Score column.
PairScore (n)Tests
Sonnet ×2 (homo)0.669 (14)32.8
Sonnet+Codex0.721 (3)16.0
Sonnet+Gemini0.542 (3)22.0
Figure 5: Agent-count scaling on T4 Sonnet 4.6 (N=1–4, budget-fair pool). Left: mean LLM-judge composite with σ band peaks at N=2 then declines. Middle: mean tests passing peaks at N=3. Right: AgentRoom message count rises super-linearly past N=3, consistent with a single-broadcast-channel coordination overhead.
Figure 5: Agent-count scaling on T4 Sonnet 4.6 (N=1–4, budget-fair pool). Left: mean LLM-judge composite with σ band peaks at N=2 then declines. Middle: mean tests passing peaks at N=3. Right: AgentRoom message count rises super-linearly past N=3, consistent with a single-broadcast-channel coordination overhead.
Table 5: Wall vs compute on T4 Sonnet (LLM-judge composite, budget-fair pool).
ConditionNWall (s)Compute (s)Quality
Solo15505500.544
Parallel merge255810770.456
Shared only260112010.575
AgentRoom ×2256110720.669
AgentRoom ×3356615720.553
Figure 6: Cochran-Mantel-Haenszel forest plot of Solo-vs-AgentRoom 1-file abandonment across all 12 model×task strata (Sonnet/Haiku/Codex × T1/T2/T4/T5).
Figure 6: Cochran-Mantel-Haenszel forest plot of Solo-vs-AgentRoom 1-file abandonment across all 12 model×task strata (Sonnet/Haiku/Codex × T1/T2/T4/T5).
Table 6: T5 (trading platform, 900 s budget), AST scorer, per-model cells. All CLI-stable cells are point-estimate-positive on ×2 except Codex; CIs do not exclude 1 at this n. The Gemini row is CLI-unstable and informational only (§4.4); sparse heterogeneous cells are in the text above.
ModelSolo (n)×2 (n)×3 (n)ES(×2)Tests (×2)
Haiku 4.50.416 (8)0.707 (7)0.822 (1)1.70×38
Sonnet 4.60.618 (7)0.674 (7)0.730 (2)1.09×57
GPT-5.40.667 (9)0.531 (7)0.761 (1)0.79×8
Gemini Flash (unstable)0.851 (3)0.506 (9)0.246 (3)0.59×12
Figure 7: Bootstrap effect-size distributions (10 000 resamples) for the Tier III cross-model cells. Only Haiku T4 has its 95% CI strictly above 1; the other five cells span 0.79–1.96× point-estimate with CIs that include 1.
Figure 7: Bootstrap effect-size distributions (10 000 resamples) for the Tier III cross-model cells. Only Haiku T4 has its 95% CI strictly above 1; the other five cells span 0.79–1.96× point-estimate with CIs that include 1.
Table 7: Frequency of unprompted collaborative behaviors across 6 valid ×2 AgentRoom runs on T4 Sonnet.
BehaviorRuns exhibiting (of 6)
Module claiming via broadcast6/6
Plan adjustment after reading teammate5/6
Export list shared for teammate4/6
Proactive gap filling3/6
Cross-agent bug fix2/6
Apology for file boundary violation2/6
Figure 8: Cost–quality Pareto on T4. Shaded region is Pareto-dominated; dotted lines are iso-efficiency (quality/cost) contours. 2×Haiku AgentRoom clears 1×Sonnet at matched plotted cost.
Figure 8: Cost–quality Pareto on T4. Shaded region is Pareto-dominated; dotted lines are iso-efficiency (quality/cost) contours. 2×Haiku AgentRoom clears 1×Sonnet at matched plotted cost.
Table 8: Cross-model T4 ablation (LLM-judge composite, budget-fair pool). For Sonnet and Haiku, AgentRoom is the top condition and parallel-merge falls below solo. Codex non-Solo/AgentRoom cells were not collected (vendor-CLI hang).
Baselines and partial bundlesOurs
ModelSoloParallel mergeShared onlynoMCPAgentRoom ×2
Sonnet 4.60.544 (n=32)0.456 (n=12)0.575 (n=11)0.588 (n=7)0.669 (n=14)
Haiku 4.50.530 (n=35)0.383 (n=12)0.657 (n=7)0.579 (n=6)0.662 (n=17)
Codex GPT-5.40.384 (n=12)0.529 (n=17)
Figure 9: Single representative T4 Sonnet AgentRoom ×2 run. Top swim-lane: agent α broadcasts (timestamps in-card); middle: per-file ownership Gantt (rust = α, slate = β); bottom: agent β. Bezier S-curve leaders link each chat broadcast to its time on the Gantt. The whole protocol (claim, conflict-detect, hand-off, completion broadcast) emerges from the advisory six-step prompt (§2.3) without any orchestrator.
Figure 9: Single representative T4 Sonnet AgentRoom ×2 run. Top swim-lane: agent α broadcasts (timestamps in-card); middle: per-file ownership Gantt (rust = α, slate = β); bottom: agent β. Bezier S-curve leaders link each chat broadcast to its time on the Gantt. The whole protocol (claim, conflict-detect, hand-off, completion broadcast) emerges from the advisory six-step prompt (§2.3) without any orchestrator.
Table 9: Threshold sensitivity for the Tier I CMH. Each row is a threshold combination; cells report Solo/AgentRoom abandonment counts per model and the resulting CMH common OR with 95% CI and p-value.
ThresholdsSonnet 4.6Haiku 4.5Codex GPT-5.4CMH pooled
d thrf thrSoloRoomSoloRoomSoloRoomOR95% CIp
<150≤16/330/1712/351/179/170/2124.2[3.5, 169]0.00001
<150≤26/330/1712/351/179/172/2111.9[3.0, 47]0.00005
<150≤36/330/1712/351/1710/176/216.3[2.1, 19]0.00069
<200≤16/330/1712/351/179/170/2124.2[3.5, 169]0.00001
<200≤2 (paper)6/330/1712/351/179/172/2111.9[3.0, 47]0.00005
<200≤36/330/1712/351/1710/176/216.3[2.1, 19]0.00069
<250≤16/330/1712/351/179/170/2124.2[3.5, 169]0.00001
<250≤26/330/1712/351/179/172/2111.9[3.0, 47]0.00005
<250≤36/330/1712/351/1710/176/216.3[2.1, 19]0.00069
<300≤16/330/1712/351/179/170/2124.2[3.5, 169]0.00001
<300≤26/330/1712/351/179/172/2111.9[3.0, 47]0.00005
<300≤36/330/1712/351/1710/176/216.3[2.1, 19]0.00069
Figure 10: The two scorers measure the same thing loosely, not interchangeably. Each point is one T4 run carrying both a regex composite and an LLM-judge composite (n=246, the runs scored by both); Pearson r=0.67. The spread off the diagonal is why the body uses one scorer throughout and reports the other as a cross-check rather than averaging them.
Figure 10: The two scorers measure the same thing loosely, not interchangeably. Each point is one T4 run carrying both a regex composite and an LLM-judge composite (n=246, the runs scored by both); Pearson r=0.67. The spread off the diagonal is why the body uses one scorer throughout and reports the other as a cross-check rather than averaging them.
Table 10: Pool sensitivity for the T4 Sonnet ablation (LLM-judge composite). The substrate-vs-AgentRoom ordering is preserved under both pools; the budget-fair pool is primary.
PoolSoloParallel mergeShared onlyAgentRoom ×2
30–700 s (paper, budget-fair)0.544 (n=32)0.456 (n=12)0.575 (n=11)0.669 (n=14)
≥30 s (full pool)0.464 (n=42)0.436 (n=13)0.527 (n=14)0.639 (n=15)
Table 11: Solo + collaboration-style prompt without teammates, T4, n=3 each (LLM-judge composite). The structured prompt alone is model-dependent: it hurts Sonnet (channel is the load-bearing variable) and helps Haiku (the structured prompt also acts as workflow scaffolding); the channel and prompt-as-workflow are not separately identified for Haiku at this n.
ModelSolo (bare, budget-fair)Solo + collab prompt (n=3)AgentRoom ×2 (budget-fair)
Sonnet 4.60.544 (n=32)0.448 (range 0.20–0.62)0.669 (n=14)
Haiku 4.50.530 (n=35)0.604 (range 0.55–0.66)0.662 (n=17)
Table 12: DevBench cross-domain validation (Haiku 4.5, 600 s budget). Pass = hidden pytest suite passes; durations in seconds. geotext: ×2 completes within budget while solo times out; stocktrends, textcnn: both fail (task too hard for budget).
TaskSolo (PASS, dur)×2 AgentRoom (PASS, dur)
arxiv-digestPASS, 70 sPASS, 120 s
readtimePASS, 110 sPASS, 100 s
chakinPASS, 130 sPASS, 130 s
geotextFAIL, 603 s timeoutPASS, 390 s
honePASS, 90 sPASS, 160 s
hybrid-imagesPASS, 100 sPASS, 170 s
licePASS, 330 sPASS, 270 s
particle-swarm-optPASS, 100 sPASS, 120 s
stocktrendsFAIL, 600 sFAIL, 480 s
textcnnFAIL, 601 sFAIL, 856 s
Pass rate7/108/10
Table 13: Scorer sensitivity: leave-one-out on T4 (Sonnet 4.6, solo vs ×2 AgentRoom). The solo mean reported here (0.786) is computed over a smaller subset (4 runs) than the canonical solo subset used in Table 1; the smaller subset is the intersection of solo runs for which we retained per-dimension intermediate scorer outputs at the time of writing, kept here only as a robustness check. The AgentRoom > solo ordering is preserved under every single-dimension ablation and the ratio stays within 1.12–1.25 on this subset.
Removed dimensionSolo mean×2 meanES
(none, full scorer)0.7860.9281.18
Type Safety0.7210.9041.25
Defensive Coding0.8150.9441.16
Test Quality0.8540.9561.12
Design0.7930.9211.16
Test Pass Rate0.7490.9161.22

研究结果

  • 汇总12个模型×任务组合的统计显示,单智能体放弃任务的几率是AgentRoom的13.7倍(95%置信区间3.9至48,p<10^-5,同质性检验p=0.92)。
  • 在T4金融账本任务上,Sonnet模型下AgentRoom(2智能体)的平均质量分比无协调并行合并高出0.213(Welch t=3.35,p=0.003)。
  • 在T4任务的六种条件比较中呈现明确排序:ChatDev式顺序交接(0.333)<并行合并(0.456)<单智能体(0.544)<仅共享(0.575)<无MCP的协作(0.588)<AgentRoom(0.669)。
  • AgentRoom(2智能体)相比单智能体将运行间的标准差降低约30%至45%(例如Sonnet从0.23降至0.14,Haiku从0.25降至0.17,Codex从0.27降至0.15)。
  • 将智能体数量从1扩展到4,质量分在2个智能体时达到峰值(0.669),随后在3个(0.553)和4个(0.489)时下降,消息量在超过3个智能体后呈超线性增长。

可应用场景

  • 可为构建大型多文件后端项目(API、账本系统等)的多智能体编程系统提供协调协议的设计参考。
  • 可用于缓解单智能体在困难任务上频繁放弃的问题,考虑引入文件占用与状态共享机制。
  • 在将智能体数量扩展到2个以上之前,可参考本研究提示的通信瓶颈问题来设计架构。

局限与待验证事项

  • 实验局限于Express.js/TypeScript后端任务,并辅以少量Python和Rust交叉验证,尚未在更广泛的语言和领域中验证其普适性。
  • 智能体数量增加后质量下降是否源于单一广播通道的瓶颈,尚未经受控实验证实,仍是一个未解问题。
  • 部分模型(Gemini 3 Flash、GPT-5.4-mini)因在并发MCP执行下CLI不稳定而被排除在核心结果之外,作者将此归为部署环境的局限而非AgentRoom本身的问题。
  • 用于分离MCP协调工具单独贡献的探针实验样本量较小(n=7),置信区间跨越零,因此该发现被解读为顺序关系而非精确的百分比划分。
  • 不同模型组合(如Sonnet+Codex与Sonnet+Gemini)的效果差异很大,说明协调机制并不能消除模型间的能力差距。

为什么重要

对于部署多AI智能体协作编程的人来说,这项研究提供了证据:加入文件占用、状态共享等显式协调机制,比简单地并行运行或按顺序分工更能降低失败率、减少结果波动。但效果因模型和任务难度而异,不应被理解为在所有场景下都能保证性能提升。

本文术语

  • CRDT(无冲突复制数据类型) · 一种让多人或多个程序同时修改同一数据也能自动无冲突合并的数据结构,常用于实时协同编辑工具。
  • MCP(模型上下文协议) · 一种让AI模型调用外部工具或查询系统状态的标准接口。
  • 单文件放弃(stub-and-exit) · 智能体只写出一个文件的骨架代码后判断任务太难而提前退出的失败模式。
  • LLM评判分数 · 由另一个语言模型(此处为Sonnet 4.6)依据固定评分标准,对输出结果给出0到1之间质量分数的方式。
  • 并行合并(parallel-merge) · 多个智能体在各自独立的工作区中工作,事后再合并文件,过程中没有实时协调。

论文原文摘要(英文)

Concurrent multi-agent coding promises division of labor across modules, robustness through redundancy, and parallel exploration at the natural granularity of multi-file projects. Realtime collaborative editing protocols solve this coordination problem for human teams via Conflict-free Replicated Data Types (CRDTs), but the LLMs underneath generate one token at a time and existing multi-agent coding systems inherit this serial limit: they either sequence agents through phase handoffs or pool independent samples without coordination, and a single agent abandons up to half of hard tasks with a one-file stub-and-exit. AgentRoom is a realtime collaborative editing protocol for concurrent coding agents. Its runtime layer exposes file-level claim, status, and broadcast as MCP tools on a CRDT-merged shared filesystem. Five frontier coding-CLI models ran four backend coding tasks, with cross-language checks in Python DevBench and Rust+axum. For CLI-stable models, AgentRoom with 2 agents abandons fewer tasks than Solo and has less run-to-run variation. At matched-compute, one positive mean LLM-judge contrast puts AgentRoom over parallel-merge. The other contrast, a bundle probe, puts full AgentRoom above each partial case: an ordering rather than a percentage split. Coordination, not parallelism or CRDT-merge, bears the load.

作者 · Seonglae Cho, Donghyun Lee

在 arXiv 阅读

最新论文

全部论文 →

METAL LAB 最新报道

图片来源: Seonglae Cho et al., arXiv:2608.23740, CC BY 4.0