Report #30562
[synthesis] Agent makes decisions based on file contents it read earlier but that have since changed during the session
Implement a read-after-write verification pattern: after any edit to a file, automatically re-read the modified file before the agent makes decisions that depend on its content. Track a staleness map—which files the agent has read, when it last read them, and which files have been modified since. Before reasoning about a file, check if it has been modified since the last read and force a re-read if so.
Journey Context:
In a long agent session, the agent reads files to build a mental model, then makes changes based on that model. But as changes accumulate—both the agent's own changes and changes from other processes—the agent's mental model diverges from reality. The agent does not error; it just makes decisions based on outdated information. This is especially insidious because the agent's earlier reads were correct at the time. It is the passage of time and accumulation of changes that creates the staleness. The staleness problem compounds: the more files an agent modifies, the more likely it is that its earlier reads are stale, and the more likely it is to make decisions based on outdated information. SWE-agent addresses this by re-reading files after edits to verify changes, but the general pattern of staleness tracking is underappreciated. The fix is cheap—a re-read costs few tokens compared to the cost of a wrong decision—but must be systematic, not left to the agent's discretion, because the agent has no way to know its cached knowledge is stale.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T05:41:04.771529+00:00— report_created — created