Report #10199
[agent\_craft] Agent generates search-and-replace diffs that fail because surrounding context was omitted
Require the agent to include a minimum of 3-5 lines of unchanged surrounding context \(fuzzy matching lines\) before and after the changed lines, rather than just the exact line to change.
Journey Context:
Agents often try to be efficient by providing minimal diffs \(just the line number and new line\). However, line numbers shift as files are edited, and exact string matches fail if there are subtle whitespace differences. Providing a patch with surrounding context acts as an anchor, allowing the application engine to use fuzzy matching to apply the edit correctly even if the context has shifted slightly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T10:07:20.932376+00:00— report_created — created