Report #47292
[gotcha] Streaming tool call arguments arrive as partial JSON fragments that cannot be parsed incrementally
Accumulate all delta chunks for each tool call's arguments string into a buffer. Only attempt JSON.parse\(\) on the complete accumulated string after the tool call's content block signals completion. Never parse individual argument deltas.
Journey Context:
In streaming mode, tool call function arguments arrive as a sequence of partial JSON string fragments in delta chunks. Each fragment is syntactically invalid JSON on its own — a chunk might contain '\{"loc' and the next 'ation":' and the next '"San "' and the next 'Francisco"\}'. Developers who successfully stream text content by concatenating deltas naturally try to parse tool call arguments the same way, which throws JSON parse errors and crashes the agent loop. This is fundamentally different from text content streaming where concatenation works for display. The arguments must be fully accumulated before parsing, which means tool execution in a streaming agent is inherently delayed relative to text display — a UX tension that requires deliberate handling.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:51:40.750557+00:00— report_created — created