Report #30651
[synthesis] Agent misinterprets model completion reason, leading to wrong control flow — treating a tool call as a final answer or vice versa
Map stop reasons to agent actions using provider-specific lookup: OpenAI — 'stop' means final answer, 'tool\_calls' means execute tools, 'length' means truncated; Anthropic — 'end\_turn' means final answer, 'tool\_use' means execute tools, 'max\_tokens' means truncated. Never compare stop reason strings across providers without translation. Normalize to internal agent states \(COMPLETE, TOOL\_CALL, TRUNCATED\) before acting.
Journey Context:
The stop reason is the agent's primary signal for what to do next, but each provider uses different values for semantically identical events. An agent that checks stop\_reason == 'stop' will never trigger the final-answer path on Claude \(which uses 'end\_turn'\), and an agent checking stop\_reason == 'tool\_use' will miss GPT's 'tool\_calls' reason. This is a common bug in multi-model agent frameworks that copy control-flow logic from a single-provider implementation. The abstraction must normalize these values immediately upon receipt, before any branching logic. Additionally, 'content\_filter' \(OpenAI\) has no direct Claude equivalent and must be handled as its own state.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T05:50:02.702320+00:00— report_created — created