codex icon indicating copy to clipboard operation
codex copied to clipboard

Windows: terminal windows repeatedly flash during requests after installing the Codex daemon

Open pvlbgtrv opened this issue 2 months ago • 155 comments

What version of Codex CLI is running?

codex-cli 0.157.0

What subscription do you have?

pro

Which model were you using?

astra

What platform is your computer?

win 11

What terminal emulator and version are you using (if applicable)?

win terminal cmd

Codex doctor report


What issue are you seeing?

Description:

After installing the Codex daemon, several terminal windows briefly open and close during every request. This happens repeatedly and is distracting.

Environment:

OS: Windows Codex daemon version: 0.157.0 Client: Codex CLI Windows sandbox setting: elevated

Steps to reproduce:

Install and start the Codex daemon. Start an interactive Codex CLI session using the daemon. Submit a request. Observe several terminal windows briefly appearing and disappearing.

Expected behavior:

Background processes should run without opening visible terminal windows.

Actual behavior:

Several terminal windows flash on screen during each request. I started noticing this after installing the daemon.

Additional context:

The daemon is running with app-server --listen unix:// --managed-daemon. A child codex-code-mode-host.exe process is also running, but I have not identified which process creates the flashing windows.

Running with codex --no-daemon has been suggested as a diagnostic step, but I have not tested it yet.

What steps can reproduce the bug?

Install and start the Codex daemon on Windows (version 0.157.0). Open Codex CLI and start a session using the daemon. Submit a request that involves running shell commands or reading local files. Observe several terminal windows briefly opening and closing while Codex processes the request. Submit another request and observe the same behavior.

What is the expected behavior?

Codex should process requests and run background commands without opening visible terminal windows or interrupting the current terminal session.

Additional information

No response

pvlbgtrv avatar Sep 25 '26 11:09 pvlbgtrv

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

  • #48059
  • #48036
  • #48070
  • #48029
  • #46949

Powered by Codex Action

github-actions[bot] avatar Sep 25 '26 11:09 github-actions[bot]

I agree with this too; it keeps flashing terminal windows over and over after the new update.

AbdulSamad94 avatar Sep 25 '26 11:09 AbdulSamad94

same problem with me. keep opening new tab. just after recent update.

gitoften avatar Sep 25 '26 12:09 gitoften

Spams terminals with C:\Users\Admin\.local\bin\uv.exe in my case...

KubaZachacz avatar Sep 25 '26 12:09 KubaZachacz

Same issue with thread ID 01a0d8c1-491a-7380-9a03-d01e62f26b48

onlymattjohnson avatar Sep 25 '26 13:09 onlymattjohnson

Using Windows Terminal and trying to run codex gives me these errors:

Error: host Job Object prevents daemon detachment; start from a host that allows breakaway To work without the background server, rerun the same command with --no-daemon (including resume or fork and its arguments).

hi-fox avatar Sep 25 '26 13:09 hi-fox

same problem with me

xeqtr1982 avatar Sep 25 '26 14:09 xeqtr1982

Downgrading Codex to version 0.155.1 fixed the issue for me. You can try it with:

npm install -g @openai/[email protected]

AbdulSamad94 avatar Sep 25 '26 15:09 AbdulSamad94

For the same issue, a temporary workaround is codex --no-daemon.

yecate avatar Sep 25 '26 15:09 yecate

For the same issue, a temporary workaround is codex --no-daemon.

so i can use the latest version, with no terminal issues with this command?

AbdulSamad94 avatar Sep 25 '26 15:09 AbdulSamad94

Possible cause: Codex 0.157.0 enabled automatic app-server daemon startup by default (https://github.com/openai/codex/releases/tag/rust-v0.157.0). My doctor report confirmed the background server was running. The daemon may be launching console-based helper processes without suppressing their Windows terminal windows .

They must compare daemon startup and helper process creation in 0.156.0 and 0.157.0.

I initially thought my PC was causing this. I rolled back to 0.156.0 without changing my terminal setup. The extra windows and flashing stopped, and Codex now works normally.

darsh-jaiswal avatar Sep 25 '26 20:09 darsh-jaiswal

We understand the problem and have a fix in place. It will be included in the next release.

etraut-openai avatar Sep 25 '26 21:09 etraut-openai

Additional reproduction and process evidence on Codex CLI/app-server 0.157.0:

  • Windows 11 x64 (OS build 26100), PowerShell 7.6.6, Windows Terminal 1.24.11911.0.
  • npm-installed CLI connected to codex.exe app-server --listen unix:// --managed-daemon.
  • Visible terminal windows occur during individual command-tool calls, not only at startup. Reproduced in full-access mode as well.

Minimal command-tool example:

{
  "cmd": "Write-Output 'probe'",
  "shell": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
  "login": false,
  "tty": false
}

Observed process ancestry (private paths removed):

codex.exe resume
  -> codex.exe app-server --listen unix:// --managed-daemon
    -> C:\Program Files\PowerShell\7\pwsh.exe -NoProfile -Command ...

An EnumWindows observer polling for newly visible handles captured new CASCADIA_HOSTING_WINDOW_CLASS (Windows Terminal) and PseudoConsoleWindow/OpenConsole windows at the command-call timestamps. This still happened with login: false and allow_login_shell = false, so skipping the PowerShell profile did not resolve it.

A bounded comparison using tty: true (including a stdin handshake, a PowerShell built-in, and an rg invocation) captured zero new visible windows during a 45-second observation. This appears to be a usable per-call workaround for this environment; it is not evidence that every helper/startup path is covered.

One diagnostic detail: passing a custom GUI-subsystem wrapper named pwsh.exe in the tool's shell field did not help. Process ancestry still showed the installed PowerShell executable launched directly by the app-server; the wrapper was not in that ancestry.

Thanks for the planned next-release fix. Sharing these observations in case they help validate the non-PTY command-spawn path. No private project names, credentials, or session contents are included.

Azulsky avatar Sep 26 '26 01:09 Azulsky

Another confirmed Windows 11 reproduction on Codex CLI 0.157.0, with a window-to-process match:

  • Windows 11 Pro, build 26200; Windows Terminal 1.24.11911.0; Windows PowerShell 5.1. Codex Desktop 26.917.9434.0 is also installed, but the affected process tree belongs to the CLI session.
  • The global CLI changed from 0.155.1 to 0.157.0 at 8:44 PM local time on September 25. Immediately after codex resume, the 0.157.0 managed daemon and its helper processes started. Windows Terminal settings had not changed since August.
  • A live shell command followed codex.exe resume -> codex.exe app-server --listen unix:// --managed-daemon -> powershell.exe -Command ... -> conhost.exe.
  • node_repl.exe, node.exe, and codex-code-mode-host.exe also started as daemon children or descendants. A Win32 EnumWindows snapshot showed separate visible top-level windows owned by WindowsTerminal.exe, titled with those helper executable paths and the PowerShell executable path.
  • The user reports that comparable Codex work stayed in the background before this update. The new windows can persist as well as flash.

I have not tested --no-daemon on this machine because the CLI sessions are performing active work. No private project paths or raw logs are included here.

spfim avatar Sep 26 '26 01:09 spfim

looks very annoying! it didn't fix yet in new cli update v0.157.1

nikunjkareliya avatar Sep 26 '26 06:09 nikunjkareliya

Additional report on Windows with Codex CLI and the managed daemon both at 0.157.1, using the elevated Windows sandbox.

Opening Codex causes many visible command/terminal windows to appear, which makes normal use very disruptive. One of the windows displays:

[error 2147942632 (0x800700e8) when launching `"git" -c safe.bareRepository=explicit -c core.hooksPath=NUL -c core.fsmonitor=false remote -v`]

The same Git command succeeds when explicitly launched with a hidden console, so this does not appear to be a basic Git installation failure.

I tried the suggested codex --no-daemon resume --last workaround, but resuming this conversation was blocked by a message saying it belongs to another app and should be continued there. I therefore could not verify whether bypassing the daemon fixes the flashing for this existing conversation.

Please prioritize a fix for the visible background windows, and provide a working way to resume an existing conversation without the daemon while this is being resolved.

livingfailure93 avatar Sep 26 '26 07:09 livingfailure93

I tried the suggested codex --no-daemon resume --last workaround, but resuming this conversation was blocked by a message saying it belongs to another app and should be continued there. I therefore could not verify whether bypassing the daemon fixes the flashing for this existing conversation.

You can use the suggested shortcut to fork it.

somedeveloper00 avatar Sep 26 '26 07:09 somedeveloper00

Has it been fixed? I'm on the latest update and the terminals still flash. (super annoying)

manishpaulsimon avatar Sep 26 '26 09:09 manishpaulsimon

Same issue on Windows with Codex CLI 0.157.1: a terminal window briefly opens for every command, even ! pwd or similar self run commands.

Starting with codex --no-daemon resolves it consistently for me.

noel-danielsson avatar Sep 26 '26 10:09 noel-danielsson

Happens with me too

MohamedMedhat1998 avatar Sep 26 '26 15:09 MohamedMedhat1998