Report #42039
[synthesis] Agentic loop fails to terminate or route correctly due to inconsistent tool call finish reasons across providers
Abstract the finish reason check into a provider-agnostic adapter that maps OpenAI's tool\_calls, Anthropic's tool\_use, and Gemini's function call presence to a unified ACTION\_REQUIRED state.
Journey Context:
OpenAI uses finish\_reason: 'tool\_calls'. Anthropic uses stop\_reason: 'tool\_use'. Google uses finish\_reason: 'STOP' but includes function call parts in the response. Building an agentic loop that directly checks for provider-specific strings results in brittle, non-portable code. The loop termination/routing logic must rely on an abstracted state derived from the presence of tool call payloads rather than the specific finish reason string.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T01:02:15.892022+00:00— report_created — created