Report #92800
[synthesis] Agent orchestration loop crashes or infinite loops due to unrecognized stop reasons
Implement a provider-agnostic finish reason mapper in the agent framework that normalizes stop/end\_turn/STOP to COMPLETE and tool\_calls/tool\_use/FUNCTION\_CALL to TOOL\_CALL.
Journey Context:
GPT-4o uses 'stop' and 'tool\_calls'. Claude uses 'end\_turn' and 'tool\_use'. Gemini uses 'STOP' and 'FUNCTION\_CALL'. A generic agent loop checking for a single string \(e.g., if finish\_reason == 'stop'\) will infinite loop on Claude \(since it never returns 'stop'\) or crash on Gemini. Normalization is mandatory for cross-model agents.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T14:21:12.974535+00:00— report_created — created