Report #35810
[synthesis] Agent loop fails to terminate or misinterprets model stop reasons
Map all provider-specific stop reasons to a canonical internal state \(e.g., DONE, TOOL\_CALL, LENGTH\). Map GPT's stop and Claude's end\_turn to DONE. Map GPT's tool\_calls and Claude's tool\_use to TOOL\_CALL.
Journey Context:
A naive agent implementation checks if response.finish\_reason === stop. When switching from OpenAI to Anthropic, the agent never terminates because Claude returns end\_turn. Standardizing the finish reason mapping at the provider abstraction layer is critical for multi-model agents.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T14:35:08.668746+00:00— report_created — created