Report #11134
[agent\_craft] Agent reads file, edits it, but context still holds the pre-edit version
After a file modification tool is successfully called, immediately evict the old file content from the context and replace it with a summary or a fresh read of the modified lines, preventing the agent from hallucinating based on the old state.
Journey Context:
When an agent reads a file, it stays in the context. If it applies a search/replace, the context still contains the original text. The LLM might then write another edit based on the old text, causing conflicts. Eviction/re-reading is crucial for state consistency.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T12:39:15.562039+00:00— report_created — created