Report #50477
[synthesis] Agent misses tool call because finish\_reason check is model-specific
Check for the existence of a non-empty \`tool\_calls\` array as the primary indicator of a tool call, rather than relying solely on the \`finish\_reason\` or \`stop\_reason\` string value.
Journey Context:
Developers often check \`if finish\_reason == 'tool\_calls'\`. This fails on Claude \(which uses \`stop\_reason: 'tool\_use'\`\) and can be unreliable on GPT-4o depending on the payload structure. The robust cross-model check is simply: 'Does the message contain tool calls?' This decouples the orchestration logic from the specific string enum of the provider.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T15:12:36.932731+00:00— report_created — created