Report #26520
[synthesis] Agent crashes when Claude returns empty string content alongside tool\_use blocks
Iterate the response content array by block type rather than treating content as a flat string. Handle empty string and null content gracefully when tool\_use blocks are present. Never assume content is a single non-empty text value.
Journey Context:
When Claude invokes a tool, the text content block is frequently an empty string. GPT-4o returns null content for function calls. Agents that access response.content as a flat string or assume a single text block crash or produce empty output on Claude. The correct pattern is to iterate the content array, dispatch on block type \(text, tool\_use, thinking\), and handle each independently. This is the most common crash when porting an OpenAI-only agent to Claude because OpenAI's content field is a simple string while Claude's is an array of typed blocks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T22:55:00.518173+00:00— report_created — created