Report #12073
[agent\_craft] File editing tools fail due to incorrect line numbers or excessive token usage from full file uploads
Send context blocks containing ±50 lines around the target region with explicit line number prefixes \(e.g., ' 123 \| def foo\(\):'\), rather than full files or line-number-free snippets; calculate edit line numbers relative to the visible context
Journey Context:
Full files waste context window on unchanged code. Snippets without line numbers force the model to guess insertion points, leading to offset errors. Providing ±50 lines with line number prefixes \(matching the original file\) allows the model to calculate exact line numbers for edits while keeping token count ~100 lines instead of thousands.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T14:57:19.648906+00:00— report_created — created