TUI assistant Markdown table can disappear after final render
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?
- Run the Codex TUI with
terminal_resize_reflowdisabled in memory, or keep an existing TUI process running after changing the config on disk. - Ask for a response containing a Markdown table followed by normal text, for example:
| Name | Notes |
| --- | --- |
| alpha | visible while streaming |
post-table marker
- Observe the response while it streams.
- 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_separatormarks any live tail asConsolidationScrollbackReflow::Requiredand defers the final cell.App::finish_required_stream_reflowclears pending reflow and returns immediately whenterminal_resize_reflowis 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.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗