三個智能體共用一個程式碼庫:團隊尚未建立應對機制的協調問題
Three Agents, One Repo: The Coordination Problem Nobody Designed For
多個 AI 智能體同時在一個程式碼庫工作,會帶來機械衝突、語義衝突和重複衝突三類協調問題。語義衝突可能在合併乾淨、各自編寫的測試都通過後,仍讓系統保留互不相容的假設。作者建議以工作認領隊列、責任範圍圖、智能體間合併閘門及人工整合負責人明確協調;大多數團隊初期未必需要控制平面。
Three Agents, One Repo: The Coordination Problem Nobody Designed For
One coding agent is a productivity tool. Two agents in the same repository is a sociology experiment. Three is a coordination problem that most teams solve for the first time in production, on a Friday.
The infrastructure conversation covers fleet orchestration and control planes. It skips the boring, decisive question: what happens when two agents touch the same file at the same time, and who resolves what they did to each other?
The Three Collisions
The mechanical collision is the friendly one. Two agents edit the same lines, git refuses to merge, and the failure is loud. Everyone notices. This is the good case, because the system said no.
The semantic collision is the dangerous one. Agent A changes the meaning of a function's return value. Agent B, working from the old contract, builds a feature that reads it. The merge is clean. The tests each wrote still pass in isolation. The system now believes two incompatible things, and nothing failed anywhere.
The duplicate collision is the expensive one. Two agents, given overlapping tickets, build the same feature twice with different names. Both PRs look competent. One of them is pure waste, and until someone notices, both are load.
None of these are exotic. They are the exact failure modes human teams have, at a speed that breaks the human mechanisms we built to catch them.
The Human Mechanism We Forgot to Port
Human teams coordinate through standups, hallway conversations, and ownership maps. "I'm touching the auth module, don't start there." It is informal, inefficient, and it works.
Agents attend no standup. They hold no grudges, share no memory, and read no hallway. The coordination layer has to become explicit, which means it has to become infrastructure:
A claim queue. Work is assigned or claimed, and a claim is visible. No two agents start the same ticket because the ticket said who started it. This is a work queue, not a scheduler, and it can be a spreadsheet before it is a platform.
An ownership map. Which files, modules, and decisions belong to which stream of work. Agents respect boundaries they are told about. They cannot respect boundaries nobody wrote down.
A merge gate between agents. Agent PRs that touch adjacent areas wait for the earlier one to land. Serializing the hot paths costs throughput and buys correctness, which is a trade humans already make every day.
A human integration owner. When agent PRs collide, a person who owns the integration decides. Not because humans are faster. Because someone has to be accountable for the seam, and accountability does not delegate to a process.
💡 Pro-tip: the semantic collision is the one to design against first. The mechanical one announces itself. The semantic one ships clean, passes its own tests, and gets discovered by a customer. A shared contract check between agents working in the same area is worth more than any lock.
Where This Breaks Down
Two or three agents on one repo is not a fleet, and the interesting failures will not always reproduce on demand. Solo developers with a single agent can skip all of this. The problem arrives the first time someone parallelizes "funnel all the open tickets to the agents" without anyone asking which tickets share a codepath.
There is also a real risk of over-engineering: most teams need a claim queue and a merge order, not a control plane, on day one.
But the direction of travel is obvious. The team now includes non-human contributors, and every org-design problem humans ever had, multiplied by speed and stripped of social instinct, is coming to a repository near you.
How many agents touch your repo before the first collision, and who resolved it? Was it loud, or was it clean?
References
- The fleet-level version of this problem, and why agent fleets need a control plane: Kubernetes for Agents
- The gatekeeper pattern for what agents may do when they get there: I Stopped Trusting AI Agents With Tools. So I Built a Gatekeeper.
來源:DEV Community · dev.to