Video wird geladen...
Video konnte nicht geladen werden
As soon as you try to run 2 agents on the same data, everything breaks: • Agent 1 reads some data and starts working. • Two seconds later, Agent 2 changes that same data. This is a problem. Agents will waste tokens on stale data, overwrite each other's work,... show more
27,851 Aufrufe • vor 3 Tagen •via X (Twitter)
32 Kommentare

I ran into this exact problem. This is exactly why we put an orchestrator in the middle with @trytermsquad. One agent owns the plan, splits the work, and gives each agent a clear responsibility so they don’t step on each other. Then shared memory keeps everyone working from the same context instead of rediscovering everything independently. That’s the flow that worked best for me

two sessions each read my notes file and wrote it back with one more entry, so the second erased the first. locking the file itself and writing into it in place fixed it, since replacing a file leaves the other locks on the old copy. twelve writers at once then lost nothing.

I hit a small version of this with three agents sharing one logged-in browser. Running them in parallel meant one agent navigated away from the page another was typing into. I now run them strictly in sequence, which costs time and was still cheaper than debugging overwritten state.

This is really a good concept. Remind me when multiple developers works on the same codebase and we get conflicts and we created ways to solve it

ended up giving each agent its own write scope, coordination never held.

The fix is boring on purpose: give the data a single writer. Both agents read freely, only one commits, and the other files intents in a queue. That's how you kill the stale-read race.

Separate copies only move the conflict to the merge boundary. Coordination needs versioned reads and explicit commit contracts.

🔥

Stale data + overlapping writes is such a common agent headache. Copy-on-write with a clear merge trail feels like the right instinct. Curious how it handles conflicts when two agents touch the same node.

agent 1 doesn't notice, it just writes a very confident commit about data from two seconds ago. we ended up putting one loop in charge of who touches what

The ugly version is the conflict at read time, not write time: Agent 1 is already mid-reasoning on a stale snapshot when Agent 2 changes the data. Locks protect the write. Nothing rolls back the thinking.

This times 1000. Running multiple agents on one external brain breaks the system. And I’m just talking about the individual level. Just imagine having 3 friends trying to coordinate with you at one time but they don’t talk to each other.

The useful boundary is a version check at the point of write. If agents can act on a snapshot they read minutes ago, more parallelism just turns stale context into fast corruption.

Branch and merge is the right mental model. The hard part is merge conflicts: when two agents change the same field, who wins? Last write, human review, or a rule per data type? That decides if it's safe for real workflows.

we had agents break stuff in code they never even touched, took ages to find :( how do you split the work between them, by data or by task?

branch and merge covers the stale read. the one that hides better is the retry: agent 2 merges, the response gets lost, the orchestrator reruns it, and the same changes land twice. stale data shows up as a wrong answer. a doubled write looks like success.

two agents one dataset is just distributed systems with worse error messages. locks or someone eats tokens forever

The unglamorous product feature is ownership: every shared record needs one clear writer and a visible handoff, or multi-agent just parallelizes the mess.

State isolation has to be a design requirement before you deploy agents, not a runtime fix. Optimistic locking, read-then-claim patterns, or event sourcing all work. But you have to pick one before you scale. Teams that skip this ship once and rewrite.

branch-and-merge just pushes the race condition to merge time. in messaging agents, leasing the conversation scope with a short ttl before calling the model prevents the split in the first place. if the lease is taken, queue the turn or discard the duplicate event

agent atomic locks

Multi-agent systems fail the same way concurrent software always failed: shared mutable state without a merge/coordination layer. Prompting harder does not fix stale reads, overwrite races, or missing audit trails. The durable stack is identity + versioned context + merge semantics — classic distributed systems, now sitting under agent runtimes.

Multi agent systems run into the same problems as distributed systems. Agents need versioning, conflict resolution, and a way to track who changed what. Sharing context isn't enough.

Git worktrees are solving this problem first coders

副本加合并就是把git分支搬进代理编排,我们需要适当的协调

two agents on the same data and everything breaks. the multi-agent future needs a traffic controller

AI builders really spent two years reinventing database locks and git.

Git 那套分支加合并的思路搬到 agent 上来了,每个 agent 各开一个分支干活,合并的时候再审一遍,这个方向挺对的

multi agent resurrects classic concurrency. shared mutable context needs locks copies or merge, not better prompts. ship coordination before the swarm.

locking the row is the easy half. the part that bites is the plan. agent reads a row, builds six steps off it, row changes at step two, it finishes all six and reports success. stale data is cheap. a confident wrong completion is the one you pay for.

this is useless tooling for made up problems plz dont fall for this bait

Good angle: multi-agent coordination is becoming a systems problem, not a prompting problem.
