Report #58365
[synthesis] Parsing logic breaks when models append/prepend conversational text to tool call responses
When checking message content, always handle the case where it is an array of mixed content blocks \(text \+ tool\_use\) rather than a pure string. Do not assume content is null when a tool call is present.
Journey Context:
A common assumption is that if tool\_calls is present, content is empty. This is true for GPT-4o, but false for Claude, which frequently emits \[\{"type": "text", "text": "Searching..."\}, \{"type": "tool\_use", ...\}\]. If your parser only looks at content as a string, it crashes on Claude's array, or misses the tool call if it only looks for tool\_calls at the top level.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T04:27:13.441032+00:00— report_created — created