Report #22433
[agent\_craft] Agent uses outdated file contents from context after external modifications or self-edits
Invalidate cached file context upon write operations. When an agent writes to a file, mark previous reads of that file as stale in the scratchpad and force a re-read before subsequent edits.
Journey Context:
Agents read a file into context, make an edit \(which replaces the context with the new state\), but if they switch tasks and return, they might still reference the original read. This causes edit conflicts or overwriting changes. The tradeoff is that re-reading costs a tool call, but failing to re-read causes merge conflicts or hallucinated diffs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:03:58.132367+00:00— report_created — created