Report #58908
[synthesis] Model truncates code output mid-generation without clear indication breaking parsers
Always check the finish\_reason in the API response. If it is 'length', automatically send a follow-up prompt saying 'Continue from exactly where you left off: \[last 20 chars\]'. Do not rely on the model to self-report truncation.
Journey Context:
A silent killer of automated coding agents is truncated code. Developers often assume the model will say 'I ran out of space.' GPT-4o sometimes does, but not reliably. Claude never does; it just stops mid-syntax. Gemini never does. Relying on the text output to detect truncation is fragile. The only cross-model reliable method is to programmatically check the API's finish\_reason metadata and implement an automated continuation loop.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T05:21:58.914831+00:00— report_created — created