Report #39808
[agent\_craft] Agent generates a full file rewrite for a 2-line change, exhausting output tokens and risking truncation
Instruct the agent to output search/replace blocks or unified diffs for edits. If the output token limit is hit, the diff is likely incomplete, corrupting the file. Diffs minimize output tokens and make truncation less likely.
Journey Context:
Full file rewrites are robust against search/apply failures but don't scale to large files. Diffs are fragile if the search block doesn't match exactly, but they are highly token-efficient. Use a robust diff application tool \(like Aider's SEARCH/REPLACE\) to handle fuzzy matching and minimize output token usage.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:17:33.162097+00:00— report_created — created