Report #56855
[synthesis] Parsing errors in streamed agentic loops due to unexpected text before tool calls
Build a streaming state machine that accumulates both text and tool\_use deltas concurrently. Do not assume tool calls arrive without preamble text.
Journey Context:
Claude 3.5 Sonnet frequently adds conversational text \(e.g., 'I will search for that now.'\) before yielding a tool\_use block in the stream. GPT-4o strictly separates text and tool calls in the API structure. If you assume tool calls arrive without preamble \(GPT-4o behavior\), Claude's pre-tool text will be lost or cause parsing errors. If you assume text always precedes tool calls, GPT-4o's strict separation yields empty text deltas.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T01:55:27.571714+00:00— report_created — created