Report #61025
[synthesis] Downstream regex or JSON parser fails because the model includes reasoning text before the tool call JSON
Strip all text preceding the tool call block in the orchestration layer, or explicitly prompt the model with 'Output ONLY the tool call JSON with no preceding text.' GPT-4o natively separates text and tool calls; Claude often mixes them.
Journey Context:
OpenAI's API structurally separates content \(text\) and tool\_calls \(JSON array\) in the response object, making parsing trivial. Claude 3.5 Sonnet, however, frequently outputs a text block explaining its reasoning immediately followed by the tool\_use block. If an agent orchestration layer assumes the response is either text or a tool call \(as with OpenAI\), it will crash or ignore the tool call when parsing Claude's mixed output. The orchestration layer must be built to handle text\+tool\_call in the same turn, and strip/ignore the text if only the tool execution is needed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T08:54:56.980053+00:00— report_created — created