-
Stream Playground responses for every model (#942)
发布于
2026-08-20 15:38:45 +00:00 The Playground only streamed fusion; ordinary chats blocked on the full
response, so long generations looked frozen. Now every send asks for a
stream and renders deltas as they arrive.- New client/src/lib/playground-stream.ts parses the proxy's SSE framing
(split frames, CRLF, choice-less usage frame, in-band error frames,
tool_call deltas skipped, missing [DONE]) with 20 unit tests. - Reasoning deltas render inside the assistant bubble in FusionTrace's
visual style, auto-collapsing when the answer starts. The proxy holds
the preamble until an attempt commits, so reasoning lands together
with the first token — the trace arrives collapsed and expandable. - Auto-scroll now follows the stream only while the reader is at the
bottom; scrolling up detaches it (direction-aware, so our own smooth
scroll doesn't cancel the follow), and sending or clearing re-engages. - Metadata parity with the blocking path via X-Routed-Via and
X-Fallback-Attempts; latency hidden while streaming. Mid-stream errors
keep the partial answer and add an error bubble. Clear/unmount aborts
the fetch cleanly.
Verified end to end in headless Chromium against a local gateway and a
mock SSE provider: 25 distinct partial render states during one answer,
reasoning expandable, scroll position held while streaming.Co-authored-by: Claude Fable 5 noreply@anthropic.com
下载附件
- New client/src/lib/playground-stream.ts parses the proxy's SSE framing