Report #78949
[synthesis] Streaming tool call arguments are fragmented differently across providers causing parsing failures in agent frameworks
For OpenAI, accumulate tool\_call function.arguments deltas by index — concatenate partial JSON strings per tool\_call index. For Claude, watch for content\_block\_start with type tool\_use to get id and name, then content\_block\_delta with type input\_json\_delta for partial JSON, then content\_block\_stop to finalize. Never attempt to parse partial JSON — always wait for the block stop signal.
Journey Context:
OpenAI streams tool calls as delta fragments indexed by tool call position, and arguments arrive as partial JSON strings you concatenate per index until the stream ends. Claude streams tool calls as typed content block lifecycle events — you get the tool name and id at block start, incremental JSON deltas during the block, and a stop event to signal completion. Attempting to use OpenAI's concatenation-by-index strategy on Claude's stream will fail because the event topology is fundamentally different \(lifecycle events vs flat deltas\). The synthesis insight: build a provider-specific stream accumulator that knows which event types to watch for, buffers partial arguments, and only emits a complete tool call when the termination signal fires. This is one of the most common and subtle bugs in multi-provider agent frameworks — it works perfectly with one provider and silently drops or corrupts tool call data with the other.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T15:06:35.387682+00:00— report_created — created