perf(web): reuse completed Markdown prefixes while streaming - #11193
Conversation
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR introduces stateful AST caching, parser wrapping, position shifting, and automatic fallback decisions in the production streaming Markdown path. Focused parity tests reduce risk, but the new parsing strategy and automatic processing gate are substantial runtime changes. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
a862924 to
a660ad9
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe web app adds an incremental Markdown parser for eligible streaming messages. It caches completed fenced-code prefixes, integrates the parser into ChangesIncremental Markdown streaming
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Refactor Sequence Diagram(s)sequenceDiagram
participant ChatMarkdown
participant IncrementalMarkdownPlugin
participant MarkdownParser
ChatMarkdown->>IncrementalMarkdownPlugin: enable for eligible streaming text
IncrementalMarkdownPlugin->>MarkdownParser: parse current Markdown document
MarkdownParser-->>ChatMarkdown: return Markdown AST for rendering
Suggested reviewers: Merge Risk: ⚪ Minimal · up to No merge-blocking risk was identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 3 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
## What's Changed * fix(pr): update labels and reviewers without redundant reloads by @maria-rcks in pingdotgg/t3code#11117 * fix(chat): fold question answers into tool activity by @maria-rcks in pingdotgg/t3code#11014 * fix(usage): flag unpriced model activity instead of showing $0.00 by @maria-rcks in pingdotgg/t3code#11021 * fix(server): let Claude launch args override the derived permission mode by @maria-rcks in pingdotgg/t3code#11026 * fix(editors): accept root paths and Windows servers in Zed remote links by @maria-rcks in pingdotgg/t3code#11044 * fix(web): center pull request unavailable states by @maria-rcks in pingdotgg/t3code#11110 * fix(web): remove sidebar pull request link icon by @maria-rcks in pingdotgg/t3code#11179 * fix(ui): color linked pr counts by aggregate status by @maria-rcks in pingdotgg/t3code#11180 * fix(preview): render website favicons for browser tool activity by @maria-rcks in pingdotgg/t3code#11032 * fix(web): simplify pull request summary sections by @maria-rcks in pingdotgg/t3code#10612 * fix(web): preserve drafts when compacting context by @maria-rcks in pingdotgg/t3code#11103 * fix(server): queue messages during context compaction by @maria-rcks in pingdotgg/t3code#11107 * perf(web): format minimap previews only when opened by @juliusmarminge in pingdotgg/t3code#11181 * perf(web): reuse completed Markdown prefixes while streaming by @juliusmarminge in pingdotgg/t3code#11193 * perf(web): resume syntax highlighting from completed lines by @juliusmarminge in pingdotgg/t3code#11196 * perf(web): preserve completed code-line DOM while streaming by @juliusmarminge in pingdotgg/t3code#11198 * perf(web): huge-thread switch no longer blanks the chat pane by @juliusmarminge in pingdotgg/t3code#11169 **Full Changelog**: pingdotgg/t3code@v0.0.41-nightly.20260911.1520...v0.0.41-nightly.20260911.1533 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.41-nightly.20260911.1533
Streaming a response reparses completed code fences on every chunk. Preserve the parsed prefix through a closed top-level fence and reparse the changing suffix, following the completed-block reuse in Legend Markdown.
The existing whole-document transforms, sanitization, source positions and rendering remain in use. Reference definitions, footnotes, CR/CRLF and BOM input fall back to a full parse. Plain prose, completed messages and custom syntax plugins use the existing path. The cache belongs to one streaming renderer.
Five alternating production-browser runs at 1440 × 1000, each with 20 warm-up updates and 120 measured updates:
The fixture contains 12 completed TypeScript fences of 30 lines plus growing prose. Every paired run improved; the median reduction is 19.1%. Both builds use the same browser process, origin, fixture and probe. These are synchronous client-update measurements, not provider throughput or user telemetry. Raw samples · Probe, comparison script and parity evidence.
82 focused tests and web typecheck pass. The external CommonMark corpus adds 17,426 full-tree comparisons, including source positions, across its 652 examples. Browser verification retained selected text, DOM identity and exactly the same scroll position through 40 updates. Targeted lint reports two warnings in unchanged code.
This affects streaming Markdown in web and Electron's shared web renderer. Mobile and file/diff viewers are unchanged. Local and remote clients use the same rendering path; no transport, provider or contract changes.
Before, desktop:
After, desktop:
Before navigation and streaming, narrow viewport:
https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/cf9292628b42deda/parser-before-demo.webm
After navigation and streaming, narrow viewport:
https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/45f147cf61401e0c/parser-after-demo.webm
Recordings show visual states, not wall-clock speed: the recorder compresses dropped-frame intervals. The table uses separate, unrecorded timing runs; 0.8 seconds of recorder startup was trimmed. Only synthetic fixture data is included. Probes and evidence are not committed.
Integration follow-up: rebased on current main; the integrated stack passes 94 focused Markdown/highlighting tests and 159 timeline tests, plus web typecheck. The timing table remains pinned to the original measured builds.
Model: GPT-6. Harness: Codex.