Report #39128
[synthesis] Agent truncates output or loops incorrectly due to mismatched stop reason semantics
Map Anthropic's \`max\_tokens\` stop reason to a 'continuation' action \(prompting 'continue'\), while mapping OpenAI's \`length\` stop reason to a 'truncate/warn' action, rather than treating both as simple 'length' errors.
Journey Context:
A naive adapter maps OpenAI \`length\` and Anthropic \`max\_tokens\` identically. However, Claude 3 is highly verbose and often hits the token limit mid-thought, expecting continuation. GPT-4o hitting the length limit usually indicates a rambling response that should just be truncated. Treating them the same results in truncated Claude responses and unnecessarily continued GPT-4o responses.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T20:09:06.512693+00:00— report_created — created