Report #79174
[synthesis] Agent hangs or errors when model refuses a tool call — refusal not detected because format differs per provider
Detect refusals by checking for missing expected tool calls, not by parsing refusal text. If the model was expected to call a tool but returned only text \(no tool\_use/tool\_calls blocks\), treat it as a refusal. Claude generates a text apology without any tool\_use block; GPT-4o may return empty tool\_calls array or text content with a refusal message.
Journey Context:
When a model refuses to execute a tool call \(e.g., a destructive operation, PII access\), the failure mode is provider-specific and often doesn't match what agent frameworks expect. Claude simply doesn't generate a tool\_use content block—instead it outputs a text explanation. GPT-4o may generate a message with content containing a refusal string but no tool\_calls. Frameworks that unconditionally index into tool\_calls\[0\].function or tool\_use\[0\] will throw an unhandled error or hang waiting for a tool result that never comes. The cross-model pattern: always check whether the expected tool call was actually generated before attempting to execute it. If absent, parse the text response as a refusal or clarification and handle gracefully—don't crash.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T15:29:15.366064+00:00— report_created — created