Multi-agent LLM systems -- coding agents, devops agents, document agents -- now routinely run several agents in parallel against the same git tree, Kubernetes cluster, or document. As soon as two of them mutate shared state, they enter the regime classical concurrency control has studied for decades, but classical mechanisms fit LLM agents poorly. A single agent transaction spans minutes of inference, read sets are broad and opaque rather than statically inferable, and the live state agents act on admits neither fork nor buffer, so writes take effect the moment they execute. Locks block long inference intervals; OCC abort-and-retry discards minutes of work on every conflict. This paper builds concurrency control on a capability classical transactions lack: the LLM inside each agent can judge whether a conflicting write invalidates its plan, and can repair exactly the operations that depended on it. Control therefore turns advisory: the runtime informs, the agent repairs. Our protocol, MTPO (Monotonic Trajectory Pre-Order), fixes a serialization order at launch, serves each read the order-filtered value, and applies writes speculatively in place; a one-way notification asks an affected reader to re-judge and patch its plan, while the framework mechanically undoes and reorders misplaced writes through the saga-style inverse each tool registers in advance. At quiescence the run is serializable in the pre-decided order. We realize MTPO as CoAgent, toolcall middleware whose privileged ToolSmith grows footprint-declared, undoable tools online. On ten contended workloads, CoAgent stays within 5\% of serial correctness at a $1.4\times$ speedup and near-serial token cost, where 2PL and OCC surrender nearly all concurrency gains; on a bash-only target system, it grows a 25-tool library online and lifts the task pass rate from 45/71 to 63/71 at $0.80\times$ the time and $0.86\times$ the cost.
翻译:多智能体大语言模型系统——编码智能体、运维智能体、文档智能体——如今常以并行方式在同一Git树、Kubernetes集群或文档上运行多个智能体。一旦两个智能体修改共享状态,便会陷入经典并发控制研究数十年的场景,但经典机制难以适配大语言模型智能体。单智能体事务跨越数分钟的推理时间,读集广泛且不透明而非静态可推断,智能体操作的实时状态既不允许分支也不允许缓冲,因此写入操作一旦执行即生效。锁机制会阻塞长时间推理间隔;乐观并发控制(OCC)的终止-重试机制在每个冲突时丢弃数分钟的工作。本文基于经典事务缺失的能力构建并发控制:每个智能体内部的大语言模型可判断冲突写入是否使其计划失效,并能精准修复依赖该写入的操作。因此,控制变为建议性:运行时提供信息,智能体进行修复。我们的协议MTPO(单调轨迹预排序)在启动时固定序列化顺序,为每次读取提供按序过滤后的值,并以原位推测方式应用写入;单向通知请求受影响的读取者重新判断并修补其计划,而框架通过各工具预先注册的 saga 式逆操作自动撤销并重新排序错位的写入。系统静止时,运行结果按预设顺序可序列化。我们将MTPO实现为CoAgent,一种工具调用中间件,其特权组件ToolSmith可在线扩展声明副作用范围且可撤销的工具。在十个存在竞争的工作负载上,CoAgent在保持串行正确性偏差5%以内的同时,实现1.4倍加速比和近乎串行的代币成本,而两阶段锁(2PL)与OCC几乎丧失所有并发增益;在纯Bash目标系统上,它在线扩展出包含25个工具的函数库,将任务通过率从45/71提升至63/71,耗时降低至0.80倍,成本降低至0.86倍。