codex - 💡(How to fix) Fix Codex Desktop on Windows periodically spawns visible PowerShell/conhost probe that steals focus

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…

Root Cause

This does not appear to be caused by user tmux hooks, cron jobs, or devkit shell launchers. In the observed process tree, the repeating powershell.exe probe is a direct child of Codex.exe.

Code Example

powershell.exe -NoProfile -NonInteractive -Command "$ErrorActionPreference = 'Stop'; $cpuByPid = @{}; Get-CimInstance Win32_PerfFormattedData_PerfProc_Process | ForEach-Object { $cpuByPid[[int]$_.IDProcess] = [double]$_.PercentProcessorTime }; Get-CimInstance Win32_Process | Select-Object ProcessId,ParentProcessId,CommandLine,WorkingSetSize,@{Name='CpuPercent';Expression={$cpuByPid[[int]$_.ProcessId]}},@{Name='AgeSeconds';Expression={[int]((Get-Date) - $_.CreationDate).TotalSeconds}} | ConvertTo-Json -Depth 2"
RAW_BUFFERClick to expand / collapse

What version of the Codex App are you using?

Codex Desktop for Windows, installed package observed as OpenAI.Codex_26.519.2081.0_x64__2p2nqsd0c76g0 with Electron crashpad annotation version 26.519.21041.

What operating system are you using?

Windows with Codex configured to run in WSL (runCodexInWindowsSubsystemForLinux = true).

What steps can reproduce the bug?

  1. Start Codex Desktop on Windows.
  2. Work in another desktop application or another terminal tab/window.
  3. Leave Codex Desktop running for a short while.
  4. Observe intermittent flashes of a terminal/console window or tab opening and immediately closing.

I confirmed this by watching Windows process creation. Codex Desktop periodically launches a short-lived PowerShell process similar to:

powershell.exe -NoProfile -NonInteractive -Command "$ErrorActionPreference = 'Stop'; $cpuByPid = @{}; Get-CimInstance Win32_PerfFormattedData_PerfProc_Process | ForEach-Object { $cpuByPid[[int]$_.IDProcess] = [double]$_.PercentProcessorTime }; Get-CimInstance Win32_Process | Select-Object ProcessId,ParentProcessId,CommandLine,WorkingSetSize,@{Name='CpuPercent';Expression={$cpuByPid[[int]$_.ProcessId]}},@{Name='AgeSeconds';Expression={[int]((Get-Date) - $_.CreationDate).TotalSeconds}} | ConvertTo-Json -Depth 2"

The parent process is Codex.exe. Each probe also creates a transient conhost.exe, which appears to be the visible flash/focus-stealing window.

What is the expected behavior?

Background process/resource probes should run without surfacing a console window and without stealing focus from other applications or terminal tabs. On Windows this likely means launching the child process hidden / with no console window, or using a non-console process collection path.

What happens instead?

A console window flashes briefly and steals focus. This interrupts typing in other desktop applications and other terminal tabs, making the Desktop app difficult to leave running while working.

Additional context

This does not appear to be caused by user tmux hooks, cron jobs, or devkit shell launchers. In the observed process tree, the repeating powershell.exe probe is a direct child of Codex.exe.

A CLI-only Codex session does not appear to trigger the same visible Windows console flash in my testing, so this seems specific to Codex Desktop on Windows.

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

codex - 💡(How to fix) Fix Codex Desktop on Windows periodically spawns visible PowerShell/conhost probe that steals focus