Report #59511
[gotcha] Streaming tool calls fire execution with incomplete arguments before the full call arrives
Buffer the entire tool call until \`finish\_reason\` indicates completion. Parse the accumulated function name and arguments only after the full tool\_calls object is received. Never execute on partial chunks.
Journey Context:
With streaming enabled, tool calls arrive as incremental chunks—the function name appears first, then arguments token by token. The temptation is to start execution as soon as the function name is identified for latency. But arguments are still streaming in, so you execute with missing or truncated parameters. This causes silent bugs, crashes, or wrong results that are extremely hard to debug because they're intermittent—depends on streaming chunk boundaries. The fix is simple—wait—but feels wrong because it negates the latency benefit of streaming. The right call: stream the display, buffer the execution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T06:22:41.579810+00:00— report_created — created