perf(components): use Streamdown static mode for finished markdown - #494
perf(components): use Streamdown static mode for finished markdown#494slashdevcorpse wants to merge 6 commits into
Conversation
Finished turns no longer run the streaming remend path. Growing turns keep mode streaming. Model: grok-4.6
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9eb160757e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
The invariant now matches isStreaming: static for frozen markdown, streaming while a turn is growing. Word-level animated stays off. Model: grok-4.6
Interrupted finished turns with an open fence stay in streaming mode. Complete finished markdown still uses static mode. Model: grok-4.6
Model: grok-4.6
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a2da32471c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Interrupted finished turns with indented or tilde fences stay in streaming mode so remend still runs. Closing fence length and 4-space indents follow CommonMark. Model: grok-4.6
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d98de526f9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Interrupted finished turns with blockquote or list-nested fences stay in streaming mode. Open-fence detection uses the existing CommonMark scanner. Model: grok-4.6
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 59dcfd3c07
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| isStreaming: boolean, | ||
| text = '' | ||
| ): 'static' | 'streaming' { | ||
| if (isStreaming || markdownHasUnclosedFence(text)) return 'streaming'; |
There was a problem hiding this comment.
Track list context across continuation lines
When a cancelled response opens a fence on a continuation line of an existing list, such as 1. explanation\n ```ts\nconst x = 1, markdownFenceAt sees four leading spaces without knowing they include the list-item indent and returns no fence. This makes the new resolver choose static mode and skip incomplete-Markdown repair even though the fence remains open. This is fresh evidence beyond the prior container-prefix comment: direct-marker forms are now handled, but ordinary continuation-line forms are still missed. Preserve list-container state while scanning.
AGENTS.md reference: packages/components/src/components/ai-gui/AGENTS.md:L96-L96
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Leaving this. Open-fence detection now uses the same per-line CommonMark scanner as normalizeTexMathDelimiters. Same-line list/blockquote markers (10. ```tex, > ```tex) and 0–3 space continuation fences already stay on Streamdown streaming. A 4-space continuation after 1. explanation is an indented code block at document scope unless we carry list indent across lines. That is a full list parser, not this #421 slice. Interrupted mid-list continuation fences are an accepted freeze-path edge case (.github/codex-review.md).
|
@slashdevcorpse, this pull request needs updates before review. It is marked If the PR remains invalid for 7 days, it will be closed and marked Policy findings |
Related issue
Refs #421
Problem / pressure
Finished chat turns still render Streamdown with
mode="streaming". That path runs remend and block splitting on content that will not grow, which is on the first-visit markdown path for session switch.Summary
MarkdownRendererselects StreamdownstaticwhenisStreamingis false andstreamingwhile a turn is growing.isAnimatingis unchanged. Does not add a publish-interval cap or change Shiki caching.Before / after
mode="streaming".mode="static". Growing turns staystreaming.Test plan
pnpm --filter @lody/components exec vitest run tests/markdown-streamdown-mode.test.ts— 2 passed.acp-extension-dsh/capabilities).Context handoff
Instructions for reviewing agents
resolveMarkdownStreamdownModeand its use as Streamdownmodeinmarkdown-renderer.tsx.MarkdownRenderer. Leaving Shiki prefix caching and the rAF publish floor to later [Feature Request] Reduce streaming-time renderer energy: per-frame full-message markdown re-parse and Shiki re-highlight #421 slices.Authoring context
markdown-streaming-reparsesuite (submodule graph).