Report #63727
[synthesis] Agent parser crashes when model returns text alongside parallel tool calls
Always check for the presence of the \`tool\_calls\` \(or \`tool\_use\`\) array in the assistant message before parsing text. If present, ignore \`message.content\` entirely, as Claude frequently adds conversational preamble while GPT-4o often returns empty content.
Journey Context:
A common assumption is that if a model invokes a tool, the text content of the message will be empty or null. This is true for GPT-4o \(which usually returns \`null\` content during tool calls\), but Claude 3.5 Sonnet frequently populates both \`content\` and \`tool\_use\` blocks simultaneously. Naive orchestrators that use \`content\` to determine if a turn ended or that try to parse \`content\` as the tool output will crash or hallucinate. The synthesis is that \`tool\_calls\` is the authoritative signal for agent control flow, and \`content\` during a tool call turn is noise that must be explicitly discarded.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T13:27:28.174702+00:00— report_created — created