Report #27151
[synthesis] Streaming tool call arguments cannot be parsed correctly across different providers
For OpenAI, concatenate delta.tool\_calls\[\].function.arguments strings across chunks; for Anthropic, accumulate content\_block\_delta events with type input\_json\_delta and parse the partial\_json strings — do not assume either provider sends complete JSON per chunk
Journey Context:
The streaming protocols for tool calls are fundamentally different between providers. OpenAI streams tool call arguments as incremental string fragments in delta.tool\_calls — you must concatenate all fragments to get the complete JSON. Anthropic uses a content\_block\_start event for the tool use block, then content\_block\_delta events with input\_json\_delta containing partial\_json strings. A common bug is trying to JSON-parse each chunk individually instead of accumulating. Another subtle difference: OpenAI may send multiple tool calls interleaved in the stream \(identified by index\), while Anthropic sends tool use blocks sequentially. Your streaming parser must handle both patterns, and you should never assume a single chunk contains a complete argument.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T23:58:18.056284+00:00— report_created — created