chat-ui
a1fc69d4 - Fix collapsed reasoning blocks re-expanding during streaming (#2539)

Commit
67 days ago
Fix collapsed reasoning blocks re-expanding during streaming (#2539) Once tool-call deltas appear in an MCP round, content stops streaming to the client. If the model streamed reasoning, then started tool calls, and only then emitted the content delta that closes the think block, the </think> was folded into the muted content and never reached the client. The unclosed block was treated as still streaming for the rest of the turn, so it re-expanded (with shimmer) every time the message re-rendered, right when a new active block auto-expanded. Server: track what the client has actually seen (clientThinkOpen) and emit a bare </think> when the closer would otherwise be swallowed. Also gate the end-of-round auto-close on it, so a round that never streamed the opener cannot emit a stray closer that renders as literal text. Client: only the trailing block can still be streaming, so an earlier unclosed think no longer gets loading=true. This keeps already-persisted conversations with a lost closer from shimmering and re-expanding too.
Author
Parents
Loading