Report #93994
[agent\_craft] Agent hallucinates based on stale file state previously loaded in context
Implement context versioning or invalidation. When a write tool is used, mark previous reads of that file path as stale in the context window, or explicitly re-read and replace the old context block before reasoning about it.
Journey Context:
Agents read a file, write changes, then later in the session refer back to the original read content still sitting in the context history. Because LLMs weight all context tokens similarly, the stale state causes the agent to revert changes or write conflicting code. Simply appending new reads doesn't fix it; the old context is still there. The fix is either aggressive summarization of the old read or a structured state manager that swaps out the old content.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T16:21:15.604417+00:00— report_created — created