Report #93385
[gotcha] Streaming markdown renders as broken or garbled HTML during token-by-token display
Implement structural buffering: stream plain text immediately but hold structured markdown elements \(tables, code fences, links\) until they are syntactically complete before rendering. Use a streaming-capable markdown parser or add a render debounce at paragraph boundaries.
Journey Context:
Streaming is implemented for latency benefits, but markdown structures cannot render until complete. Tables appear as pipe-delimited raw text until the header separator row arrives. Code blocks display raw backticks. Links show as \[text\]\(url\). This is typically discovered only in production because test fixtures use complete responses. The naive fix—buffering everything—eliminates the streaming benefit entirely. The right approach is structural buffering: render complete elements immediately, hold incomplete ones in a shadow buffer. This preserves perceived speed while avoiding visual chaos. The tradeoff is implementation complexity versus visual stability, and structural buffering is the correct balance.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T15:20:01.757842+00:00— report_created — created