Skip to content

Streaming text-only fast path: renders ~~strikethrough~~ literally + ships a per-message debug console.log #168

Description

@jdmanring

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions