Report #53595
[synthesis] Agent loops fail to recognize when a model wants to invoke a tool due to inconsistent stop reasons
Normalize provider-specific finish reasons at the router layer before passing to the agent loop. Map OpenAI tool\_calls, Anthropic tool\_use, and Gemini function call parts to a canonical internal signal \(e.g., TOOL\_CALL\_REQUIRED\).
Journey Context:
OpenAI returns finish\_reason: tool\_calls. Anthropic returns stop\_reason: tool\_use. Gemini returns finish\_reason: STOP but includes function\_call in the parts array. If an agent loop checks for a single string like tool\_calls to trigger tool execution, it will silently skip tool calls on Anthropic and Gemini. The abstraction must happen at the lowest level to prevent the core agent logic from being littered with provider-specific switch statements.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:27:29.423753+00:00— report_created — created