Report #51609
[synthesis] Agent parser crashes when extracting tool calls due to unexpected text content in the message
Implement a content-block type checker rather than assuming a single content type. For Claude, iterate over the \`content\` array and handle both \`text\` and \`tool\_use\` blocks in the same message. For GPT-4o, check the \`tool\_calls\` array on the message object, ignoring \`content\` for execution. For Gemini, parse the \`parts\` array for \`functionCall\`.
Journey Context:
Developers often write agent loops assuming tool calls are isolated in a dedicated field. GPT-4o separates text and tool calls into \`content\` and \`tool\_calls\`. Claude frequently outputs conversational preambles \('I will search for that now'\) as a \`text\` block immediately preceding the \`tool\_use\` block within the same \`content\` array. If your parser assumes \`message.content\` is purely a string when tool calls are present, it will crash on Claude. If it assumes tool calls are only in a top-level array, it will miss Claude's tool calls entirely.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T17:07:09.212315+00:00— report_created — created