TUI assistant Markdown table can disappear after final render

Resolved 💬 2 comments Opened Jun 12, 2026 by t-shao Closed Jun 12, 2026

What issue are you seeing?

In the Codex TUI, an assistant response that contains a Markdown table can be visible while streaming, but disappear after the response is finalized and the final rendered history cell replaces the streaming tail. Content after the table can disappear along with the table.

The issue appears when a live table tail is finalized while terminal_resize_reflow is disabled or stale in the running TUI process. Streaming output reaches the UI, but finalization defers the final stream cell into a required scrollback reflow path that is skipped when the feature is off.

What steps can reproduce the bug?

  1. Run the Codex TUI with terminal_resize_reflow disabled in memory, or keep an existing TUI process running after changing the config on disk.
  2. Ask for a response containing a Markdown table followed by normal text, for example:
| Name | Notes |
| --- | --- |
| alpha | visible while streaming |

post-table marker
  1. Observe the response while it streams.
  2. Wait for final render/consolidation.

What is the expected behavior?

The final assistant message should remain visible in scrollback. Feature flags for terminal resize reflow may affect whether scrollback is rebuilt, but they should not decide whether the finalized assistant content is written at all.

Additional information

Initial code investigation points at the assistant stream finalization path:

  • ChatWidget::flush_answer_stream_with_separator marks any live tail as ConsolidationScrollbackReflow::Required and defers the final cell.
  • App::finish_required_stream_reflow clears pending reflow and returns immediately when terminal_resize_reflow is disabled.
  • Because the final cell was deferred instead of emitted through InsertHistoryCell, the required-reflow-off path can leave the final visible content out of terminal scrollback.

A minimal fix is to require/defer only when terminal_resize_reflow is actually enabled; otherwise finalization should emit the final stream cell through the normal history insertion path.

View original on GitHub ↗

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