Two minor defects in the streaming renderer's text-only fast path (static/js/streamingRenderer.js, perf/rendertail-text-only-path):
1. ~~strikethrough~~ renders as literal text mid-stream
The fast-path guard that decides a suffix is "plain text, append without re-parsing" is !/[*_\#[]<>\n\{]/.test(suffix). It omits ~, but markdown.jsrenders...as (s.replace(/([^~]+)/g, '$1')). So while a strikethrough span streams within a paragraph (no newline), the suffix has no guarded char and is appended as a raw Text node — the user sees literal word` in the live tail until the block finalizes/freezes and re-renders. Transient, but a visible regression vs re-rendering every token.
Fix: add ~ to the guard char class → !/[*_\#~[]<>\n\{]/.test(suffix)`.
2. Debug console.log ships and fires on every finalized streamed message
finalize() logs [streamRenderer] renderTail calls=… fast=… (…%) behind _rtCalls/_rtFast counters. An inline comment claimed finalize() isn't called in production, but it is (chat.js:2586,3173,3195,5492), so this logs to the console on every finished streaming reply. The counters exist only to feed this log.
Fix: remove the dev instrumentation entirely — the counter declaration, the three increments, and the log block.
Classification
Both live on perf/rendertail-text-only-path (upstream-candidate, clean off upstream-mirror). Fix on that branch, cherry-pick to develop.
Two minor defects in the streaming renderer's text-only fast path (
static/js/streamingRenderer.js,perf/rendertail-text-only-path):1.
~~strikethrough~~renders as literal text mid-streamThe fast-path guard that decides a suffix is "plain text, append without re-parsing" is
!/[*_\#[]<>\n\{]/.test(suffix). It omits~, butmarkdown.jsrenders...as(s.replace(/([^~]+)/g, '$1')). So while a strikethrough span streams within a paragraph (no newline), the suffix has no guarded char and is appended as a raw Text node — the user sees literalword` in the live tail until the block finalizes/freezes and re-renders. Transient, but a visible regression vs re-rendering every token.Fix: add
~to the guard char class →!/[*_\#~[]<>\n\{]/.test(suffix)`.2. Debug
console.logships and fires on every finalized streamed messagefinalize()logs[streamRenderer] renderTail calls=… fast=… (…%)behind_rtCalls/_rtFastcounters. An inline comment claimedfinalize()isn't called in production, but it is (chat.js:2586,3173,3195,5492), so this logs to the console on every finished streaming reply. The counters exist only to feed this log.Fix: remove the dev instrumentation entirely — the counter declaration, the three increments, and the log block.
Classification
Both live on
perf/rendertail-text-only-path(upstream-candidate, clean off upstream-mirror). Fix on that branch, cherry-pick to develop.