codex - 💡(How to fix) Fix TUI: final agent message silently dropped from terminal when `terminal_resize_reflow` feature is enabled

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Code Example

[features]
terminal_resize_reflow = true
RAW_BUFFERClick to expand / collapse

What happened

With the experimental terminal_resize_reflow feature enabled, the final agent message of a turn is never rendered to the terminal. The model's answer is present in the session rollout .jsonl (agent_message payload, complete), but zero lines of it reach the screen or scrollback. The chat just shows the submitted prompt followed by an idle composer.

With the feature disabled, the same prompt renders the full answer into native terminal scrollback as expected.

Reproduction (deterministic A/B)

Environment: codex-cli 0.137.0 (npm install), Debian 13 x86_64, running inside tmux 3.5a (pane 100x24, $TERM inside tmux).

Config (~/.codex/config.toml):

[features]
terminal_resize_reflow = true
  1. tmux new-session -d -s repro -x 100 -y 24 'codex'
  2. Submit: Reply with a numbered list counting from 1 to 120, one number per line. No other text.
  3. Wait for the turn to complete, then: tmux capture-pane -t repro -S - -p | grep -cE "^\s+[0-9]+"

Results:

terminal_resize_reflowanswer in session .jsonllines rendered to terminal
trueyes, all 1200
false (codex -c features.terminal_resize_reflow=false)yes, all 120119/120 in scrollback, scrollable

No terminal resize occurred at any point during the repro.

Suspected area (from reading source, not confirmed)

codex-rs/tui/src/app/resize_reflow.rs — the stream-finalize path: flush_answer_stream_with_separator() routes the finalized cell through ConsolidateAgentMessage with ConsolidationScrollbackReflow::Required when a live tail exists, ending in finish_required_stream_reflow()clear_terminal_for_resize_replay() (which calls clear_scrollback_and_visible_screen_ansi()) → transcript replay. In this environment the replay appears to drop the just-consolidated final cell, so the clear wipes the streamed lines and nothing re-inserts them.

Possibly relevant: terminal detection inside tmux lands on TerminalName::Unknown (fallback reflow row cap), and multiplexer: Tmux.

Expected

The finalized agent message should always end up in terminal scrollback, with or without the reflow feature.

Happy to provide the rollout .jsonl or run instrumented builds if useful.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING