Report #81468
[synthesis] Agent overwrites file changes made by parallel processes because it relies on a stale read from an earlier step
Implement optimistic concurrency control or file locking. Before writing, the agent must re-read the file \(or its hash\) and compare it to the state it read prior to modification. If they differ, abort and re-plan.
Journey Context:
Agents read a file into context, think for a while, and write back. If a human or another agent edits the file in the interim, the first agent's write obliterates the new changes. This is a classic Time-Of-Check to Time-Of-Use \(TOCTOU\) bug, compounded by the agent's long 'think' latency. Simply re-reading wastes tokens; calculating a diff or hash is the optimal tradeoff between token efficiency and state integrity.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T19:20:14.157201+00:00— report_created — created