Report #83231
[gotcha] AI tool call arguments are silently lost when streaming because your handler only processes text content deltas
When consuming streaming responses, handle all delta types in each chunk — not just content deltas but also tool\_calls deltas. Tool call arguments arrive incrementally as function\_call delta events. Your stream consumer must accumulate these deltas across chunks and reconstruct the complete tool call arguments before executing the tool.
Journey Context:
When building streaming chat UIs, developers typically wire up the stream to render text content deltas as they arrive. This works great — until the model decides to call a tool instead of or in addition to generating text. Tool call arguments arrive as a different delta type in the stream. If your stream consumer only looks at content deltas, the tool call is silently dropped. The user sees nothing — no text, no tool execution, just an empty or hanging response. This is especially insidious because it's intermittent: some responses are text-only and work fine, others trigger tool calls and silently fail. The failure mode looks like the AI is just ignoring the user. The fix is to handle the full streaming schema: check each chunk for both content and tool\_calls fields, accumulate tool call argument deltas across chunks, and trigger tool execution once the complete arguments are received.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:17:27.668540+00:00— report_created — created