Input message disappears while Codex CLI is responding

Open 💬 19 comments Opened Oct 22, 2025 by BobbyWang0120
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.47.0

What subscription do you have?

Pro plan

Which model were you using?

gpt-5-high

What platform is your computer?

macOS

What issue are you seeing?

When using the Codex CLI, parts of my input message sometimes disappear while the model is generating its response. Lines or segments vanish randomly during processing. In some cases, parts of Codex's output also disappear unexpectedly while it continues to print output. This seems to occur about 20-30% of the time, and I haven't found reliable steps to reproduce it.

What steps can reproduce the bug?

When using the Codex CLI, after I input a message, parts of my input sometimes disappear while Codex is outputting its response. Lines vanish one by one or segments of the input vanish randomly. Additionally, parts of the output generated by Codex may disappear unexpectedly while the rest of the output is still printing. This occurs randomly about 20-30% of the time and I haven't been able to find consistent steps to reproduce it.

What is the expected behavior?

The CLI should keep my input and Codex's output visible while it is processing and generating responses. Neither the input message nor any part of the generated output should disappear; they should persist unchanged until the operation is complete.

Additional information

_No response_

View original on GitHub ↗

19 Comments

github-actions[bot] contributor · 9 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #4790
  • #4724
  • #3905

Powered by Codex Action

tshmit · 9 months ago

I also have found parts of both input and output messages disappearing, seemingly at random. This issue has persisted though all recent versions up to and including the current version (0.47.0). I find no discernible pattern but it is common and the inability to reliably refer back in the conversation significantly impairs usability/utility.
(I do run multiple CLI sessions concurrently but find the bug appears even when interacting only with a single session)

ts-klassen · 8 months ago

I see output of AI disappearing too and I think it's related.

#6599

jeck00119 · 8 months ago

It wasn’t fixed, I still have this problem. My version is 0.61.0

distbit0 · 5 months ago

same issue

gerrywastaken · 5 months ago

Examples. I have no idea why this isn't more widely reported as it makes Codex CLI unusable and makes the model output seem incoherent due to whole lines vanishing mid paragraph.

<img width="1916" height="989" alt="Image" src="https://github.com/user-attachments/assets/88034b26-8334-45a4-a1e8-8d1a62545b90" />

Jayashanker-Padishala · 5 months ago

I can reproduce this deterministically on my setup (not flaky).

Environment:

  • OS: Microsoft Windows NT 10.0.26220.0 x64
  • Codex CLI: 0.98.0
  • Terminal: Windows Terminal + PowerShell

Repro steps:

  1. Start Codex and trigger a response that streams for several seconds.
  2. While the assistant output is actively streaming, scroll up in the terminal.
  3. Observe that visible text disappears during/after scrolling.

Observed behavior:

  • The rendered text disappears consistently when scrolling during active streaming.

Expected behavior:

  • Scrolling should not clear/disappear already rendered content while streaming.

Additional notes:

  • This happens every time for me.
  • Content doesn't reappear on new tokens, resize, or after response completes

If this aligns with your preferred approach, I can prepare a PR with a fix. Per docs/contributing.md (invitation-
only for external code PRs), please let me know if you’d like to invite this contribution.

etraut-openai contributor · 5 months ago

We'd welcome a root cause analysis and proposed fix here in the issue tracker thread. That's more useful to us than a code contribution.

Jayashanker-Padishala · 5 months ago

Thanks, understood. Here is my analysis from reading the TUI draw path and matching it to repro behavior.

Likely Root Cause

I can reproduce this consistently on Windows while output is streaming and the terminal is scrolled up.

The most suspicious code path is in Tui::draw (codex-rs/tui/src/tui.rs):

  • When area != terminal.viewport_area, the code calls terminal.clear() in that branch.
  • In inline mode during active streaming, viewport geometry can change frame-to-frame (especially height/y as content grows).
  • If the user is scrolled in terminal history while this happens, clearing that region can wipe currently visible lines, which matches the “text disappears while scrolling during streaming” symptom.

So a plausible root cause is a clear-on-viewport-change policy that is too aggressive during streaming updates.

Proposed Fix

Only clear on viewport changes that need full invalidation (e.g. shrink/downward move), and avoid clearing when the viewport is only growing upward while streaming.

Pseudo-logic at the viewport-change branch:

  • capture previous_area
  • apply set_viewport_area(area)
  • compute viewport_shrank = area.width < previous.width || area.height < previous.height || area.y > previous.y
  • call terminal.clear() only when viewport_shrank is true

This should preserve redraw correctness for shrink/reset cases while preventing wipe behavior in the common streaming-growth case.

Validation Plan

  • Repro case: stream response + scroll up during streaming on Windows.
  • Confirm text no longer disappears.
  • Check regressions:
  • terminal resize
  • switching overlays/alt screen
  • normal non-streaming redraw paths
rbracco · 5 months ago

Also experiencing this on Windows. I'm using the terminal in Cursor while SSH'd into another machine in case that ends up being relevant.

Current workaround is tedious but works. When codex responds and I need to read all text, during planning/discussion, I close it and resume. Autorenaming sessions or setting up shortcuts helps make it less tedious.

Sasoon · 5 months ago

Still an issue for me as well, windows terminal on WSL

Cleroth · 4 months ago

Still an issue.

SreedharAvvari · 4 months ago

still happens 😕

Cornelivl · 3 months ago

Jeah still an issue, especially in plan mode.

stevemarksd · 3 months ago

I think I found a specific root cause for at least one class of the “text disappears in the TUI” bugs.

Repro:

  1. Open the Codex TUI with enough transcript visible that the composer is docked at the bottom.
  2. Type into the composer until it grows from 1 line to multiple lines.
  3. Watch the visible transcript area above it.

Expected:
When the composer grows, it should consume space from the bottom of the visible transcript only.

Actual:
Visible transcript rows at the top get scrolled away / dropped.

Dummy snapshot of the behavior:

Before:

previous assistant line 1
previous assistant line 2
previous assistant line 3

› hello

After growing the composer:

previous assistant line 2
previous assistant line 3

› hello
world
again

The problem is that previous assistant line 1 disappeared just because the composer became multiline.

Likely root cause:
In codex-rs/tui/src/tui.rs, the inline viewport resize path scrolls the already-rendered transcript when the composer expands:

scroll_region_up(0..area.top(), area.bottom() - size.height)?;

That appears to be the destructive part. Re-anchoring the viewport with:

area.y = size.height - area.height;

seems sufficient, without scrolling the transcript region upward.

This appears to come from upstream commit 0d12380c3b4814bd624d1c4f45534bb304e8383f (refactor onboarding screen to a separate
"app" (#2524)
).

Suggested fix:
When area.bottom() > size.height, do not scroll the transcript region upward. Just re-anchor the viewport to the bottom.

I also reproduced this with a focused snapshot test around multiline composer growth.

inaki-sax · 3 months ago

Happens to me in WSL ubuntu + win11

runfence · 2 months ago

Same issue on windows, but I noticed it for response lines. Some if them randomly disappear but when I exit and resume, they appear again.

hwasiti · 23 days ago

One way to show up the hidden lines is to move the terminal to a portrait monitor and let the window iof the terminal much longer than before. It is insane that this is not a popular bug report. Sometimes the disappeared lines are quite important.

Cleroth · 22 days ago

Having this bug for almost an entire year is insane