You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Input message disappears while Codex CLI is responding #5538
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
Reacted by distbit, Gerry, chrisFxxk, mert-kurttutan, Matt Derman, Sreedhar Avvari, runfence, Ivo Filot, Haider Alwasiti, Ali Issa and 2 more
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)
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.
Reacted by distbit, Junzhi Ning, 0xPhaze, mert-kurttutan and Cleroth
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:
Start Codex and trigger a response that streams for several seconds.
While the assistant output is actively streaming, scroll up in the terminal.
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.
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.
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.
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.
Because the remote PTY terminal host exposes a generic xterm environment without TERM_PROGRAM, the Standard strategy is selected. When the composer/status area changes height during the following interaction, scrolling the partial region can discard visible transcript rows. Replaying the raw PTY control stream then reproduces that damaged visual state.
PR #30478 appears to address this directly by removing the destructive scroll_region_up operation during viewport growth, but it was closed without merging. The earlier resize-reflow fix in #18575 is present in 0.150.1, so it does not appear to cover this remaining viewport-growth path.
User impact: while recording evaluation/oracle workflows, people depend on prior instructions remaining visible. When those instructions disappear, they often ask the model to regenerate them, wasting tokens and time.
A useful fix may be to revive/rebase #30478 or otherwise ensure viewport growth only re-anchors the viewport without mutating already-rendered transcript rows. I can provide a sanitized PTY trace or help test a candidate patch if useful.
Closing this older default-mode report as likely addressed in CLI v0.162.1. #45271 fixes history loss when the input area grows, and the new fullscreen TUI retains transcript entries across typing and redraws (#46721, #46733). If this still occurs, please reopen with the current CLI version and /tui mode. Inline scrollback problems remain tracked in #27644.
Activity
github-actions commentedon Oct 22, 2025
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
tshmit commentedon Oct 23, 2025
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 commentedon Nov 13, 2025
I see output of AI disappearing too and I think it's related.
#6599
jeck00119 commentedon Nov 21, 2025
It wasn’t fixed, I still have this problem. My version is 0.61.0
distbit0 commentedon Feb 1, 2026
same issue
gerrywastaken commentedon Feb 7, 2026
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.
Jayashanker-Padishala commentedon Feb 10, 2026
I can reproduce this deterministically on my setup (not flaky).
Environment:
Repro steps:
Observed behavior:
Expected behavior:
Additional notes:
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 commentedon Feb 10, 2026
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 commentedon Feb 10, 2026
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):area != terminal.viewport_area, the code callsterminal.clear()in that branch.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:
previous_areaset_viewport_area(area)viewport_shrank = area.width < previous.width || area.height < previous.height || area.y > previous.yterminal.clear()only whenviewport_shrankis trueThis should preserve redraw correctness for shrink/reset cases while preventing wipe behavior in the common streaming-growth case.
Validation Plan
rbracco commentedon Feb 10, 2026
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 commentedon Feb 11, 2026
Still an issue for me as well, windows terminal on WSL
Cleroth commentedon Mar 9, 2026
Still an issue.
SreedharAvvari commentedon Mar 13, 2026
still happens 😕
5 remaining items
fix(tui): reflow scrollback on terminal resize (#18575)
Update codex fork to upstream 0.128.0 (#14)
runfence commentedon May 5, 2026
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.
fix(tui): reflow scrollback on terminal resize (openai#18575)
fix(tui): reflow scrollback on terminal resize (openai#18575)
fix(tui): reflow scrollback on terminal resize (openai#18575)
hwasiti commentedon Jun 27, 2026
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 commentedon Jun 28, 2026
Having this bug for almost an entire year is insane
NoCilantroPlzz commentedon Aug 31, 2026
I can reproduce a related failure in Codex CLI 0.150.1 running inside a remote PTY terminal host with
TERM=xterm-256color.The symptom is that portions of a completed assistant response disappear after the next interaction, making the response appear truncated.
Evidence from one affected session:
final_answerrecords in the durable rollout.task_complete.last_agent_message.stream_errororturn_abortedevents.gap: false; approximately 4.3 MiB used).This suggests the model response and transport are complete; the loss occurs while rendering or reconstructing terminal history.
The likely path is viewport growth in
tui/src/tui.rs, followed byScrollbackStrategy::Standardcalling:Because the remote PTY terminal host exposes a generic xterm environment without
TERM_PROGRAM, the Standard strategy is selected. When the composer/status area changes height during the following interaction, scrolling the partial region can discard visible transcript rows. Replaying the raw PTY control stream then reproduces that damaged visual state.PR #30478 appears to address this directly by removing the destructive
scroll_region_upoperation during viewport growth, but it was closed without merging. The earlier resize-reflow fix in #18575 is present in 0.150.1, so it does not appear to cover this remaining viewport-growth path.User impact: while recording evaluation/oracle workflows, people depend on prior instructions remaining visible. When those instructions disappear, they often ask the model to regenerate them, wasting tokens and time.
A useful fix may be to revive/rebase #30478 or otherwise ensure viewport growth only re-anchors the viewport without mutating already-rendered transcript rows. I can provide a sanitized PTY trace or help test a candidate patch if useful.
etraut-openai commentedon Oct 12, 2026
(response from codex)
Closing this older default-mode report as likely addressed in CLI v0.162.1. #45271 fixes history loss when the input area grows, and the new fullscreen TUI retains transcript entries across typing and redraws (#46721, #46733). If this still occurs, please reopen with the current CLI version and
/tuimode. Inline scrollback problems remain tracked in #27644.