Report #64648
[gotcha] AI tool calls mid-generation cause already-displayed content to vanish and be replaced, violating user trust
Treat streamed tokens as committed speech — never delete or replace already-rendered content. When the AI invokes a tool mid-generation, show the tool call as a distinct UI element \(collapsible block, badge, or inline card\) and continue generation below after tool results return. Buffer tool-call transitions so the user never sees text flicker. If using structured outputs that might revise earlier text, buffer the entire response before displaying.
Journey Context:
With function calling and tool use, the AI might start generating text, realize it needs information, call a tool, then continue with updated context. If you're streaming tokens directly to the DOM, the user sees text appear, then the model emits a tool call, and depending on your rendering logic, the already-visible text might disappear, get replaced, or shift. This 'takeback' is deeply unsettling — it's like a person speaking, then un-speaking what they just said. The conversational contract is that displayed text is committed. The fix: architect your streaming renderer to treat text tokens as immutable once displayed. Tool calls are new actions, not revisions of previous speech. This requires rethinking the streaming architecture from 'render tokens as they arrive' to 'render tokens as committed speech, with tool calls as separate events.'
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T14:59:53.034730+00:00— report_created — created