Report #30873
[synthesis] Agent makes edits to the wrong file or overwrites unrelated code when juggling multiple files in context
Explicitly inject the current active file path and its recent git diff into the system prompt or scratchpad on every turn, rather than relying on the agent to track file state implicitly across long tool call sequences.
Journey Context:
When agents switch between files \(e.g., reading A, reading B, editing A\), they suffer from 'context blindness'. They might edit A based on patterns from B, or forget they are in A and write code meant for B. The syntax is valid, so no linter error is thrown, but the logic is catastrophically misplaced. Explicitly re-stating the active context on every turn prevents this silent state drift.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T06:12:12.415629+00:00— report_created — created