fix(tui): last table row missing in markdown rendering #9468

Open
opened 2026-02-16 18:12:31 -05:00 by yindo · 1 comment
Owner

Originally created by @mocksoul on GitHub (Feb 16, 2026).

Originally assigned to: @kommander on GitHub.

Bug

The last row of markdown tables is always missing after message streaming completes.

Reproduction

  1. Enable OPENCODE_EXPERIMENTAL_MARKDOWN=true
  2. Ask the AI to output a markdown table with 3+ data rows
  3. After streaming completes, the last row is not visible

Root cause

Two issues work together:

  1. opencode: TextPart passes streaming={true} unconditionally to <markdown> and <code> elements — even for completed messages
  2. opentui: During streaming, the last table row is skipped (rows.slice(0, -1)) as potentially incomplete. When streaming changes to false, updateBlocks() skips the table because tokenRaw hasn't changed — the missing row is never added back

Fix

Originally created by @mocksoul on GitHub (Feb 16, 2026). Originally assigned to: @kommander on GitHub. ## Bug The last row of markdown tables is always missing after message streaming completes. ## Reproduction 1. Enable `OPENCODE_EXPERIMENTAL_MARKDOWN=true` 2. Ask the AI to output a markdown table with 3+ data rows 3. After streaming completes, the last row is not visible ## Root cause Two issues work together: 1. **opencode**: `TextPart` passes `streaming={true}` unconditionally to `<markdown>` and `<code>` elements — even for completed messages 2. **opentui**: During streaming, the last table row is skipped (`rows.slice(0, -1)`) as potentially incomplete. When `streaming` changes to `false`, `updateBlocks()` skips the table because `tokenRaw` hasn't changed — the missing row is never added back ## Fix - **opencode**: Derive streaming from `message.time.completed` — #13854 - **opentui**: Use `clearCache()` on `streaming: true→false` transition — https://github.com/anomalyco/opentui/pull/696
yindo added the opentui label 2026-02-16 18:12:31 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 16, 2026):

This issue appears to be a duplicate of #13539, which reports the same problem: the last row of markdown tables being cut off when using .

Since #13539 is already assigned to @rekram1-node and this issue provides additional technical analysis with proposed fixes (the referenced PRs), please consolidate any discussion there. Feel free to link to the PRs from this issue if they offer additional context.

@github-actions[bot] commented on GitHub (Feb 16, 2026): This issue appears to be a duplicate of #13539, which reports the same problem: the last row of markdown tables being cut off when using . Since #13539 is already assigned to @rekram1-node and this issue provides additional technical analysis with proposed fixes (the referenced PRs), please consolidate any discussion there. Feel free to link to the PRs from this issue if they offer additional context.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9468