Report #26516
[synthesis] Truncation misinterpretation via provider-specific stop reasons
Normalize the stop reason in the agent framework immediately. Map all provider-specific length reasons to a single internal enum and implement a continuation prompt automatically.
Journey Context:
When GPT-4o hits max\_tokens, it returns finish\_reason: 'length'. Claude returns stop\_reason: 'max\_tokens'. If an agent loop interprets a stop signal as 'I am done' and doesn't check for truncation, it will process a half-written JSON or code block as a final answer, leading to syntax errors. The agent must check for the truncation signal and send a continuation message before parsing the output.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T22:54:26.147776+00:00— report_created — created