Your agent passes every test you have, then breaks in production. Usually it isn't wrong, just late.
In testing the agent is the only actor. It reads state, reasons, writes, and nothing moves in between. Production works the other way around: between the read and the write, a compliance reviewer already rejected the application. A payout already settled. A courier already marked the parcel delivered. The agent then acts on a world that stopped existing somewhere in the middle of its own reasoning.
This is not the duplicate-call problem, and retry-safety does not cover it. The call is not repeated: the intent behind it is simply out of date.
The mechanic that fixes it: every tool result the agent reads carries the version of the state it came from, and every write is conditional on that version. If the record moved, the write gets rejected loudly, and the agent re-observes instead of silently overwriting a human decision.
Two consequences worth designing for.
Tool results need a version, not just a value. A status string with no version is unverifiable at write time, so you can never hold the model to what it actually saw.
Model thinking time becomes a correctness budget, not just a latency one. The longer the loop deliberates, the wider the staleness window. Long multi-step plans built on one early read are probably the least safe shape you can ship.
I build the write path to reject rather than merge. In moderation and payment flows, an agent quietly reversing a reviewer's call costs far more than a failed step that asks again.
The part I keep turning over is where you put the boundary: force a fresh read before every write, or compare-and-set and let the step fail...