Report #87543
[synthesis] Agent loop terminates unexpectedly when switching LLM providers due to unrecognized tool call stop reasons
Normalize the stop reason field in the agent's orchestration layer immediately after the API response. Map OpenAI's finish\_reason: 'tool\_calls' and Anthropic's stop\_reason: 'tool\_use' to a canonical internal state \(e.g., PENDING\_TOOL\_EXECUTION\) before routing logic.
Journey Context:
OpenAI uses finish\_reason: 'tool\_calls' \(or stop\_reason: 'tool\_calls' in the Assistants API\), while Anthropic uses stop\_reason: 'tool\_use'. Agent frameworks that strictly check for one string will silently exit the tool loop when the other model is used, returning the tool call JSON as plain text to the user. Normalizing this at the adapter layer prevents the core orchestration logic from needing provider-specific branching.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T05:31:37.871376+00:00— report_created — created