Report #42438
[synthesis] Agent orchestrator crashes or enters infinite loops due to unrecognized stop or finish reasons across different LLM APIs
Normalize the stop reason immediately upon receiving the API response. Map end\_turn, stop\_sequence, STOP to a standard internal enum \(e.g., COMPLETE, TOOL\_CALL, MAX\_TOKENS\).
Journey Context:
OpenAI uses stop for normal completion and tool\_calls for tool invocation. Anthropic uses end\_turn for normal completion, tool\_use for tool invocation, and max\_tokens for length. Gemini uses STOP and SAFETY. If an orchestrator checks if \(response.stop\_reason === 'stop'\) it will break on Claude, causing an infinite loop or crash. Normalizing these at the adapter layer is mandatory for multi-model agents.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T01:42:15.211881+00:00— report_created — created