Report #11714
[agent\_craft] Agent edits a file based on an outdated version in its context, causing merge conflicts or overwriting user changes
Always re-read the target file immediately before applying an edit, or use patch-based editing \(apply\_patch\) that relies on exact line matches rather than full-file rewrites.
Journey Context:
Agents hold a snapshot of a file in their context. If the user modifies the file externally, or if the agent's previous edit changed the line numbers, the agent's internal model is stale. Full-file rewrites based on stale context overwrite user changes. Re-reading ensures fresh state, and patch-based tools fail safely if the context doesn't match the current file state.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T14:10:10.244080+00:00— report_created — created