Codex desktop app (Windows) pins CPU via WMI — process-monitoring loop spawns ~10 helper processes/sec during any shell execution
What version of the Codex App are you using (From “About Codex” dialog)?
Codex desktop app 26.715.7063.0 (MSIX, OpenAI.Codex_2p2nqsd0c76g0), Windows 11 Pro 10.0.26200, 16-core machine
What subscription do you have?
MAX
What platform is your computer?
Windows 11
What issue are you seeing?
Summary
The desktop app's exec-monitoring machinery (app-server launched with-c features.code_mode_host=true) drives WMI Provider Host (WmiPrvSE.exe)
to ~50% CPU and total system load to ~99% whenever a conversation executes
shell work. The load is sustained for the entire duration of the executed
command (observed across a multi-minute pytest run), not just at startup.
What the app is doing (observed via process capture and WMI-Activity 5858 events)
In a 25-second window, ChatGPT.exe spawned 235 short-lived child processes:
- Multiple CONCURRENT copies of:
powershell.exe -NoProfile -NonInteractive -Command
"Get-CimInstance Win32_Process | Select-Object ProcessId,ParentProcessId | ConvertTo-Json"
(full process-table enumeration, several per second)
- A per-PID CPU sampler enumerating Win32_PerfFormattedData_PerfProc_Process
(i.e. performance counters for EVERY process on the machine) with a
~60-PID OR-filter Win32_Process query appended
- taskkill.exe /pid <helper> /t /f on each helper afterwards
- Periodic
git status --porcelainpolls on individual watched files
Every one of these WMI enumerations is serviced by WmiPrvSE (CIMWin32 and
WmiPerfInst provider hosts), which is what pins the CPU. The WMI-Activity
operational log shows dozens of distinct short-lived ClientProcessIds each
issuing IWbemServices::CreateInstanceEnum root\cimv2:Win32_Process.
Impact
- WmiPrvSE at 50%+ and total CPU ~99% on a 16-core machine while any
conversation runs shell work (e.g. a test suite).
- Knock-on load from Windows Defender scanning each spawned helper and
WMI servicing the query volume.
- Killing ChatGPT.exe immediately returns the machine to <10% CPU.
What steps can reproduce the bug?
Repro
- Open the desktop app on Windows.
- Ask a conversation to run any long shell command (e.g.
pytest -qon a
medium test suite).
- Watch Task Manager: WmiPrvSE climbs to ~50%, total CPU to ~90%+, and
powershell.exe/taskkill.exe churn continuously with ChatGPT.exe as parent.
What is the expected behavior?
_No response_
Additional information
Notes
- Headless
codex exec(CLI) does NOT exhibit this — the monitoring loop
appears to live in the desktop app layer only.
- Separate but related: the workspace scanner also spawns one
git hash-object
per untracked-not-ignored file plus a taskkill per helper on every
working-tree change, which produces the same WmiPrvSE saturation on repos
with large untracked sets (observed 2026-07-17 on an earlier build).
Suggested fixes
- Batch/throttle the process-tree sampling (one enumeration per interval,
not several concurrent full-table dumps per second).
- Query only the tracked PIDs' subtree instead of enumerating all processes
and all perf-counter instances.
- Use native APIs (NtQuerySystemInformation / toolhelp snapshot) instead of
spawning powershell.exe + WMI per sample.
4 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Additional reproduction signal: this stopped immediately after I committed all pending Git changes in a very dirty worktree.
Before the commit, using Codex shell features repeatedly correlated with Git subprocess activity, taskkill/conhost churn, elevated WMI Provider Host CPU, and eventually Codex becoming unresponsive while Windows could no longer launch other applications. After committing the pending changes, taskkill activity returned to idle, WMI CPU returned near idle, and the freeze has not recurred.
This points to a workspace-scanning/backpressure bug triggered by a heavily dirty Git worktree, possibly a retry/cancellation loop involving Git subprocesses, process cleanup, and WMI process monitoring.
System: Windows 11 x64, Intel Core i9-13900K, 64 GB RAM, NVIDIA GeForce RTX 3090 (24 GB).
Privacy note: repository/project names, local paths, account identifiers, conversation identifiers, and raw logs are intentionally omitted.
Additional upstream trigger: automatic Git review queries
I reproduced the same Windows WMI/process-monitoring amplification without running any shell command or agent tool.
On package
26.715.10079.0, merely opening a conversation inside a dirty Git project caused the renderer to issue automaticreview-summaryandbranch-diff-statsqueries.An approximately 11-second WPR capture contained 2,422 spawned processes, including:
git hash-objectgit configtaskkill.execonhost.exeWmiPrvSE.exeaccounted for approximately 32.71% system CPU, andWinmgmtaccounted for another 9.68%. Total system CPU approached 100% for 15-30 seconds on every conversation open.Disabling the Electron app-state process snapshot path alone did not eliminate the spike because the upstream Git fan-out continued.
Holding that mitigation constant, disabling only the renderer's
review-summaryandbranch-diff-statslive queries eliminated the trigger. A subsequent 30-second capture showed 0%WmiPrvSE.exeCPU and no new matching WMI events.This suggests two compounding defects:
taskkill.exe, andconhost.exe.The process-monitoring fix should therefore cover Git/review worker children as well as explicit shell executions. Related review-query tracking is in #30820.
Still reproducible on Windows desktop 26.721.4979.0 (2026-07-27)
I can confirm that this issue persists on a substantially newer stable MSIX build.
Environment
OpenAI.Codex_26.721.4979.0_x6426100.8875)Impact
WmiPrvSE.exeremains a major CPU consumer while local Codex tasks are active. The machine develops periodic mouse, window-dragging, and IME/input stalls despite high-end hardware. Audio and video playback can remain uninterrupted, suggesting latency/input starvation rather than a normal whole-system compute bottleneck. Fully exiting Codex removes the recurring stutter.Correlated Windows event evidence
The existing
Microsoft-Windows-WMI-Activity/Operationallog shows repeated Event 5858 entries with many distinct, short-livedClientProcessIdvalues. Operations include:and large queries of the form:
Failures repeatedly include:
The client processes often disappear before WMI can return status. Event 5857 simultaneously shows the
CIMWin32provider starting inWmiPrvSE.exeviawmipcima.dll.The classic
Windows PowerShelllog independently records the exact repeated HostApplication command:It also records the heavier periodic sampler:
with command line, working set, CPU percentage, and process-age projection. The commands recur every few seconds, and overlapping local Codex task/tool activity amplifies the rate.
This was reproduced after app updates and restarts. The active project workloads themselves do not intentionally call WMI; one task explicitly prohibited WMI/CIM polling and watchdogs, yet the desktop monitoring commands continued.
Conclusion / request
This strongly confirms that the desktop app's Windows process/performance supervision path is still using repeated full-machine WMI enumeration on
26.721.4979.0. Please prioritize a native process snapshot implementation or, at minimum, single-flight execution, strict throttling, exponential backoff/circuit breaking, and cancellation that does not create another helper-process/WMI feedback loop.Raw logs are not attached because they contain local process metadata and paths, but sanitized timestamps/query summaries can be provided if maintainers request them.