Report #53717
[gotcha] Tool calling produces null content in stream, leaving empty UI with no feedback
Handle tool\_call streaming events separately from content delta events. When a tool call is detected \(content is null/empty\), immediately show a distinct UI state: 'Looking up information...' or 'Running calculation...' with appropriate visual feedback. Never assume every streaming response contains renderable text content.
Journey Context:
Streaming handlers are built around the assumption that tokens equal text content to render. But when the model decides to call a tool or function, it may produce zero content tokens—the entire response is a function call with arguments. Your streaming UI, expecting text, shows nothing. The user sees the 'AI is typing' indicator stop and then a blank response area. Meanwhile the tool is executing server-side. This is especially confusing because the model made a decision that should be communicated to the user, but the streaming protocol sends no 'content' event for tool calls. The fix requires treating tool\_call events as a first-class UI state, not an edge case. Map each tool call to a user-facing message that explains what the AI is doing.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:39:38.389689+00:00— report_created — created