What version of Codex CLI is running?
codex-cli 0.157.1
What subscription do you have?
Plus
Which model were you using?
No response
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What terminal emulator and version are you using (if applicable)?
Windows Terminal + Powershell
Codex doctor report
What issue are you seeing?
On Windows, a batch of visible console windows flashes for git.exe / pwsh.exe (and other helper) child processes:
- several
git.exe windows on every new session, and again on every turn;
pwsh.exe windows for shell/exec child processes.
What steps can reproduce the bug?
- On Windows, run
codex interactively (e.g. in Windows Terminal) on a project inside a git repository (default config, no --no-daemon).
- Start a new thread and send a turn.
- Observe console windows flashing for
git.exe (session start + every turn) and pwsh.exe (shell/exec helpers).
Workaround that confirms the diagnosis: codex --no-daemon runs the session embedded in the TUI process (console attached), and the flashing stops.
What is the expected behavior?
No visible console windows. Helper subprocesses spawned by the console-less daemon backend should either inherit a hidden console or be created with CREATE_NO_WINDOW.
Additional information
Source analysis at tag rust-v0.157.1:
Why the spawning process has no console:
codex-rs/features/src/lib.rs:941-944 — daemon_auto_start is enabled by default.
codex-rs/tui/src/startup_orchestration.rs:494-544 — TUI auto-starts the shared daemon and targets AppServerTarget::LocalDaemon (session runs in the daemon's app-server backend, not in the TUI).
codex-rs/app-server-daemon/src/backend/pid_start.rs:209 — backend spawn uses DETACHED_PROCESS | CREATE_BREAKAWAY_FROM_JOB → no console. spawn_without_inheriting_stdio (backend/windows.rs:56+) only clears stdio handle inheritance and adds no window suppression.
Unsuppressed child spawns from that console-less backend:
git.exe (dominant source): codex-rs/git-utils/src/git_process.rs:47-63 goes through JobObject::spawn_contained, and codex-rs/utils/pty/src/win/job.rs:125-127 only sets CREATE_SUSPENDED (no CREATE_NO_WINDOW); the fallback path resets creation_flags(0). Volume: new session → codex-rs/rollout/src/recorder.rs:1977-1978 → collect_git_info (git-utils/src/info.rs:66-82) = 4 spawns; every turn → codex-rs/core/src/turn_metadata.rs:547-551 = 3 more (plus a possible fsmonitor probe). Direct Command::new("git") sites in git-utils (apply.rs / baseline.rs / branch.rs / operations.rs) share the gap.
pwsh.exe / shell helpers: codex-rs/exec-server/src/fs_sandbox.rs:516, codex-rs/exec-server/src/shell_snapshot.rs:287, codex-rs/windows-sandbox-rs/src/unified_exec/backends/legacy.rs:118 (ConsoleMode::Inherit, mapped to flags 0 in process.rs:109-113; default WindowsSandboxLevel::Disabled takes this path), codex-rs/hooks/src/engine/command_runner.rs:233-245, codex-rs/hooks/src/legacy_notify.rs:53-66, codex-rs/cli/src/desktop_app/windows.rs:34-56.
- The codebase already sets
CREATE_NO_WINDOW correctly elsewhere (e.g. bin/command_runner/win.rs:351, rmcp-client/src/stdio_server_launcher.rs:297), so this looks like an omission.
- Checked against current
main (e72da2b, 2026-09-26): git_process.rs, job.rs, legacy.rs, pid_start.rs are unchanged vs 0.157.1 — upgrading does not fix this.
Suggested fix:
- Minimal: in
codex-rs/app-server-daemon/src/backend/pid_start.rs:209, replace DETACHED_PROCESS with CREATE_NO_WINDOW (keeps the backend detached from the launching terminal and breakaway-safe, but gives it a hidden console that children inherit — removes the flashing for all daemon-managed backends in one line).
- Robust: also set
CREATE_NO_WINDOW at the individual spawn sites above (git_process / job.rs, unified_exec legacy backend + (None, NoWindow) mapping in process.rs:109-113, exec-server spawns, hooks, desktop_app powershell) so any console-less parent is covered.
This issue is written by codex and review by human.
What version of Codex CLI is running?
codex-cli 0.157.1
What subscription do you have?
Plus
Which model were you using?
No response
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What terminal emulator and version are you using (if applicable)?
Windows Terminal + Powershell
Codex doctor report
What issue are you seeing?
On Windows, a batch of visible console windows flashes for
git.exe/pwsh.exe(and other helper) child processes:git.exewindows on every new session, and again on every turn;pwsh.exewindows for shell/exec child processes.What steps can reproduce the bug?
codexinteractively (e.g. in Windows Terminal) on a project inside a git repository (default config, no--no-daemon).git.exe(session start + every turn) andpwsh.exe(shell/exec helpers).Workaround that confirms the diagnosis:
codex --no-daemonruns the session embedded in the TUI process (console attached), and the flashing stops.What is the expected behavior?
No visible console windows. Helper subprocesses spawned by the console-less daemon backend should either inherit a hidden console or be created with
CREATE_NO_WINDOW.Additional information
Source analysis at tag
rust-v0.157.1:Why the spawning process has no console:
codex-rs/features/src/lib.rs:941-944—daemon_auto_startis enabled by default.codex-rs/tui/src/startup_orchestration.rs:494-544— TUI auto-starts the shared daemon and targetsAppServerTarget::LocalDaemon(session runs in the daemon's app-server backend, not in the TUI).codex-rs/app-server-daemon/src/backend/pid_start.rs:209— backend spawn usesDETACHED_PROCESS | CREATE_BREAKAWAY_FROM_JOB→ no console.spawn_without_inheriting_stdio(backend/windows.rs:56+) only clears stdio handle inheritance and adds no window suppression.Unsuppressed child spawns from that console-less backend:
git.exe(dominant source):codex-rs/git-utils/src/git_process.rs:47-63goes throughJobObject::spawn_contained, andcodex-rs/utils/pty/src/win/job.rs:125-127only setsCREATE_SUSPENDED(noCREATE_NO_WINDOW); the fallback path resetscreation_flags(0). Volume: new session →codex-rs/rollout/src/recorder.rs:1977-1978→collect_git_info(git-utils/src/info.rs:66-82) = 4 spawns; every turn →codex-rs/core/src/turn_metadata.rs:547-551= 3 more (plus a possible fsmonitor probe). DirectCommand::new("git")sites ingit-utils(apply.rs / baseline.rs / branch.rs / operations.rs) share the gap.pwsh.exe/ shell helpers:codex-rs/exec-server/src/fs_sandbox.rs:516,codex-rs/exec-server/src/shell_snapshot.rs:287,codex-rs/windows-sandbox-rs/src/unified_exec/backends/legacy.rs:118(ConsoleMode::Inherit, mapped to flags 0 inprocess.rs:109-113; defaultWindowsSandboxLevel::Disabledtakes this path),codex-rs/hooks/src/engine/command_runner.rs:233-245,codex-rs/hooks/src/legacy_notify.rs:53-66,codex-rs/cli/src/desktop_app/windows.rs:34-56.CREATE_NO_WINDOWcorrectly elsewhere (e.g.bin/command_runner/win.rs:351,rmcp-client/src/stdio_server_launcher.rs:297), so this looks like an omission.main(e72da2b, 2026-09-26):git_process.rs,job.rs,legacy.rs,pid_start.rsare unchanged vs 0.157.1 — upgrading does not fix this.Suggested fix:
codex-rs/app-server-daemon/src/backend/pid_start.rs:209, replaceDETACHED_PROCESSwithCREATE_NO_WINDOW(keeps the backend detached from the launching terminal and breakaway-safe, but gives it a hidden console that children inherit — removes the flashing for all daemon-managed backends in one line).CREATE_NO_WINDOWat the individual spawn sites above (git_process / job.rs, unified_exec legacy backend +(None, NoWindow)mapping inprocess.rs:109-113, exec-server spawns, hooks, desktop_app powershell) so any console-less parent is covered.This issue is written by codex and review by human.