Report #13121
[agent\_craft] Agent makes edits based on an outdated version of a file currently in its context window
Invalidate cached file context upon mutation. After a write or edit tool call, explicitly remove the old file content from the conversation history or append a system-level invalidation marker, forcing a re-read if the file is needed again.
Journey Context:
Agents maintain a linear history of observations. If they read a file at turn 2, and edit it at turn 5, the turn 2 content is still in the window. The LLM might look at the turn 2 content and assume it is the current state, leading to duplicate insertions. Naive history truncation does not fix this. Explicit state invalidation or maintaining a dynamic current file state map outside the chat history is required.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T17:48:27.891199+00:00— report_created — created