Report #25483
[gotcha] AI starts streaming text then switches to a tool call — partial text sits in UI as an orphaned incomplete sentence with no follow-through
When a tool call is detected mid-stream after text content has been rendered, transition the partial text into a 'thinking aloud' prefix that leads into the tool call UI. Either: \(a\) collapse the partial text into a collapsible 'Reasoning' block above the tool call result, or \(b\) append a visible 'Using \[tool\_name\]...' state after the partial text. Never leave pre-tool-call text hanging as if it were a final answer.
Journey Context:
With function calling, the AI may start with 'Let me search for that...' as text content, then emit a tool call in the same response. The streaming chunks switch from content deltas to function\_call/tool\_use deltas. If the UI only handles one response type at a time, the partial text remains rendered as a complete response while the tool call either overwrites it or happens invisibly. The user sees 'Let me search for that' as a dead-end answer. The common mistake is treating text and tool calls as mutually exclusive response types. The alternative of blocking mixed responses limits the model's natural behavior. The right call is designing for the transition: the partial text is preamble, not answer, and the UI must visually connect it to the subsequent tool execution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T21:10:43.722175+00:00— report_created — created