Windows Codex Desktop spawns powershell.exe every second for full process polling, causing high CPU usage
What version of the Codex App are you using (From “About Codex” dialog)?
26.527.31326
What subscription do you have?
Pro
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
Codex Desktop repeatedly spawns short-lived powershell.exe children under the Codex.exe GUI process to run full-machine CIM/WMI scans over Win32_Process and Win32_PerfFormattedData_PerfProc_Process.
In a fresh 30.05s measurement, I observed 23 PowerShell/pwsh processes, approximately 0.77/sec, consuming about 48.95 CPU-seconds total. Roughly 1.6 logical cores of sustained load from this recent change to how Codex monitors apps.
Confirmed child command examples:
powershell.exe -NoProfile -NonInteractive -Command "... Get-CimInstance Win32_Process | Select-Object ProcessId,ParentProcessId | ConvertTo-Json -Depth 2"
powershell.exe -NoProfile -NonInteractive -Command "... Get-CimInstance Win32_PerfFormattedData_PerfProc_Process ... Get-CimInstance Win32_Process ... CommandLine,WorkingSetSize,..."
What steps can reproduce the bug?
019e7fe2-7262-7c50-bbbc-0a374d0db752
- Run Codex Desktop on Windows.
- Watch child processes under Codex.exe using Task Manager, System Informer, or Get-CimInstance Win32_Process.
- When active, Codex.exe repeatedly spawns powershell.exe children running Get-CimInstance Win32_Process / Win32_PerfFormattedData_PerfProc_Process.
I do not yet have a deterministic trigger; the loop appears intermittent or state-dependent but happens while conversations are ongoing.
What is the expected behavior?
Codex Desktop should not spawn PowerShell repeatedly for full-machine process polling. Process tracking should be throttled, non-overlapping, scoped to Codex-owned process trees, or implemented through a persistent/native helper.
Additional information
This appears to be Codex Desktop app behavior, not the standalone Codex CLI. The parent process is the packaged Windows app Codex.exe, and the likely source is Desktop process-manager code in app.asar.
This did not happen before the updates at the end of last week (~28th/29th).
26 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I used Codex to help try investigate, and it found an anomaly:
~\.codex\process_manager\chat_processes.jsonhad 15 stale entries for conversations that happened the day prior.After clearing the stale entries and restarting Codex, the expensive checks still happen but at a slower interval than before.
Each launch of the powershell still is doing these commands that take ~1 or 2 seconds of ~2 CPU cores to complete.
``
powershell.exe -NoProfile -NonInteractive -Command "$ErrorActionPreference = 'Stop'; Get-CimInstance Win32_Process | Select-Object ProcessId,ParentProcessId | ConvertTo-Json -Depth 2"````
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 -Filter \"ProcessId = 4392 OR ProcessId = 6368 OR ProcessId = 7132 OR ProcessId = 7160 OR ProcessId = 9384 OR ProcessId = 9528 OR ProcessId = 10408 OR ProcessId = 10868 OR ProcessId = 10876 OR ProcessId = 12048 OR ProcessId = 13772 OR ProcessId = 13872 OR ProcessId = 14400 OR ProcessId = 14828 OR ProcessId = 15604 OR ProcessId = 15652 OR ProcessId = 15932 OR ProcessId = 16024 OR ProcessId = 17308 OR ProcessId = 18164 OR ProcessId = 19972 OR ProcessId = 20632 OR ProcessId = 24368 OR ProcessId = 25228 OR ProcessId = 25320 OR ProcessId = 25328 OR ProcessId = 25404 OR ProcessId = 25916 OR ProcessId = 27828 OR ProcessId = 27832 OR ProcessId = 28396 OR ProcessId = 28788 OR ProcessId = 29300 OR ProcessId = 30292 OR ProcessId = 31736 OR ProcessId = 32152 OR ProcessId = 33536 OR ProcessId = 33948 OR ProcessId = 33988 OR ProcessId = 34356 OR ProcessId = 34544 OR ProcessId = 35192 OR ProcessId = 35244 OR ProcessId = 35364 OR ProcessId = 35852 OR ProcessId = 36868 OR ProcessId = 37092 OR ProcessId = 37712 OR ProcessId = 38156 OR ProcessId = 38520 OR ProcessId = 38608 OR ProcessId = 38724 OR ProcessId = 39336 OR ProcessId = 40392 OR ProcessId = 40492 OR ProcessId = 40580 OR ProcessId = 40840 OR ProcessId = 41416 OR ProcessId = 42652 OR ProcessId = 43232\" | Select-Object ProcessId,ParentProcessId,CommandLine,WorkingSetSize,@{Name='CpuPercent';Expression={$cpuByPid[[int]$_.ProcessId]}},@{Name='AgeSeconds';Expression={[int]((Get-Date) - $_.CreationDate).TotalSeconds}} | ConvertTo-Json -Depth 2"````
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"``I added a small helper for packaging this kind of evidence without posting raw full-machine process dumps:
trace-to-skill@0.1.73now hasprocess-audit.Scope note: it does not inspect live processes or mutate Codex state. It parses process notes/snippets that a user already captured from Task Manager, System Informer,
Get-CimInstance,ps,top, etc. It currently flags:Get-CimInstance Win32_Process/Win32_PerfFormattedData_PerfProc_Processprocess_manager/chat_processes.jsonmentionsThe output includes a checklist for sample duration, child process count, approximate spawn rate, CPU-seconds, parent Codex.exe PID, and redacted command lines. Release/proof: https://github.com/grnbtqdbyx-create/trace-to-skill/releases/tag/v0.1.73
I added a small local report helper for this kind of evidence in
trace-to-skill@0.1.73:Scope note: it does not inspect live processes or modify Codex state. It only turns pasted/saved process evidence into a smaller public report, so users do not need to attach raw full-machine process dumps.
It detects:
powershell.exe/pwshCIM polling commands such asGet-CimInstance Win32_ProcessandWin32_PerfFormattedData_PerfProc_Processprocess_manager/chat_processes.jsonmentionsRelease/proof: https://github.com/grnbtqdbyx-create/trace-to-skill/releases/tag/v0.1.73
Additional confirmation on the latest Windows Desktop build.
Environment
10.0.19045, x64C:\Program Files\WindowsApps\OpenAI.Codex_26.623.9142.0_x64__2p2nqsd0c76g0\app\Codex.exeapp.asar:26.623.70822codexBuildNumber:455942.1.0C:\Program Files\WindowsApps\OpenAI.Codex_26.623.9142.0_x64__2p2nqsd0c76g0\app\resources\codex.exe app-server --analytics-default-enabledObserved behavior
Process Explorer showed repeated short-lived
powershell.exechildren spawned directly by the ElectronCodex.exeprocess. The command line matches the background process telemetry/polling command:A short live sample saw fresh
process-metadataPowerShell processes underCodex.exeevery ~0.5-1s while a Codex turn/tool flow was active. Example sample rows:This was not caused by a user hook or script. The only configured hook command on this machine was a startup-only
SessionStartcleanup hook withpowershell -NoProfile -ExecutionPolicy Bypass -File ...; the repeated processes were insteadpowershell.exe -NoProfile -NonInteractive -Command ... Get-CimInstance ...and were parented byCodex.exe.Installed bundle evidence
Extracting the installed
app.asarshows this is coming from the Electron process sampler path.main-Btzug9bx.jscreates a worker namedchild-process-snapshot:The same bundled file labels this area
electron-sampler, andaddChildProcessFieldscalls the worker on Windows:The bundled sampler manager has:
and uses
setInterval(() => this.requestAppStateSnapshot('heartbeat'), OZ), so the background heartbeat appears intended to be 30s, with non-heartbeat snapshot triggers gated at 5s. The observed rate can be much higher while the app is active, likely due to additional snapshot triggers and/or overlapping slow WMI/CIM probes.child-process-snapshot-worker.jslaunches two Windows PowerShell probes for each snapshot:and then:
The worker receives only a root PID via
workerData, builds the descendant process set, and then asks PowerShell/WMI for details. The second query still enumeratesWin32_PerfFormattedData_PerfProc_Processglobally to build$cpuByPid.Why this remains a problem
Even if the telemetry is intentional, spawning full Windows PowerShell repeatedly for process telemetry is expensive and highly visible in diagnostic tools. On Windows 10 in particular, the combination of
powershell.exestartup +Get-CimInstance+ globalWin32_PerfFormattedData_PerfProc_Processpolling is a poor background implementation.Expected behavior:
This issue is still present on
OpenAI.Codex_26.623.9142.0/ bundle4559.EDIT: do you test this code in prod only? Tragic.
Seeing the same pattern on Windows 11 with Codex Desktop.
Local PowerShell event logs show short-lived
powershell.exeConsoleHost sessions around2026-07-06 17:30:00-17:30:02and2026-07-06 22:20:04-22:20:12, running:Get-CimInstance Win32_ProcessandWin32_PerfFormattedData_PerfProc_Process, thenConvertTo-Json.A live sample showed the
powershell.exeprocess parented byCodex.exe. User-visible impact includes black console flashes and intermittent mouse/keyboard stutter. This also matches #26613.Confirmed on a newer Windows Desktop build with the same global WMI sampling command.
Environment
26.707.3748.00.144.126200, x64Captured process
A live process-tree snapshot found a short-lived
powershell.exedirectly parented by the packaged DesktopChatGPT.exe. Its command line contained the same sequence described in this issue:The filter listed a large set of Desktop, app-server, MCP, Node, renderer, and command-runner PIDs, while
Win32_PerfFormattedData_PerfProc_Processwas still enumerated globally to build the CPU map.I also captured the separate Git-process churn on this machine. GPU utilization remained only 1-3%, so repeated Windows process creation and global WMI queries are a much better fit for the observed fan activity than GPU saturation.
An unprivileged
Win32_ProcessStartTracesubscription was denied by WMI on this machine, so I am not claiming an exact PowerShell spawn rate from this run. The captured parent PID and command line do confirm that the expensive sampler path is still present in26.707.3748.0.Suggested fix
Use a persistent/native process sampler, scope expensive metrics to the already-discovered descendant PIDs, make snapshots single-flight, and coalesce active-turn triggers so they cannot overlap the heartbeat sampler.
---
This issue or PR was generated by LazyCodex.
Tag: lazycodex-generated
Additional confirmation from a newer Windows Desktop build, with ETW/WMI attribution and user-visible impact.
Environment
26.707.12708.0Evidence
The machine exhibits sustained total CPU usage in the roughly 30-60% range during the affected state, with about eight logical-processor graphs remaining continuously busy and severe system-wide input/UI stutter.
An ETW trace of
Microsoft-Windows-WMI-Activitycorrelated the activity with short-lived PowerShell clients spawned by the packaged Codex Desktop process (ChatGPT.exe). The queries were handled by two WMI Provider Host instances:WmiPerfInstservicingWin32_PerfFormattedData_PerfProc_ProcessCIMWin32servicingWin32_ProcessThis matches the commands and Electron sampler path already documented in this issue. The installed
26.707.12708.0bundle still contains the sameGet-CimInstance Win32_ProcessandGet-CimInstance Win32_PerfFormattedData_PerfProc_Processpolling implementation.The symptom is particularly misleading in Task Manager/Resource Monitor: individual
WmiPrvSE.exerows can show low sampled averages while total CPU usage is much higher, but the high total CPU state consistently coincides with the polling activity and real machine stutter.Impact
This is not merely a cosmetic telemetry issue. Repeated full-machine process polling:
Please prioritize a fix or provide an immediate supported kill switch. At minimum, the sampler should be single-flight, aggressively rate-limited/coalesced, idle-aware, and restricted to the Codex-owned process tree. A persistent/native Windows process sampler would avoid repeatedly launching PowerShell and globally enumerating WMI performance classes.
This comment was prepared and submitted by OpenAI Codex using the affected user's GitHub account with the user's explicit permission.
Confirmed this still reproduces on the current Microsoft Store build 26.715.4045.0 on Windows 11 (20 logical processors), including while the Codex desktop app is visibly idle.
A/B confirmation
WmiPrvSE.exeremains active.Live measurements
Using Windows Process performance counters, the busy
WmiPrvSE.exeinstance averaged 8.42% of total machine CPU over 10 seconds and peaked at 10.10%. A second sample averaged 6.62% and peaked at 21.69% of total machine CPU.Provider troubleshooting counters identified
CIMWin32in that host as the active provider:A six-second
Msft_WmiProvider_ExecQueryAsyncEvent_Precapture observed 120 queries. The dominant query occurred 86 times (about 14.3/sec):There were also repeated per-PID
ExecutablePath/CommandLinequeries and largeProcessId = ... OR ProcessId = ...filters.Since boot, the WMI Operational log contained 893 Event 5858 client failures:
The reported client PIDs belonged to short-lived processes and had exited by inspection time.
Installed bundle correlation
The current packaged
app.asarstill contains Windows process snapshot code that launches hiddenpowershell.exeand runs both:It also constructs the same
Get-CimInstance Win32_Process -Filter "ProcessId = ... OR ProcessId = ..."query shape recorded by WMI. The renderer contains achild-processesquery configured withintervalMs: 5000, but the measured rate is much higher than one snapshot every five seconds, suggesting duplicated/overlapping callers or another unbounded refresh path.No WMI service crashes,
WmiPrvSEquota events, or signature anomalies were found. This appears to be application-driven polling rather than WMI corruption.Current workaround: fully exit Codex Desktop when it is not actively needed. Restarting or rebuilding WMI is not an appropriate workaround.
Potential duplicates/related reports: #29499 and #33875.
Independent confirmation on the current Microsoft Store build, with a live process count and installed-package correlation.
Environment
OpenAI.Codex_26.715.4045.0_x64Live impact and attribution
During the affected state:
WmiPrvSE.exereached 36.24% of total-machine CPU while total CPU was 83.97%.Win32_Processquery and failed in the same millisecond with RPC error0x800706BE.Get-CimInstancecommands embedded in the installed Codex package, and the processes were direct children of the packaged DesktopChatGPT.exe.Installed-package confirmation
Read-only inspection of the installed
app.asarshows:delta_burst,thread_started,turn_started, andturn_completed;Get-CimInstance Win32_Process | Select-Object ProcessId,ParentProcessIdGet-CimInstance Win32_PerfFormattedData_PerfProc_ProcessGet-CimInstance Win32_Processdetail queries;This matches the observed burst of simultaneous clients and explains why a nominal 5/30-second schedule can become a WMI storm.
Requested fix
Please provide an immediate supported kill switch for Windows host/process sampling, then make collection single-flight, coalesced, timeout-bounded, and protected by exponential backoff/circuit breaking. A persistent native collector scoped to the Codex process tree would avoid repeatedly launching PowerShell and globally enumerating WMI classes.
No prompts, conversation contents, usernames, local paths, or raw private logs are included. This comment was prepared and submitted by Codex using the affected user's GitHub account with the user's explicit permission.
Additional reproducible evidence for this issue follows. This narrows the failure to overlapping WMI snapshot paths and a fixed 5-second timeout, including retriggering on window focus.
Exit code: 0
Wall time: 20.7 seconds
Output:
[Windows Desktop] Repeated PowerShell/WMI process snapshots hit a fixed 5-second timeout on startup and window focus
Summary
Codex Desktop for Windows launches overlapping PowerShell/WMI process-enumeration commands from at least two internal paths. Both enumerate system-wide process data, and one path uses a fixed 5-second timeout.
On a Windows system where these valid WMI queries take roughly 4.3–4.7 seconds when warm and more than 5 seconds when cold, the commands repeatedly time out or fail. The same work is triggered again when the Codex window receives focus. This causes repeated WMI provider activity and noticeable CPU usage.
This appears to be an application bug rather than a damaged WMI repository or a permanent permissions problem: the exact queries succeed under the same user account when allowed to finish.
Environment
OpenAI.Codex_26.715.3651.0_x64__2p2nqsd0c76g0C:\Program Files\WindowsApps\OpenAI.Codex_26.715.3651.0_x64__2p2nqsd0c76g0\app\ChatGPT.exeActual behavior
Two independent call paths launch PowerShell and query WMI/CIM:
ChatGPT.exe->electron-sampler->child-process-snapshot-worker.js->powershell.exe->Get-CimInstanceChatGPT.exe->BundledPluginsMarketplaceplugin reconciliation /stop_chrome_native_host->powershell.exe->Get-CimInstanceThe queried classes include:
Win32_ProcessWin32_PerfFormattedData_PerfProc_ProcessInspection of the installed application package shows the sampler creates
child-process-snapshot-worker.js, invokespowershell.exe -NoProfile -NonInteractive, and applies a fixedtimeout = 5e3(5,000 ms). The process is hidden and the output buffer is set to 8 MiB.The application log shows the sampler and plugin reconciliation failing close together. The pattern repeats after window focus:
electron-samplerfailure while queryingWin32_ProcessBundledPluginsMarketplacefailure while queryingWin32_PerfFormattedData_PerfProc_ProcessandWin32_Processbundled_plugins_reconcile_started reason=focusWMI Activity logs at the same timestamps show provider activity for
CIMWin32,WmiPerfClass, andWmiPerfInst. SubsequentWMIBinaryMofResourceactivity underSYSTEMappears to be downstream provider initialization, not a separate direct Codex query.Timing evidence
The queries were measured outside the Codex sandbox, under the same Windows user account.
Individual queries, three runs each:
| Query | Run 1 | Run 2 | Run 3 |
|---|---:|---:|---:|
|
Win32_Process| 1,899 ms | 1,713 ms | 2,642 ms ||
Win32_PerfFormattedData_PerfProc_Process| 4,675 ms | 2,689 ms | 2,602 ms |The combined Codex-equivalent command completed successfully in:
This leaves only 330 ms of margin against the fixed 5,000 ms timeout in the slowest warm run. In an earlier cold run, the performance-class query took 5,931 ms, and the combined command took approximately 6.3 seconds.
Therefore, normal timing variation is sufficient to cross the application's timeout. Starting two overlapping full-system WMI enumerations can make the condition more likely and increases CPU load even when both eventually succeed.
Steps to reproduce
Microsoft-Windows-WMI-Activity/Operational.powershell.exechildren runningGet-CimInstanceforWin32_Processand/orWin32_PerfFormattedData_PerfProc_Process.bundled_plugins_reconcile_started reason=focus, followed by another set of WMI calls and, on affected machines, timeout/failure warnings.The issue is easier to reproduce during cold WMI provider startup or other system load.
Expected behavior
Suggested fixes
electron-samplerand bundled-plugin reconciliation instead of launching duplicate WMI work.Configuration note
Changing the Codex workspace sandbox setting is not expected to fix this issue. The WMI calls originate from the desktop host application and also reproduce as normal same-user commands outside the sandbox. No supported setting was found for changing the sampler timeout or disabling these WMI snapshots.
Available diagnostics
Before uploading any full log or session transcript, it should be reviewed for local paths, prompts, repository names, environment variables, tokens, and other sensitive information.
Local evidence references (not public paths)
%LOCALAPPDATA%\Packages\OpenAI.Codex_2p2nqsd0c76g0\LocalCache\Local\Codex\Logs\2026\07\19\...logcodex_diagnostics\current-wmi-latency-20260719.csvConfirming and extending this report with ~3h of diagnostic data collected tonight.
Environment: Codex Desktop 26.715.4045.0 (current), Windows 11 Pro build 26200, 12 logical cores. The bug is still fully present in this version.
1. Spawn cadence and query shapes. The spawner is the app's main process (
ChatGPT.exewith no--type=flag). It launchespowershell.exe -NoProfile -NonInteractiveroughly every 1–2 s — I captured 11 spawns in a 20 s window. Three rotating query shapes:Get-CimInstance Win32_PerfFormattedData_PerfProc_Processscan, then aWin32_Processquery whose filter is a machine-generated list of ~120 literalProcessId = N OR …clauses (the watched-PID list changes every round);Get-CimInstance Win32_Process | Select-Object ProcessId,ParentProcessId | ConvertTo-Json;CommandLine,WorkingSetSize,AgeSeconds.The watched PIDs are the app's own processes,
codex.exe, thecua_noderuntime, MCP servers, and terminals of running agent tasks (e.g. annpm run package:smokethe agent had started).2. Where the cost lands (why Task Manager never blames Codex). Measured attribution on a fully loaded machine: Codex-named processes ≈ 3% of total CPU; induced load ≈ 48% —
WmiPrvSE.exeup to ~2.5 cores servicing the full-machine scans,MsMpEng.exe(Defender) scanning every short-lived spawn,svchost(Winmgmt) and DWM handling conhost churn. Total ≈ 51% of a 12-core machine attributable to this loop. Quitting the app instantly dropped total CPU from ~100% to ~30%.3. External mitigation is a losing arms race. A watchdog killing the spawned pollers at birth (250 ms cadence) made the app retry faster — spawn rate roughly doubled to ~2/s (>2,300 spawns in ~20 min). Suspending the main process does stop the loop but hangs system-wide UI (window-message broadcasts block on the frozen queue — same symptom family as #31236), so that's not viable either.
4. Partial relief that worked: a Defender process exclusion for
powershell.executMsMpEngfrom ~0.6 to ~0.15 cores. Also, session accumulation matters: after ~12 h the app had 9 × ChatGPT.exe, 6 × codex.exe and 53 orphaned conhost.exe alive.Suggested fix direction: replace the spawn-a-fresh-PowerShell-per-tick design with one persistent native/helper worker doing incremental, scoped polling of Codex-owned process trees (as the OP suggested). That would eliminate essentially all of the WMI + Defender + process-churn cost described above.
Still reproducible on Codex Desktop 26.715.7063.0 (Microsoft Store package, Windows x64).
I independently traced the high-CPU event on an affected machine:
WmiPrvSE.exereached 55.9% total CPU.powershell.exe <- ChatGPT.exe, whereChatGPT.exeis the signed packaged OpenAI Codex desktop host.Get-CimInstance Win32_ProcessandGet-CimInstance Win32_PerfFormattedData_PerfProc_Process.Microsoft-Windows-WMI-Activity/Operationalrecorded repeated failures including0x80041032and0x800706BA.Inspection of the installed
app.asarmatches the implementation described above:child-process-snapshot-worker.jslaunches a fullWin32_Processquery, then a second query that globally enumeratesWin32_PerfFormattedData_PerfProc_Processbefore fetching details for descendant PIDs. The sampler has a 30-second heartbeat and a 5-second minimum interval for non-heartbeat triggers; streamed deltas can triggerdelta_burstsnapshots. I did not find an in-flight/single-flight guard around snapshot creation.A sampled WMI phase took about 3 seconds, so overlapping snapshots are a plausible amplifier when another trigger arrives before the previous two-phase snapshot completes. This overlap is an inference from the bundled code and timings, not yet proven with internal instrumentation.
Suggested fix directions:
Win32_PerfFormattedData_PerfProc_Processenumeration for every delta burst.No user paths, workspace names, hostnames, or conversation content are included here.
Opening any conversation starts sustained WMI CPU usage.
Switching to another conversation does not stop it.
Opening Settings immediately stops WMI activity.
WMI Event ID 5858:
Win32_PerfFormattedData_PerfProc_Process
ResultCode = 0x800706BA
PossibleCause = Could not send status to client
Additional PowerShell 5.1 vs PowerShell 7 A/B Evidence
Additional confirmation with a controlled Windows PowerShell 5.1 vs PowerShell 7 A/B test.
Environment
26.721.3404.05.17.6.380%throughout all testsI confirmed that the Codex Desktop main process (
ChatGPT.exe) launchespowershell.exeto execute the same two WMI/CIM queries reported in this issue:and:
Inspection of the installed application bundle showed that this process-monitoring path invokes
powershell.exeexplicitly. On a standard Windows installation, that resolves to Windows PowerShell 5.1 even when PowerShell 7 is installed.Exact-query A/B Results
The same queries were executed separately with Windows PowerShell 5.1 and PowerShell 7.6.3.
| Query | Runtime | Wall time | Aggregate CPU time |
|---|---|---:|---:|
| Process tree | PowerShell 5.1 | 1335 ms | 2631 ms |
| Process tree | PowerShell 7.6.3 | 473 ms | 531 ms |
| Process statistics | PowerShell 5.1 | 1774 ms | 2656 ms |
| Process statistics | PowerShell 7.6.3 | 795 ms | 587 ms |
For these queries, PowerShell 7 reduced aggregate CPU time by approximately 78-80%.
All queries completed successfully and returned compatible JSON data in both runtimes.
Codex Desktop End-to-End Test
As a local diagnostic workaround, I launched Codex Desktop with a process-local
PATHentry containing a nativepowershell.exeforwarding shim. The shim forwards the original arguments, standard streams, working directory, and exit code to:I verified the actual live process chain:
No files under
System32, no permanent user or machinePATHvalues, and no Codex application package files were modified.Using the same 60-second monitoring workload:
| Metric | Original PS 5.1 path | PS 7 forwarding path |
|---|---:|---:|
| Average CPU temperature | 70.6 C | 40.3 C |
| Maximum CPU temperature | 80.1 C | 59.5 C |
| Average CPU package power | 22.0 W | 7.1 W |
| Maximum CPU package power | 38.1 W | 22.7 W |
| Average CPU load | 17.5% | 2.8% |
| Maximum CPU load | 39.9% | 17.8% |
The thermal starting conditions were different between the two 60-second runs, so the exact-query timings, aggregate CPU time, package power, and CPU load are the stronger evidence.
The processor power settings were not reduced between tests. In particular, the AC minimum processor state remained at 80%.
Conclusion
Repeated full-machine WMI polling and overlapping snapshot triggers remain the underlying design problem. However, explicitly invoking Windows PowerShell 5.1 substantially amplifies its CPU, power, and thermal cost.
A relatively low-risk immediate mitigation would be:
pwsh.exewhen PowerShell 7 is installed.The longer-term fix should still make process snapshots single-flight and coalesced, avoid repeated global
Win32_PerfFormattedData_PerfProc_Processenumeration, and preferably use a persistent helper or native Windows process APIs.Codex app is simply unusable on windows due to extreme cpu usage - its been more than a two weeks with no fix.
Confirmed on current Windows Codex Desktop
I can reproduce this on Windows 11 with:
OpenAI.Codex_26.721.4979.0ChatGPT.exeAfter a full Windows reboot and a full Codex restart, Codex repeatedly creates short-lived
powershell.exeandconhost.exechildren at roughly once per second.The
conhost.exewindows visibly flash on screen, which is extremely disruptive during normal work.What I captured
The repeated processes are direct descendants of the packaged Codex Desktop main process. They are not caused by Task Scheduler, my backup job, a custom hook, Chrome, or an external PowerShell script.
The PowerShell children repeatedly run full-machine CIM/WMI inventory commands including:
The returned data includes:
ProcessIdParentProcessIdCommandLineWorkingSetSizeThe results are serialized to JSON and returned to the desktop app.
Impact
This is not merely cosmetic:
Request for an OpenAI response
There are now multiple reports across Windows versions and Codex Desktop builds spanning at least two months.
Can an OpenAI maintainer please:
I can provide a sanitized process-tree capture and redacted command lines if that would help reproduce or triage this.
Reproduced on Windows 11 with OpenAI.Codex 26.721.11231.0. In a 15-second trace, the main ChatGPT.exe process spawned five PowerShell WMI scans using
Win32_Process/Win32_PerfFormattedData_PerfProc_Processand fiveconhost.exeprocesses. System-wide UI/input stuttering occurs despite normal-looking aggregate utilization. In-app feedback/session ID:019faed9-2563-7e20-971e-e266e59b5717.Confirming this is still reproducible on Codex Desktop
26.721.4979.0on Windows 11 x64 build26200.The packaged Desktop app—currently hosted by
ChatGPT.exewith Codex child processes—continues to spawn short-livedpowershell.exeandconhost.exeprocesses executing the same full-system queries described here:Get-CimInstance Win32_ProcessGet-CimInstance Win32_PerfFormattedData_PerfProc_ProcessDuring approximately six minutes of active tool use, I observed roughly 400 PowerShell/conhost process pairs. A separate longer process-start capture attributed 13,131 PowerShell starts and 4,333 Git starts directly to the Desktop host process. Activity increases sharply around tool-command start and completion.
The user-visible result is severe system-wide input and window-animation stuttering even though CPU, memory, storage latency, and processor queue are nowhere near saturation. Fully closing Desktop substantially improves responsiveness. Restarting Windows clears the accumulated degradation temporarily, but it returns after continued Desktop use. Using Codex without the Desktop host running does not reproduce the same behavior.
There may also be persistent security-object churn: during an affected session,
lsass.exereached more than 22,000 handles, dominated by Semaphore and Token handles, compared with only a few thousand following a clean boot. I am not claiming that this proves an LSASS defect, but the growth closely follows active Desktop process creation and survives sleep until reboot.An empty/malformed
.gitdirectory was found to amplify Git/conhost probing, but correcting that does not address the separate WMI process-polling path.Additional reproduction data from a newer Windows Codex Desktop build.
Environment:
10.0.26200, build26200OpenAI.Codex_26.721.11231.0_x64__2p2nqsd0c76g0ChatGPT.exe150.0.7871.128...\app\resources\codex.exe -c features.code_mode_host=true app-server --analytics-default-enablednode v24.14.0,npm 11.9.0User-visible symptoms:
Observed over several diagnostic windows:
conhost.exe, launched under short-lived PowerShell children owned by Codex Desktop:explorer.exe -> ChatGPT.exe -> powershell.exe -> conhost.exeWin32_ProcessStartTracecapture, there were 14powershell.exelaunches directly fromChatGPT.exe, and each had aconhost.exechild.Get-CimInstance Win32_ProcessGet-CimInstance Win32_PerfFormattedData_PerfProc_ProcessConvertTo-JsonChatGPT.exe -> powershell.exe -> conhost.exePages/secaround 121-180 andPage Reads/secaround 79-93.node.exeburst was also observed. This was not the persistent smallnode_repl.exehelper. The parent chain during the burst was:ChatGPT.exe -> codex.exe -> codex-command-runner-0.146.0-alpha.3.1.exe -> pwsh.exe -> npm.ps1 -> node.exeA 30-second high-frequency capture around 09:46:59-09:47:03 caught many transient
node.exeprocesses. PowerShellCore event ID 4104 logs confirmed repeated execution of the standardC:\Program Files\nodejs\npm.ps1wrapper at 09:46:58, 09:47:16, 09:48:10, and 09:50:59 local time. A later 45-second polling window caught no livenode.exe, which suggests these processes are very short-lived and bursty.Working interpretation:
26.721.11231.0.conhost.exechild of Codex-owned PowerShell process polling.node.exeobservation appears to be a separate Codex command-runner path invoking host npm through PowerShell (npm.ps1), not the normal persistentnode_repl.exehelpers.Expected behavior:
Privacy note:
same here!
Codex Desktop on Windows: WMI/Git/taskkill process storm causes system-wide stutter
Paste-ready issue report
Summary
Codex Desktop
26.721.11231.0on Windows repeatedly creates short-livedPowerShell, conhost, Git, and taskkill processes. ETW process ancestry and
read-only inspection of the installed
app.asarpoint to a feedback-heavyinteraction between:
taskkill.exe /t /f.The result is system-wide input/UI stutter. Closing the visible window is not a
reliable recovery because background Codex processes may remain. Even after all
Codex processes stop, previously accumulated kernel pool/object state may not
be reclaimed promptly; reboot has been the only consistently reliable reset on
this machine.
Environment
26.721.11231.0OpenAI.Codex_26.721.11231.0_x64__2p2nqsd0c76g0app.asarSHA-256:23A8F5D1645247BD942304DC586C44B8CE63C2E3FC408198F815657731070DB5150.0.7871.12826200Reproduction
frequency.
ancestor is the Codex Desktop main process.
Local evidence
1. High-frequency process sampling
In a 30-second sample:
powershell.execonhost.exeThe dominant PowerShell parent was the Codex Desktop main
ChatGPT.exeprocess.
Observed command lines include:
and:
2. ETW process ancestry
In an approximately 33-second effective WPR pool trace:
git.exeprocesses in totalconhost.exeprocesses in totaltaskkill.exeprocesses in totalgit.exeprocesses directly parented by Codex DesktopChatGPT.exetaskkill.exeprocesses directly parented by Codex Desktopcodex.exe app-serverThe
taskkill.execommands were:The Git command families included:
git config --get core.fsmonitorgit rev-parsegit remotegit status --porcelaingit for-each-refgit diffgit update-ref3. WMI cost and failed-client evidence
Eight direct timing runs gave:
Win32_Process: average about 174 ms, maximum about 258 msWin32_PerfFormattedData_PerfProc_Process: average about 471 ms,maximum about 489 ms
Recycling all
WmiPrvSE.exeprovider hosts did not improve those timings whileCodex remained active. This rules out a one-off wedged WMI provider as the
primary cause; the expensive full scans are continuously regenerated.
After excluding events created by an intentionally failed diagnostic watcher,
clean WMI Activity event 5858 records included Codex-launched short-lived
clients disappearing before WMI could return results (
0x800706BA, “Could notsend status to client”).
4. Installed-code inspection
Read-only string and byte-offset inspection of:
confirmed the following production code paths:
child-process-snapshot-worker.jsGet-CimInstance Win32_ProcessGet-CimInstance Win32_PerfFormattedData_PerfProc_ProcesslistProcessSubtreeslistDetachedProcessCandidatesgit-originscore.fsmonitortaskkill.exeThe Windows process snapshot implementation launches
powershell.exe -NoProfile -NonInteractive. Its detailed snapshot firstenumerates all
Win32_PerfFormattedData_PerfProc_Processinstances and thenqueries
Win32_Process.The chat-process registry attempts OS-PID reconciliation by calling
listProcessSubtreeswith retry delays:If no PID is matched after those attempts, it calls
listDetachedProcessCandidates, which performs another Windows processenumeration.
The Electron performance sampler invokes the child-process snapshot worker.
Its heartbeat interval is 30 seconds, with other trigger events gated at a
minimum interval of 5 seconds while the relevant window is focused.
Git execution uses
killProcessTree: true. On Windows, the installed code'skill implementation invokes:
5. Kernel churn
The WPR pool trace recorded heavy allocation/free churn. Security-token-related
tags were present:
Toke: 11,834 allocations, about 20.6 MB allocated during the traceSeAt: 81,274 allocations, about 7.16 MB allocated during the traceSeTd: 11,835 allocations, about 1.55 MB allocated during the traceMost allocations made during the short trace were freed, so this trace alone
does not prove that every byte of the machine's approximately 4 GB combined
paged/nonpaged pool belongs to Codex. It does prove substantial process,
security-token, WMI, and kernel-object churn coincident with the Codex process
storm.
Excluded alternatives
display-driver DPC pathology was present.
ASUSOptimizationfor a controlled interval did not change thestutter; the service was restored immediately afterward.
WmiPrvSE.exewhile Codex continued generating scans did notchange WMI latency.
DWM work. Moving/resizing it lowers DWM use, but that is only a visible-window
amplifier and does not explain the persistent lag after the window is closed.
Root-cause statement
The active stutter is caused by a Codex Desktop for Windows process-management
and repository-discovery regression. Short-lived Git/process activity causes
repeated PowerShell/WMI process-table scans and forced process-tree cleanup
through
taskkill. The resulting process creation/destruction, WMI, scheduler,filesystem, and security-token churn produces system-wide latency.
This conclusion is verified for the active process storm. The exact owner of
every byte of retained kernel pool after the storm stops remains unverified.
Expected behavior
Codex Desktop should not repeatedly enumerate the full Windows process table or
spawn a new PowerShell/conhost process for routine child-process tracking.
Short-lived Git commands should not amplify into repeated WMI scans and
taskkillprocess trees. Exiting Codex should terminate every Desktop-ownedbackground process and promptly stop all related churn.
Suggested product fixes
tracking or a persistent native helper.
reconciliation operations within a bounded interval.
Win32_PerfFormattedData_PerfProc_Processclass when only a small PID set isrequested.
upsert/completereconciliation and avoid retrying short-livedcommands that have already exited.
taskkill /t /ffor Git commands that have alreadyexited normally.
automatic repository discovery until the native implementation is fixed.
ChatGPT.exe, bundledcodex.exe, and helper processes.Workaround
For prevention, keep Codex Desktop fully closed and use Codex CLI or the VS Code
extension. For an already degraded session, completely terminate the Codex
Desktop process tree, verify that no package-owned helper remains, and then
recycle
WmiPrvSE.exeprovider hosts. A local recovery script is included at:This stops new churn without changing any persistent Windows configuration.
If system-wide lag remains after the process count is zero and WMI providers
have been recycled, there is no supported selective purge for retained kernel
pool/security objects; reboot remains the reliable reset.
Related reports
thanks for the detailed reports and investigation here: they were really helpful 💖
26.730.7989.0that address some major sources of powershell/wmi stormstaskkill.execan still be started by other process-cleanup paths, and we’re continuing to work on reducing that separatelyif you’re still seeing sustained wmi cpu usage or system-wide lag after
26.730.7989.0, please share an updated/feedbackidthats really cost me a lot to find the problems, maybe a banked reset as a reward? hahahaha
I am reproducing this on the current Microsoft Store Codex Desktop package
26.803.5235.0 x64on Windows 11.Symptoms:
codex.exe app-serverand multipleChatGPT.exerenderer processes; normal Node/MCP helper processes were near 0% CPU.I disabled several optional MCP servers and bundled browser/computer plugins, which reduced helper-process count but did not solve the Desktop CPU/input-lag problem. The behavior persists after a complete quit/relaunch.
The reproduction pattern—desktop app open, task activity followed by apparent idle, then mouse movement immediately increasing CPU and system-wide lag—looks consistent with the repeated Windows process-inventory / renderer-snapshot behavior described in the related reports. Please confirm whether this path remains present in the 26.803 Store package and whether there is a supported mitigation or a target release for the fix.
No private task contents, account identifiers, paths, or raw logs included.
On Windows 11 Pro, I updated my copy of the desktop app to
26.803.10989.0and it ran into this issue still. I had to end the desktop app's task in task manager to prevent another system crash trying to use the desktop app.Still reproducible on the current Microsoft Store package OpenAI.Codex 26.810.6296.0, Windows x64 build 26200.
Observed behavior:
ChatGPT.exeprocess belonging to theOpenAI.Codexpackage averaging approximately 8.8% of total system CPU, with about 991 MB private memory. The standalone ChatGPT Classic package was identified separately and excluded from that process attribution.This has been noticeable since early July and remains present in the August 14 build. No raw logs, account identifiers, task contents, or private paths are included here.