Skip to content

Windows Codex Desktop spawns powershell.exe every second for full process polling, causing high CPU usage #25453

Open

Description

@jrf1001

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

  1. Run Codex Desktop on Windows.
  2. Watch child processes under Codex.exe using Task Manager, System Informer, or Get-CimInstance Win32_Process.
  3. 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).

Activity

  1. added
    app
    on May 31, 2026
  2. added
    bug
    windows-os
    on May 31, 2026
  3. github-actions commented on May 31, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  4. jrf1001 commented on May 31, 2026

    @jrf1001
    Author

    I used Codex to help try investigate, and it found an anomaly:

    ~\.codex\process_manager\chat_processes.json had 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"

  5. grnbtqdbyx-create commented on May 31, 2026

    @grnbtqdbyx-create
  6. grnbtqdbyx-create commented on May 31, 2026

    @grnbtqdbyx-create
  7. privacyguy123 commented on Jun 30, 2026

    @privacyguy123

    Additional confirmation on the latest Windows Desktop build.

    Environment

    • OS: Windows 10 Pro 10.0.19045, x64
    • Codex Desktop package path: C:\Program Files\WindowsApps\OpenAI.Codex_26.623.9142.0_x64__2p2nqsd0c76g0\app\Codex.exe
    • Extracted app bundle metadata from app.asar:
      • package version: 26.623.70822
      • codexBuildNumber: 4559
      • Electron: 42.1.0
    • Bundled app-server observed:
      • C:\Program Files\WindowsApps\OpenAI.Codex_26.623.9142.0_x64__2p2nqsd0c76g0\app\resources\codex.exe app-server --analytics-default-enabled

    Observed behavior

    Process Explorer showed repeated short-lived powershell.exe children spawned directly by the Electron Codex.exe process. The command line matches the background process telemetry/polling command:

    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 = ..." | Select-Object ProcessId,ParentProcessId,CommandLine,WorkingSetSize,@{Name='CpuPercent';Expression={$cpuByPid[[int]$_.ProcessId]}},@{Name='AgeSeconds';Expression={[int]((Get-Date) - $_.CreationDate).TotalSeconds}} | ConvertTo-Json -Depth 2"

    A short live sample saw fresh process-metadata PowerShell processes under Codex.exe every ~0.5-1s while a Codex turn/tool flow was active. Example sample rows:

    Sample  PID    ParentPID  ParentName  Kind
    0       25080  18588      Codex.exe   process-metadata
    1       10164  18588      Codex.exe   process-metadata
    3       17704  18588      Codex.exe   process-metadata
    5       26408  18588      Codex.exe   process-metadata
    7       19076  18588      Codex.exe   process-metadata
    

    This was not caused by a user hook or script. The only configured hook command on this machine was a startup-only SessionStart cleanup hook with powershell -NoProfile -ExecutionPolicy Bypass -File ...; the repeated processes were instead powershell.exe -NoProfile -NonInteractive -Command ... Get-CimInstance ... and were parented by Codex.exe.

    Installed bundle evidence

    Extracting the installed app.asar shows this is coming from the Electron process sampler path.

    main-Btzug9bx.js creates a worker named child-process-snapshot:

    new Worker(join(__dirname, `child-process-snapshot-worker.js`), {
      name: `child-process-snapshot`,
      workerData: e
    })

    The same bundled file labels this area electron-sampler, and addChildProcessFields calls the worker on Windows:

    process.platform === `win32` ? FQ(process.pid) : ...

    The bundled sampler manager has:

    var OZ = 3e4, kZ = 5e3, AZ = 6e4

    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.js launches two Windows PowerShell probes for each snapshot:

    powershell.exe -NoProfile -NonInteractive -Command "$ErrorActionPreference = 'Stop'; Get-CimInstance Win32_Process | Select-Object ProcessId,ParentProcessId | ConvertTo-Json -Depth 2"

    and then:

    powershell.exe -NoProfile -NonInteractive -Command "$ErrorActionPreference = 'Stop'; $cpuByPid = @{}; Get-CimInstance Win32_PerfFormattedData_PerfProc_Process ... Get-CimInstance Win32_Process -Filter ... | Select-Object ProcessId,ParentProcessId,CommandLine,WorkingSetSize,... | ConvertTo-Json -Depth 2"

    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 enumerates Win32_PerfFormattedData_PerfProc_Process globally 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.exe startup + Get-CimInstance + global Win32_PerfFormattedData_PerfProc_Process polling is a poor background implementation.

    Expected behavior:

    • process telemetry should not spawn a fresh PowerShell process per snapshot;
    • probes should be non-overlapping and rate-limited;
    • telemetry should stop or heavily throttle when the app is idle/backgrounded;
    • process enumeration should be scoped to the Codex process tree before collecting expensive metrics;
    • ideally this should use a persistent/native helper or direct Windows process APIs instead of repeated PowerShell/CIM invocations.

    This issue is still present on OpenAI.Codex_26.623.9142.0 / bundle 4559.

    EDIT: do you test this code in prod only? Tragic.

  8. houyupeng commented on Jul 6, 2026

    @houyupeng

    Seeing the same pattern on Windows 11 with Codex Desktop.

    Local PowerShell event logs show short-lived powershell.exe ConsoleHost sessions around 2026-07-06 17:30:00-17:30:02 and 2026-07-06 22:20:04-22:20:12, running:

    Get-CimInstance Win32_Process and Win32_PerfFormattedData_PerfProc_Process, then ConvertTo-Json.

    A live sample showed the powershell.exe process parented by Codex.exe. User-visible impact includes black console flashes and intermittent mouse/keyboard stutter. This also matches #26613.

  9. XucroYuri commented on Jul 11, 2026

    @XucroYuri

    Confirmed on a newer Windows Desktop build with the same global WMI sampling command.

    Environment

    • Codex Desktop: 26.707.3748.0
    • Codex CLI: 0.144.1
    • OS: Windows 11 Pro for Workstations, build 26200, x64
    • CPU: Intel Core i5-9400F, 6 cores / 6 logical processors

    Captured process

    A live process-tree snapshot found a short-lived powershell.exe directly parented by the packaged Desktop ChatGPT.exe. Its command line contained the same sequence described in this issue:

    powershell.exe -NoProfile -NonInteractive -Command "$ErrorActionPreference = 'Stop'; $cpuByPid = @{}; Get-CimInstance Win32_PerfFormattedData_PerfProc_Process | ForEach-Object { ... }; Get-CimInstance Win32_Process -Filter \"ProcessId = ...\" | Select-Object ProcessId,ParentProcessId,CommandLine,WorkingSetSize,@{Name='CpuPercent';Expression={...}},@{Name='AgeSeconds';Expression={...}} | ConvertTo-Json -Depth 2"

    The filter listed a large set of Desktop, app-server, MCP, Node, renderer, and command-runner PIDs, while Win32_PerfFormattedData_PerfProc_Process was 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_ProcessStartTrace subscription 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 in 26.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

  10. CIVDX commented on Jul 17, 2026

    @CIVDX

    Additional confirmation from a newer Windows Desktop build, with ETW/WMI attribution and user-visible impact.

    Environment

    • Codex Desktop package: 26.707.12708.0
    • OS: Windows 11 x64
    • CPU: Intel Core i9-14900K (32 logical processors)

    Evidence

    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-Activity correlated 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:

    • WmiPerfInst servicing Win32_PerfFormattedData_PerfProc_Process
    • CIMWin32 servicing Win32_Process

    This matches the commands and Electron sampler path already documented in this issue. The installed 26.707.12708.0 bundle still contains the same Get-CimInstance Win32_Process and Get-CimInstance Win32_PerfFormattedData_PerfProc_Process polling implementation.

    The symptom is particularly misleading in Task Manager/Resource Monitor: individual WmiPrvSE.exe rows 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:

    • wastes CPU time and electrical energy while Codex is open;
    • increases heat and cooling/fan activity;
    • reduces responsiveness even on a high-end desktop CPU;
    • materially disrupts normal work and makes it impractical to leave Codex Desktop running.

    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.

  11. InfiniteLife commented on Jul 18, 2026

    @InfiniteLife

    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

    • With Codex Desktop open and idle, WmiPrvSE.exe remains active.
    • Fully closing Codex Desktop immediately returns WMI Provider Host CPU to normal.
    • Reopening Codex reproduces the load without starting an agent task.

    Live measurements

    Using Windows Process performance counters, the busy WmiPrvSE.exe instance 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 CIMWin32 in that host as the active provider:

    CIMWin32 ExecQueryAsync: +93 calls in 5 seconds (18.6/sec)
    CIMWin32 CreateInstanceEnumAsync: +2 calls in 5 seconds
    

    A six-second Msft_WmiProvider_ExecQueryAsyncEvent_Pre capture observed 120 queries. The dominant query occurred 86 times (about 14.3/sec):

    select __RELPATH, __PATH, ProcessId, CSName, Caption, SessionId,
           ThreadCount, WorkingSetSize, KernelModeTime, UserModeTime,
           ParentProcessId
    from Win32_Process

    There were also repeated per-PID ExecutablePath / CommandLine queries and large ProcessId = ... OR ProcessId = ... filters.

    Since boot, the WMI Operational log contained 893 Event 5858 client failures:

    579 x 0x80041032 (WBEM_E_CALL_CANCELLED)
    185 x 0x800706BA (Could not send status to client)
    

    The reported client PIDs belonged to short-lived processes and had exited by inspection time.

    Installed bundle correlation

    The current packaged app.asar still contains Windows process snapshot code that launches hidden powershell.exe and runs both:

    Get-CimInstance Win32_PerfFormattedData_PerfProc_Process
    Get-CimInstance Win32_Process

    It also constructs the same Get-CimInstance Win32_Process -Filter "ProcessId = ... OR ProcessId = ..." query shape recorded by WMI. The renderer contains a child-processes query configured with intervalMs: 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, WmiPrvSE quota 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.

  12. glzjin commented on Jul 18, 2026

    @glzjin

    Independent confirmation on the current Microsoft Store build, with a live process count and installed-package correlation.

    Environment

    • Codex Desktop MSIX: OpenAI.Codex_26.715.4045.0_x64
    • OS: Windows 11 x64
    • WSL was not involved

    Live impact and attribution

    During the affected state:

    • WmiPrvSE.exe reached 36.24% of total-machine CPU while total CPU was 83.97%.
    • The busy provider host was serving CIMWin32.
    • Over the preceding 10 minutes, Codex Desktop created 140 unique short-lived PowerShell processes:
      • 67 process-tree snapshots
      • 73 process-detail/performance snapshots
    • In one burst, 13 separate WMI clients issued the same broad Win32_Process query and failed in the same millisecond with RPC error 0x800706BE.
    • PowerShell engine logs contained the exact Get-CimInstance commands embedded in the installed Codex package, and the processes were direct children of the packaged Desktop ChatGPT.exe.

    Installed-package confirmation

    Read-only inspection of the installed app.asar shows:

    • the sampler manager schedules a focused heartbeat every 30 seconds;
    • non-heartbeat triggers are admitted every 5 seconds, including delta_burst, thread_started, turn_started, and turn_completed;
    • the Windows snapshot worker launches PowerShell for:
      • Get-CimInstance Win32_Process | Select-Object ProcessId,ParentProcessId
      • Get-CimInstance Win32_PerfFormattedData_PerfProc_Process
      • filtered Get-CimInstance Win32_Process detail queries;
    • child-process enrichment runs unconditionally in snapshot collection;
    • the rate gate only checks snapshot start timestamps: there is no in-flight/single-flight guard, coalescing, or WMI failure backoff. When WMI becomes slow, new snapshots can overlap and amplify the load;
    • disabling analytics does not disable this Windows process sampler.

    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.

  13. medaka123 commented on Jul 19, 2026

    @medaka123

    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

    • Product: Codex Desktop for Windows
    • Package version: OpenAI.Codex_26.715.3651.0_x64__2p2nqsd0c76g0
    • Executable: C:\Program Files\WindowsApps\OpenAI.Codex_26.715.3651.0_x64__2p2nqsd0c76g0\app\ChatGPT.exe
    • OS: Windows 11 x64
    • Date observed: 2026-07-19

    Actual behavior

    Two independent call paths launch PowerShell and query WMI/CIM:

    1. ChatGPT.exe -> electron-sampler -> child-process-snapshot-worker.js -> powershell.exe -> Get-CimInstance
    2. ChatGPT.exe -> BundledPluginsMarketplace plugin reconciliation / stop_chrome_native_host -> powershell.exe -> Get-CimInstance

    The queried classes include:

    • Win32_Process
    • Win32_PerfFormattedData_PerfProc_Process

    Inspection of the installed application package shows the sampler creates child-process-snapshot-worker.js, invokes powershell.exe -NoProfile -NonInteractive, and applies a fixed timeout = 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-sampler failure while querying Win32_Process
    • BundledPluginsMarketplace failure while querying Win32_PerfFormattedData_PerfProc_Process and Win32_Process
    • bundled_plugins_reconcile_started reason=focus
    • another sampler failure
    • another plugin WMI failure

    WMI Activity logs at the same timestamps show provider activity for CIMWin32, WmiPerfClass, and WmiPerfInst. Subsequent WMIBinaryMofResource activity under SYSTEM appears 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:

    • 4,670 ms
    • 4,269 ms
    • 4,446 ms

    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

    1. Start Codex Desktop on Windows.
    2. Monitor child processes, the Codex application log, and Microsoft-Windows-WMI-Activity/Operational.
    3. Observe hidden powershell.exe children running Get-CimInstance for Win32_Process and/or Win32_PerfFormattedData_PerfProc_Process.
    4. Switch away from Codex and focus the Codex window again.
    5. Observe 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

    • Codex should not repeatedly launch overlapping system-wide WMI process snapshots on startup or every focus event.
    • A valid query that takes slightly more than 5 seconds should not be treated as a persistent failure and immediately retried through another subsystem.
    • Process sampling should have bounded CPU cost and should expose enough diagnostics to distinguish timeout, cancellation, non-zero exit, and WMI/application errors.

    Suggested fixes

    1. Share one single-flight process snapshot between electron-sampler and bundled-plugin reconciliation instead of launching duplicate WMI work.
    2. Increase the timeout to at least 10 seconds, or make it configurable.
    3. Cache/debounce snapshots across startup and focus events.
    4. Query only the Codex descendant process tree instead of enumerating all system processes.
    5. Prefer native Windows process APIs over PowerShell/WMI for parent/child process discovery.
    6. Log whether the command timed out, was killed/cancelled, exited non-zero, or returned WMI/protocol errors.
    7. Provide a supported setting to disable the sampler as a mitigation.

    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

    • Redacted Codex Desktop log excerpts with matching timestamps
    • WMI Activity event timestamps and provider names
    • CSV containing the per-query timing measurements
    • Exact redacted PowerShell command shape and exit/timing results

    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)

    • App log: %LOCALAPPDATA%\Packages\OpenAI.Codex_2p2nqsd0c76g0\LocalCache\Local\Codex\Logs\2026\07\19\...log
    • Timing CSV: codex_diagnostics\current-wmi-latency-20260719.csv
  14. 8 remaining items

  15. huanxxxx commented on Jul 31, 2026

    @huanxxxx

    Additional reproduction data from a newer Windows Codex Desktop build.

    Environment:

    • Windows 11 Pro, 64-bit, version 10.0.26200, build 26200
    • Codex Desktop MSIX package: OpenAI.Codex_26.721.11231.0_x64__2p2nqsd0c76g0
    • Main desktop process: packaged ChatGPT.exe
    • Bundled Chromium observed in process annotations: 150.0.7871.128
    • Codex app-server child command:
      ...\app\resources\codex.exe -c features.code_mode_host=true app-server --analytics-default-enabled
    • Host Node/npm also installed: node v24.14.0, npm 11.9.0

    User-visible symptoms:

    • A visible black console window flashes every few seconds while Codex Desktop is open.
    • Normal PC use becomes degraded: typing/rendering stutters and Task Manager shows very high memory pressure.
    • A reboot temporarily clears the symptom only until Codex Desktop is opened again.

    Observed over several diagnostic windows:

    1. Initial real-time process-start tracing showed the visible console was conhost.exe, launched under short-lived PowerShell children owned by Codex Desktop:

      explorer.exe -> ChatGPT.exe -> powershell.exe -> conhost.exe

    2. In a corrected 15-second Win32_ProcessStartTrace capture, there were 14 powershell.exe launches directly from ChatGPT.exe, and each had a conhost.exe child.

    3. The sampled PowerShell command repeatedly queried full-machine process/performance data:

      • Get-CimInstance Win32_Process
      • Get-CimInstance Win32_PerfFormattedData_PerfProc_Process
      • ConvertTo-Json
    4. Historical PowerShell/event-log evidence from one affected hour showed 863 matching PowerShell starts.

    5. After a clean Windows reboot on 2026-07-31, reopening Codex Desktop reproduced the loop. Before the diagnostic capture started, 53 matching PowerShell starts were already present within about three minutes. A representative post-reboot live chain was:

      ChatGPT.exe -> powershell.exe -> conhost.exe

    6. During a later affected period, memory pressure was visible at the OS level rather than just inside foreground apps:

      • Task Manager showed roughly 90% memory in use.
      • Windows memory counters showed active paging under pressure, e.g. available memory around 2.8-2.9 GiB with Pages/sec around 121-180 and Page Reads/sec around 79-93.
      • This later relaxed after the process storm subsided; a later snapshot showed available memory around 3.7 GiB and low paging.
    7. A separate short-lived node.exe burst was also observed. This was not the persistent small node_repl.exe helper. 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.exe

      A 30-second high-frequency capture around 09:46:59-09:47:03 caught many transient node.exe processes. PowerShellCore event ID 4104 logs confirmed repeated execution of the standard C:\Program Files\nodejs\npm.ps1 wrapper at 09:46:58, 09:47:16, 09:48:10, and 09:50:59 local time. A later 45-second polling window caught no live node.exe, which suggests these processes are very short-lived and bursty.

    Working interpretation:

    • The PowerShell/visible-console behavior is still reproducible on 26.721.11231.0.
    • The visible black window is a conhost.exe child of Codex-owned PowerShell process polling.
    • The new node.exe observation appears to be a separate Codex command-runner path invoking host npm through PowerShell (npm.ps1), not the normal persistent node_repl.exe helpers.
    • I cannot prove from source whether both behaviors share the same internal trigger, but from live parent chains both are owned by the Codex Desktop process tree.

    Expected behavior:

    • Codex Desktop should not repeatedly spawn visible console windows for process polling.
    • Process polling/cleanup should be throttled, non-overlapping, scoped, and non-visible.
    • Short-lived command-runner/npm/node subprocess bursts should not create enough OS-level memory/paging pressure to degrade the Windows desktop.

    Privacy note:

    • I intentionally omitted the Windows username, workspace names, conversation contents, raw Codex databases, and full private paths. I can provide sanitized traces if maintainers need a narrower artifact.
  16. mading0817 commented on Jul 31, 2026

    @mading0817

    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.0 on Windows repeatedly creates short-lived
    PowerShell, conhost, Git, and taskkill processes. ETW process ancestry and
    read-only inspection of the installed app.asar point to a feedback-heavy
    interaction between:

    1. Windows child-process discovery implemented through PowerShell and WMI;
    2. chat-process PID reconciliation with multiple retries;
    3. automatic Git repository/origin/status discovery; and
    4. Windows process-tree cleanup implemented through 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

    • Codex Desktop: 26.721.11231.0
    • Package: OpenAI.Codex_26.721.11231.0_x64__2p2nqsd0c76g0
    • app.asar SHA-256:
      23A8F5D1645247BD942304DC586C44B8CE63C2E3FC408198F815657731070DB5
    • Chromium: 150.0.7871.128
    • Windows 11 Home, Simplified Chinese, build 26200
    • CPU: AMD Ryzen 9 9955HX
    • RAM: 64 GB
    • GPU: NVIDIA GeForce RTX 5060 Laptop GPU + AMD Radeon 610M
    • Displays: 2560×1600 at 165 Hz and 2560×1440 at 143 Hz

    Reproduction

    1. Start Codex Desktop and use a local Git-backed task.
    2. Keep Codex active for a while.
    3. Observe intermittent or sustained system-wide input/UI stutter.
    4. Capture process starts with ETW/WPR or sample the process table at high
      frequency.
    5. Observe repeated PowerShell/conhost and Git/taskkill process families whose
      ancestor is the Codex Desktop main process.

    Local evidence

    1. High-frequency process sampling

    In a 30-second sample:

    • 38 new powershell.exe
    • 42 new conhost.exe

    The dominant PowerShell parent was the Codex Desktop main ChatGPT.exe
    process.

    Observed command lines include:

    powershell.exe -NoProfile -NonInteractive -Command "$ErrorActionPreference = 'Stop'; Get-CimInstance Win32_Process | Select-Object ProcessId,ParentProcessId | ConvertTo-Json -Depth 2"
    

    and:

    Get-CimInstance Win32_PerfFormattedData_PerfProc_Process
    Get-CimInstance Win32_Process
    

    2. ETW process ancestry

    In an approximately 33-second effective WPR pool trace:

    • 73 git.exe processes in total
    • 68 conhost.exe processes in total
    • 31 taskkill.exe processes in total
    • 31 git.exe processes directly parented by Codex Desktop ChatGPT.exe
    • 30 taskkill.exe processes directly parented by Codex Desktop
    • 5 PowerShell processes directly parented by Codex Desktop
    • 4 Git processes directly parented by the bundled codex.exe app-server

    The taskkill.exe commands were:

    C:\Windows\System32\taskkill.exe /pid <git-pid> /t /f
    

    The Git command families included:

    • git config --get core.fsmonitor
    • git rev-parse
    • git remote
    • git status --porcelain
    • git for-each-ref
    • git diff
    • git update-ref

    3. WMI cost and failed-client evidence

    Eight direct timing runs gave:

    • Win32_Process: average about 174 ms, maximum about 258 ms
    • Win32_PerfFormattedData_PerfProc_Process: average about 471 ms,
      maximum about 489 ms

    Recycling all WmiPrvSE.exe provider hosts did not improve those timings while
    Codex 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 not
    send status to client”).

    4. Installed-code inspection

    Read-only string and byte-offset inspection of:

    C:\Program Files\WindowsApps\OpenAI.Codex_26.721.11231.0_x64__2p2nqsd0c76g0\app\resources\app.asar
    

    confirmed the following production code paths:

    • child-process-snapshot-worker.js
    • Get-CimInstance Win32_Process
    • Get-CimInstance Win32_PerfFormattedData_PerfProc_Process
    • listProcessSubtrees
    • listDetachedProcessCandidates
    • git-origins
    • core.fsmonitor
    • taskkill.exe

    The Windows process snapshot implementation launches
    powershell.exe -NoProfile -NonInteractive. Its detailed snapshot first
    enumerates all Win32_PerfFormattedData_PerfProc_Process instances and then
    queries Win32_Process.

    The chat-process registry attempts OS-PID reconciliation by calling
    listProcessSubtrees with retry delays:

    0 ms, 100 ms, 300 ms, 600 ms
    

    If no PID is matched after those attempts, it calls
    listDetachedProcessCandidates, which performs another Windows process
    enumeration.

    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's
    kill implementation invokes:

    taskkill.exe /pid <pid> /t /f
    

    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 trace
    • SeAt: 81,274 allocations, about 7.16 MB allocated during the trace
    • SeTd: 11,835 allocations, about 1.55 MB allocated during the trace

    Most 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

    • Free RAM remained about 48 GB; commit was about 14%.
    • Disk busy time peaked at only about 8.3% in the general ETW trace.
    • DPC and ISR durations remained sub-millisecond; no storage, USB, network, or
      display-driver DPC pathology was present.
    • No WHEA, disk, display, or resource-exhaustion event explained the stalls.
    • Only standard Microsoft filesystem minifilters were loaded.
    • Stopping ASUSOptimization for a controlled interval did not change the
      stutter; the service was restored immediately afterward.
    • Recycling WmiPrvSE.exe while Codex continued generating scans did not
      change WMI latency.
    • A large Codex window on the 165 Hz high-DPI display independently increases
      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
    taskkill process trees. Exiting Codex should terminate every Desktop-owned
    background process and promptly stop all related churn.

    Suggested product fixes

    1. Replace PowerShell/WMI full-table polling with event-driven child-process
      tracking or a persistent native helper.
    2. Deduplicate concurrent process snapshots and cache one snapshot for all PID
      reconciliation operations within a bounded interval.
    3. Do not enumerate the entire
      Win32_PerfFormattedData_PerfProc_Process class when only a small PID set is
      requested.
    4. Coalesce upsert/complete reconciliation and avoid retrying short-lived
      commands that have already exited.
    5. Bound and deduplicate Git-origin/status discovery.
    6. Avoid unconditional taskkill /t /f for Git commands that have already
      exited normally.
    7. Add a supported feature flag to disable Windows child-process telemetry and
      automatic repository discovery until the native implementation is fixed.
    8. Ensure “Quit” results in zero Desktop-owned ChatGPT.exe, bundled
      codex.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.exe provider hosts. A local recovery script is included at:

    codex\tools\recover-codex-desktop-no-reboot.ps1
    

    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

  17. chess-oai commented on Aug 5, 2026

    @chess-oai
    Contributor

    thanks for the detailed reports and investigation here: they were really helpful 💖

    • we’ve shipped fixes in 26.730.7989.0 that address some major sources of powershell/wmi storms
    • taskkill.exe can still be started by other process-cleanup paths, and we’re continuing to work on reducing that separately

    if you’re still seeing sustained wmi cpu usage or system-wide lag after 26.730.7989.0, please share an updated /feedback id

  18. mading0817 commented on Aug 5, 2026

    @mading0817

    thanks for the detailed reports and investigation here: they were really helpful 💖

    • we’ve shipped fixes in 26.730.7989.0 that address some major sources of powershell/wmi storms
    • taskkill.exe can still be started by other process-cleanup paths, and we’re continuing to work on reducing that separately

    if you’re still seeing sustained wmi cpu usage or system-wide lag after 26.730.7989.0, please share an updated /feedback id

    thats really cost me a lot to find the problems, maybe a banked reset as a reward? hahahaha

  19. ParikshithMohan commented on Aug 8, 2026

    @ParikshithMohan

    I am reproducing this on the current Microsoft Store Codex Desktop package 26.803.5235.0 x64 on Windows 11.

    Symptoms:

    • Codex Desktop remains at high CPU even after a task has finished and the UI appears idle.
    • If it starts in a low-CPU idle state, simply moving the mouse over/within the app causes CPU to ramp up again.
    • The whole computer becomes laggy; this is not limited to the Codex window.
    • Restarting Codex does not clear the issue. Opening ChatGPT Classic alongside Codex makes the overall pressure worse, but the high CPU is attributable primarily to the Codex Desktop process tree.
    • Task Manager samples showed the Codex group around 35–50% total CPU while “idle,” and around 50% with an active task. The largest consumers were codex.exe app-server and multiple ChatGPT.exe renderer 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.

  20. DukeTwoCan commented on Aug 13, 2026

    @DukeTwoCan

    On Windows 11 Pro, I updated my copy of the desktop app to 26.803.10989.0 and 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.

  21. SolidStone85 commented on Aug 15, 2026

    @SolidStone85

    Still reproducible on the current Microsoft Store package OpenAI.Codex 26.810.6296.0, Windows x64 build 26200.

    Observed behavior:

    • With Codex Desktop open and no user-initiated task running, the machine becomes noticeably laggy, including general input and application responsiveness.
    • Fully quitting Codex immediately restores normal responsiveness.
    • Restarting after the latest update did not resolve it.
    • A brief local process sample during a lightweight diagnostic found the main ChatGPT.exe process belonging to the OpenAI.Codex package 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.

  22. zihangli-hndsm commented on Nov 9, 2026

    @zihangli-hndsm

    Additional Windows observation (November 9, 2026): The user reports bursts of dozens of GitHub CLI processes under Codex Desktop even when no work appears active, followed by high WMI Provider Host CPU and significant system lag. In a short diagnostic sample after known development jobs were paused, seven new gh.exe processes appeared within one second without a gh invocation from the diagnostic session. Separately, the Windows WMI Activity Operational log recorded 12 Event ID 5858 entries in under two seconds, from multiple client PIDs, for the same Win32_Process enumeration with result 0x80041032. The initially sampled GitHub CLI (2.97.0) and WMI Provider Host executables had valid publisher signatures. We did not capture process parentage or establish that the CLI burst caused the WMI activity. Could you check whether idle GitHub integration refreshes or process discovery/cleanup can produce these bursts?

  23. culveyhouse commented on Nov 9, 2026

    @culveyhouse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugperformancewindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions