Open
Conversation
added 2 commits
February 8, 2026 12:56
…provements
- Render plain <Text> during streaming instead of Markdown to eliminate
visual glitches from incomplete markup (unclosed fences, bold, etc.)
- Add copy button with "✓ Copied" feedback to fenced code blocks
- Remove auto-scroll during streaming and on completion so users can
read at their own pace (matches Claude/ChatGPT behavior)
- Scroll to bottom only when user sends a new message
Contributor
Replace the plain <Text> streaming renderer with the existing <Markdown> component so formatting (bold, code blocks, lists, etc.) appears progressively as tokens arrive, eliminating the visual "pop" when the stream completes. Add normalizeStreamingMarkdown() to close unclosed code fences mid-stream, and stripThinkTags() to hide <think> blocks during streaming. Remove now-dead streamingTextStyle.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
SSE streaming
Server-sent events transport for real-time LLM responses on web (native path unchanged).
Includes server-side
processStreamingCompletionwith.stream()→.invoke()fallback, client-side SSE parser, and rAF-throttled UI updates.Plain text during streaming
Renders raw
<Text>instead of Markdown while tokens arrive, eliminating visual glitches from incomplete markup (unclosed fences, bold, partial links).Switches to full Markdown on completion.
Code block copy button
Fenced code blocks display a copy icon (top-right) that swaps to ✓ Copied feedback for 2 seconds.
Scroll UX
No auto-scroll during streaming or on completion (matches Claude/ChatGPT behavior).
Scrolls to bottom only when the user sends a new message.
Files changed
apps/agent/src/shared/chat.tsprocessStreamingCompletion(server),makeStreamingCompletionRequest(client),writeSSEhelperapps/agent/src/server/index.tsAccept: text/event-streamon/llm)apps/agent/src/app/(protected)/chat.tsxstreamingContentstate, streaming functions, plain text rendering, scroll-on-sendapps/agent/src/components/Markdown.tsxCopyCodeButtoncomponent, customfencerender ruleTest plan