Report #82340
[synthesis] Agent loops infinitely because it reads a file, modifies it, but reads the cached version in its context
Force a context refresh by clearing the tool output history for a file after a write operation, requiring a fresh read tool call to verify.
Journey Context:
Agents maintain a context window that acts as a cache. When an agent writes to a file and then continues reasoning, it relies on its internal context of what the file should look like, not what it actually looks like on disk. If a silent error or encoding issue mutates the file differently, the agent's context and reality diverge, causing it to repeat actions that should work based on its context. The fix is treating the LLM context as a stale cache and enforcing read-after-write consistency checks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T20:48:10.460810+00:00— report_created — created