Streaming renderer duplicates tail chunk of long assistant reply (3x repeat of mid-sentence fragment + code block)

Resolved 💬 3 comments Opened Apr 30, 2026 by hedaprakash Closed Apr 30, 2026

Environment:

  • Claude Code 2.1.123
  • Host terminal: VS Code integrated terminal, shell PowerShell (Windows PowerShell 5.1 on Windows 11 Pro 10.0.26200)
  • Model: Claude Opus 4.7 (1M context)

What happened:
A long assistant reply containing nested markdown (h2/h3 headings, bold-numbered list items 1–6, and multiple fenced code blocks) was rendered with the tail of the message duplicated three times. The duplication started mid-sentence at a chunk boundary (not at a clean section break), repeated items 2–6 of a numbered list plus the next heading and its code block, and replayed that whole chunk twice more before the message ended.

Symptoms that point to a streaming-renderer issue (not model output):

  • Duplicate begins mid-line ("it right — only matters if you bypass the wrapper"), which is inside list item 2 — a chunk-boundary replay, not a re-emission.
  • The first tail is fragmented: list item 2 is cut off, then a later heading ("Remove an entity") and its code block appear, then the "Reference" heading — i.e., sections got reflowed before the duplicate ran.
  • Asking the assistant to re-check confirmed its generated text had each section exactly once.

Repro context (not minimal — just what was on screen):

  • Reply was ~80 lines of markdown
  • Mixed h2 / h3 / bold-numbered list / fenced bash blocks
  • Triggered after a Skill invocation returned a long context block, followed by an assistant reply that synthesized that content
  • VS Code integrated terminal — this matters because VS Code's terminal handles ANSI cursor/clear rewrites slightly differently from standalone Windows Terminal or ConPTY hosts, and that's a likely interaction point.

Expected: Each section rendered once.
Actual: Tail chunk rendered three times. Screenshot to follow as a comment.

Severity: Cosmetic but confusing — looks like the model output was duplicated, which is incorrect attribution.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗