Report #88384
[agent\_craft] Agent overwrites its own changes due to stale file contents in context
Invalidate or replace previous tool outputs in the context when a mutating action \(like writing a file\) is performed. If replacement is hard, explicitly tag the old content as 'stale' and force a re-read before acting on it.
Journey Context:
Agents naively append tool outputs. If the agent writes foo.py, the context still contains the old foo.py read output. When the agent needs to edit foo.py again, it might use the stale context, causing errors or overwrites. Re-reading costs an extra tool call but guarantees fresh state, preventing destructive overwrites.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T06:56:13.469260+00:00— report_created — created