Skip to content

fix(message): render markdown while streaming assistant output#3337

Open
SuMuxi66 wants to merge 1 commit into
esengine:main-v2from
SuMuxi66:fix/streaming-markdown-render
Open

fix(message): render markdown while streaming assistant output#3337
SuMuxi66 wants to merge 1 commit into
esengine:main-v2from
SuMuxi66:fix/streaming-markdown-render

Conversation

@SuMuxi66
Copy link
Copy Markdown

@SuMuxi66 SuMuxi66 commented Jun 6, 2026

Summary

Fix assistant messages to render Markdown while streaming, instead of showing raw Markdown text until the assistant turn completes.

Before

During streaming, assistant output was rendered as raw text, so users could temporarily see Markdown syntax such as:

  • | table |
  • **bold**
  • code spans

Markdown formatting only appeared after the turn finished.

After

Assistant output always renders through the Markdown component.
When the message is still streaming, the cursor is appended after the rendered Markdown.

Files changed

  • desktop/frontend/src/components/Message.tsx

Test checklist

  • Streaming tables render as Markdown instead of raw |
  • Bold / code spans render during streaming
  • Streaming cursor still appears while the answer is in progress
  • Cursor disappears after the turn completes
  • Final Markdown output still renders correctly
  • Copy button behavior is unchanged
  • Reasoning fold/unfold still works

Scope

This PR only changes assistant message rendering while streaming.
It does not change the Composer, past:chats, file references, or the CLI/TUI flow.

@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 6, 2026
@SuMuxi66 SuMuxi66 closed this Jun 6, 2026
@SuMuxi66 SuMuxi66 reopened this Jun 6, 2026
Copy link
Copy Markdown
Collaborator

@SivanCola SivanCola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is the right direction and the scope is much cleaner than the broader streaming-markdown work in #3140. I think this PR should be the main path for the focused assistant streaming markdown fix.

Before merging, please fix the streaming cursor placement. Markdown renders a block-level .md wrapper, so rendering <span className="cursor" /> as a sibling after <Markdown /> places the cursor after the markdown block rather than at the end of the rendered text. For normal paragraphs this will show the cursor on the next line, not after the last token.

Please make the cursor render as part of the final rendered markdown content, then verify paragraphs, lists, tables, and code blocks while streaming.

Once this is addressed and verification stays green, I will consider merging it into main-v2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants