You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Web UI: Duplicate text rendering during streaming due to dual render path race condition in session-turn.tsx #14280
Noticed something weird in the web UI - sometimes when the AI is streaming a response, the text shows up twice. Like, you'll see the full response finish streaming, then bam - duplicate paragraphs appear out of nowhere. Been seeing this more often after tool calls finish.
Setup
opencode serve --print-logs --log-level=INFO
OpenCode v1.2.6
Web interface on Windows 11, Chrome
Happens randomly but seems worse with longer responses
How to reproduce
Just use the web UI normally
Ask something that gets a decent-length reply (I usually ask for code examples)
Watch carefully as it streams in
Sometimes right at the end, you'll see text doubled up
What I think is going on
Been digging through session-turn.tsx and pretty sure I found the culprit. There are two places rendering the same assistant message content:
The streaming view (AssistantMessageItem) - shows chunks as they arrive
The "done" view (that summary section at the bottom) - shows final formatted result
The problem is they can both render at the same time because of how the filtering works. Here's the busted logic:
// This comparison is flaky during state transitionsif(responsePartId&&responsePartId===lastTextPart()?.id){parts=parts.filter((part)=>part?.id!==responsePartId)}
When working flips from true to false, Solid's reactivity doesn't sync these two paths properly. The summary section renders the full text, but the streaming section hasn't filtered out its last chunk yet. Result: double vision.
Also noticed the CLI has a similar mess with lastPartText getting wiped in handleToolPart, causing the same replay bug there.
The description appears to be AI-generated: it contains an unusually detailed root cause analysis, exact code diffs, and proposed fixes that are unlikely to come from a regular user encountering a bug. AI-generated walls of text are not acceptable per our guidelines.
The dedicated template fields (Steps to Reproduce, Operating System, Terminal) were left as "No response" — please fill in your actual environment details.
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
Text Duplication in Chat Response UI #13658: Text Duplication in Chat Response UI (closed) — describes the same dual render path race condition in session-turn.tsx, the same hideResponsePart filtering bug, and proposes the same fix. If the fix from Text Duplication in Chat Response UI #13658 didn't fully resolve the problem, please reference that issue and explain what's still occurring rather than opening a new report.
If you believe this was flagged incorrectly, please let a maintainer know.
Activity
github-actions commentedon Feb 19, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
session-turn.tsx, the samehideResponsePartfiltering bug, and proposes the same fix. If the fix from Text Duplication in Chat Response UI #13658 didn't fully resolve the problem, please reference that issue and explain what's still occurring rather than opening a new report.If you believe this was flagged incorrectly, please let a maintainer know.
github-actions commentedon Feb 19, 2026
Thanks for updating the issue! It now meets our contributing guidelines. We appreciate you taking the time to revise it.
github-actions commentedon Apr 21, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.