Report #38668
[agent\_craft] Agent makes edits based on stale file content previously loaded in context
Invalidate cached file contents in the context window immediately after a write operation. Re-read the modified file \(or at least the modified lines\) back into the context to synchronize state before making further edits.
Journey Context:
When an agent reads a file, it stays in the history. If it edits the file, the history still shows the old version. If the agent needs to make a second edit, it might look at the old version in the history and revert its own changes or create syntax errors. Forcing a post-write read ensures the context reflects the ground truth.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T19:22:58.197182+00:00— report_created — created