Codex Windows Mouse Lag but No taskkill Storm? Check WMI

Codex Windows Mouse Lag but No taskkill Storm? Check WMI

Aident AI

Amber motion trails stutter through a graphite barrier between a cobalt disk and two coral rings.

Codex Windows Mouse Lag but No taskkill Storm? Check WMI

If Codex Desktop makes the mouse, typing, and other Windows apps stutter but taskkill.exe is not accumulating, check for repeated PowerShell and WMI process snapshots. Current reports describe a pre-storm pattern in which Codex repeatedly queries Win32_Process and Win32_PerfFormattedData_PerfProc_Process, sometimes around once per second. Fully exit Codex, update the app, reproduce with one short task, and compare a quiet process baseline with the affected run. Do not patch app.asar, disable WMI, kill WmiPrvSE.exe, or copy a version-specific launcher from a forum.

Start in an external PowerShell window, not inside the lagging Codex task:

$tracked = 'ChatGPT', 'Codex', 'codex', 'powershell', 'pwsh', 'git', 'conhost', 'taskkill', 'WmiPrvSE'

Get-Process -Name $tracked -ErrorAction SilentlyContinue |
  Group-Object ProcessName |
  Sort-Object Count -Descending |
  Select-Object Count, Name

Expected result: one read-only snapshot of the relevant process counts. A few Electron, console-host, or PowerShell processes can be normal. The useful signal is a repeatable burst tied to Codex opening, switching tasks, or running a command.

Match the Exact Failure Pattern

This guide applies when several signals appear together:

  • mouse movement or typing stalls across Windows, not only inside Codex;

  • lag begins after Codex opens or gets worse while a task runs;

  • short-lived powershell.exe or conhost.exe processes keep appearing;

  • WMI Provider Host becomes active or WMI Activity event 5858 names Win32_Process or Win32_PerfFormattedData_PerfProc_Process;

  • taskkill.exe stays at zero or does not grow into a backlog; and

  • closing Codex stops new bursts, even if Windows takes a few seconds to recover.

Use a different diagnosis when hundreds of taskkill.exe and conhost.exe processes accumulate. That is the later cleanup-storm pattern covered by Fix Codex Windows High CPU: taskkill.exe and WMI. If LSASS handles or Windows logon sessions grow during sandboxed commands, use the resource-leak branch in the Codex Windows sandbox error guide.

Current public reports do not establish one universal cause for every Codex input-lag incident. Other reported branches include Git review process bursts, long conversation rendering, browser or GPU crashes, USB/HID discovery, oversized local state, and workspace disk pressure. Diagnose the observed process path before choosing a workaround.

Prerequisites

Before testing:

  1. Save open work and stop any Codex task whose output you need.

  2. Record the desktop app version from Settings > About and the Windows build from winver.

  3. Close unrelated terminals, IDE agents, and automation that could create PowerShell or Git processes.

  4. Use a short disposable or clean repository for the control run.

  5. Keep the test to one Codex task and one minute. Do not stress an already unstable machine.

Record the installed Store package when available:

Get-AppxPackage '*Codex*', '*ChatGPT*' |
  Select-Object Name, Version, Status, InstallLocation

Expected result: the package name, version, status, and install location are captured for the report. If both old and new packages appear, also record which executable Task Manager shows during the reproduction.

Step 1: Take a Quiet 30-Second Baseline

Fully quit Codex from the app or system tray. Wait ten seconds, then run:

$tracked = 'ChatGPT', 'Codex', 'codex', 'powershell', 'pwsh', 'git', 'conhost', 'taskkill', 'WmiPrvSE'

$samples = 1..30 | ForEach-Object {
  $capturedAt = Get-Date
  Get-Process -Name $tracked -ErrorAction SilentlyContinue |
    Group-Object ProcessName |
    ForEach-Object {
      [pscustomobject]@{
        CapturedAt = $capturedAt
        Name = $_.Name
        Count = $_.Count
      }
    }
  Start-Sleep -Seconds 1
}

$samples |
  Group-Object Name |
  ForEach-Object {
    [pscustomobject]@{
      Name = $_.Name
      Minimum = ($_.Group.Count | Measure-Object -Minimum).Minimum
      Maximum = ($_.Group.Count | Measure-Object -Maximum).Maximum
    }
  } |
  Sort-Object Name

Expected result: a quiet range for each process name. The PowerShell window running the sampler counts toward the baseline, so compare the change between runs rather than treating one process as suspicious.

Step 2: Reproduce Once With One Short Task

Open Codex and a clean repository. Start one new task with a bounded instruction such as:

Run one read-only command that prints the current directory, report the result, and stop

While the task runs, repeat the same 30-second sampler from the external PowerShell window.

Expected result on a healthy build: any helper processes exit quickly and the counts return to the quiet range. A repeating increase in powershell, conhost, or WmiPrvSE that aligns with visible input stalls supports the process-snapshot branch. A rising taskkill count means you should stop and use the cleanup-storm guide instead.

Do not run ten parallel tasks to make the signal louder. One issue report measured roughly 1.2 to 1.3 short-lived PowerShell children per second, while another found much larger descendant bursts after older tasks accumulated. Those are observations from specific builds and machines, not a safe target or universal rate.

Step 3: Check WMI Activity Errors Once

Windows records WMI provider failures in the WMI Activity operational log. Query only the bounded test window:

$startedAt = (Get-Date).AddMinutes(-10)

Get-WinEvent -FilterHashtable @{
  LogName = 'Microsoft-Windows-WMI-Activity/Operational'
  Id = 5858
  StartTime = $startedAt
} -ErrorAction Stop |
  Where-Object {
    $_.Message -match 'Win32_Process|Win32_PerfFormattedData_PerfProc_Process'
  } |
  Select-Object TimeCreated, Id, LevelDisplayName, Message

Expected result: matching event timestamps can be compared with the lag window. One August 3 report captured event 5858 about three seconds after Codex logged a failed child-process snapshot. No matching event does not rule out successful WMI polling, because event 5858 records a failure path rather than every query.

Do not run Get-CimInstance Win32_Process in a tight loop while diagnosing WMI pressure. The diagnostic query itself uses WMI and can add noise.

Step 4: Separate the Main Windows Lag Branches

Use the smallest matching branch:

Evidence during one bounded run

Likely branch

Next action

Repeated PowerShell plus WMI 5858, no taskkill backlog

Process-snapshot polling

Update, retest once, preserve the event window

Hundreds of taskkill.exe and conhost.exe children

Cleanup storm

Fully exit Codex and use the taskkill/WMI guide

Rising LSASS handles or logon sessions after sandbox work

Sandbox resource leak

Stop the workload and use the LSASS guide

Repeated git.exe children, especially while switching tasks

Repository review or state scan

Test a small repository and one completed-task archive control

0xc06d007f, node-hid, or serialport evidence

Native device or optional hardware path

Update and report the exact module evidence; do not inject code

High disk use with a large workspace but few helper processes

Workspace enumeration or local state

Test an empty repository and measure the disk boundary

Lag only when opening one long conversation

Rendering or history load

Open a fresh task and preserve the slow task for a report

Expected result: the problem is assigned to one observed branch before any configuration is changed. Multiple branches can coexist, but one process count should not be used to prove all of them.

Step 5: Update and Retest the Same Control

Install the latest Codex or ChatGPT desktop app through its normal update path or Microsoft Store. Reboot only if Windows or the installer requests it, then verify the version again.

Repeat the quiet baseline and the same one-command task. Keep the repository, prompt, and sampling window unchanged.

Expected result: the updated build stays near the quiet process range and input remains responsive. Issue 36025 reported the WMI snapshot failure on Microsoft Store builds through August 3, including build 26.727.6591.0, so an update is a required check rather than proof that the current regression is fixed.

Step 6: Contain the Lag Without Patching the App

If the exact updated build still reproduces:

  1. Stop the current Codex task normally.

  2. Fully quit the desktop app and confirm its process group exits.

  3. Save the before-and-after counts, event timestamps, package version, and one short reproduction.

  4. Use the Codex CLI or VS Code extension for bounded work if that surface does not reproduce on your machine.

  5. Keep parallel tasks paused until the desktop control stays responsive.

  6. Add the sanitized evidence to the closest existing Codex issue instead of opening a vague duplicate.

Expected result: no new helper bursts are created while the desktop app is closed, and work can continue through a tested surface. Switching surfaces is containment, not a claim that the desktop bug is fixed.

Do not edit or repack the signed Store application, patch app.asar, inject a module stub, disable Windows Management Instrumentation, terminate WmiPrvSE.exe, or restart Desktop Window Manager. Social posts describe version-specific interventions, but they do not establish a safe general fix and can hide the evidence maintainers need.

Step 7: Capture a Short WPR Trace Only When Needed

If the lightweight checks are inconclusive and support asks for a trace, Windows Performance Recorder can capture a bounded CPU and process timeline. Run an elevated PowerShell window:

wpr -status

If no recording is already active:

wpr -start CPU.light
# Reproduce the lag once for 30 to 60 seconds.
wpr -stop "$env:USERPROFILE\Desktop\codex-input-lag.etl" "Codex input lag reproduction"

Expected result: one ETL file on the desktop. Do not start a second WPR session when another recording is active. Review the trace-sharing policy first because ETL files can expose process names, paths, timing, and other local metadata.

Microsoft documents that WPR memory mode is bounded by its recording buffers, while file mode can grow until it fills the disk. The commands above intentionally avoid -filemode for a short reproduction.

Common Failure Modes

Mistake

Why it misleads or increases risk

Safer response

Calling every Codex slowdown a WMI bug

Rendering, disk, Git, HID, and sandbox failures can look similar

Match the process and event evidence first

Treating one WmiPrvSE.exe process as proof

WMI Provider Host is a normal Windows component

Compare quiet and affected windows

Repeatedly querying Win32_Process

The diagnostic adds WMI work

Use one event query and a bounded process sampler

Killing every conhost.exe or WmiPrvSE.exe

Other applications and Windows services may own them

Fully quit Codex or restart Windows if unstable

Patching a copied app package

The workaround is version-specific and bypasses the supported update path

Preserve evidence and use another tested surface

Running many tasks to reproduce faster

Concurrency can amplify a separate cleanup or sandbox problem

Use one task for 30 to 60 seconds

Uploading a raw ETL or log database

It may contain private paths and project metadata

Sanitize and share only what maintainers request

Why This Diagnostic Works

The mouse-lag symptom is broad, but the process boundary is measurable. A quiet baseline shows ordinary Windows and PowerShell activity. The one-task control tests whether Codex adds recurring helpers at the same timestamps as the stalls. Event 5858 can then corroborate a failed WMI snapshot without turning the diagnostic into another WMI polling loop.

This follows the useful structure behind Aident's Ollama networking guide: use the exact problem wording, answer early, test one boundary, state the expected result, and separate neighboring failure modes.

Verify One Hosted Action With Codex Desktop Closed

If the desktop app is under containment, Aident Loadout can execute an integration Action without reopening the Codex desktop process tree. Use the installed public aident CLI in a normal terminal:

aident account auth status
aident vault vault --action status

$action = 'composio:github_tools:github_search_github_graphql'
$inputObject = @{
  query = 'repo:openai/codex is:issue "WMI" "Windows"'
  type = 'ISSUE'
  first = 5
}
$inputJson = $inputObject | ConvertTo-Json -Compress

aident capabilities get $action
aident capabilities preflight $action --input $inputJson
aident capabilities execute $action --input $inputJson

Expected result: authentication and Vault status pass, the current Action schema is inspected, preflight accepts the bounded read-only query, and up to five issue records return while Codex Desktop remains closed. No provider credential should be copied into the prompt and no repository file should change.

Use Aident Loadout to complete that one hosted read-only Action. Measure success as one verified result, zero local desktop helper bursts, and a clean repository diff.

Sources

Refresh this guide when Codex changes desktop process discovery, WMI sampling, Git review scans, optional device discovery, task cleanup, or the Windows app update path.

Home

Home

Home

Integrations

Integrations

Integrations

Vault

Vault

Vault

Audit

Audit

Audit

Arana Grande

Arana Grande

Arana Grande

Free

Free

Free

30-day audit summary

30-day audit summary

30-day audit summary

Daily action-call volume and the latest receipts from the Loadout audit trail.

Daily action-call volume and the latest receipts from the Loadout audit trail.

Daily action-call volume and the latest receipts from the Loadout audit trail.

View Audit

View Audit

View Audit

Loadout usage

Loadout usage

Loadout usage

617 action calls in the last 30 days

617 action calls in the last 30 days

617 action calls in the last 30 days

May 19 - Jun 17

May 19 - Jun 17

May 19 - Jun 17

10 active days

10 active days

10 active days

Less

Less

Less

More

More

More

Recent activity

Recent activity

Recent activity

Latest action-call receipts from connected agents

Latest action-call receipts from connected agents

Latest action-call receipts from connected agents

Apr 23, 09:23 AM

Apr 23, 09:23 AM

Apr 23, 09:23 AM

Shopify

Shopify

Shopify

Creates Or Updates An Asset For A Theme

Creates Or Updates An Asset For A Theme

Creates Or Updates An Asset For A Theme

Success

Success

Success

Apr 23, 09:21 AM

Apr 23, 09:21 AM

Apr 23, 09:21 AM

Shopify

Shopify

Shopify

Update Products Param Product Id

Update Products Param Product Id

Update Products Param Product Id

Success

Success

Success

Apr 23, 08:53 AM

Apr 23, 08:53 AM

Apr 23, 08:53 AM

Shopify

Shopify

Shopify

Update Products Param Product Id

Update Products Param Product Id

Update Products Param Product Id

Failed

Failed

Failed

Apr 22, 22:13 PM

Apr 22, 22:13 PM

Apr 22, 22:13 PM

Shopify

Shopify

Shopify

Create Product Image

Create Product Image

Create Product Image

Success

Success

Success

Apr 22, 22:12 PM

Apr 22, 22:12 PM

Apr 22, 22:12 PM

Shopify

Shopify

Shopify

Create Product Image

Create Product Image

Create Product Image

Success

Success

Success

Connected integration coverage

Connected integration coverage

Connected integration coverage

162

162

162

of 753 accessible connected

of 753 accessible connected

of 753 accessible connected

Callable actions

Callable actions

Callable actions

1,126

1,126

1,126

Vault credentials

Vault credentials

Vault credentials

8

8

8

Explore what's possible

Explore what's possible

Explore what's possible

See all Integrations

See all Integrations

See all Integrations

Google Ads

Google Ads

Google Ads

All available Goolge Ads tools via...

All available Goolge Ads tools via...

All available Goolge Ads tools via...

X (twitter)

X (twitter)

X (twitter)

All available X tools via...

All available X tools via...

All available X tools via...

Github

Github

Github

All available Github tools via...

All available Github tools via...

All available Github tools via...

Notion

Notion

Notion

All available Notion tools via...

All available Notion tools via...

All available Notion tools via...

Slack

Slack

Slack

All available Slack tools via...

All available Slack tools via...

All available Slack tools via...

Firecrawl

Firecrawl

Firecrawl

All available Firecrawl tools via...

All available Firecrawl tools via...

All available Firecrawl tools via...

753 integrations are available for loadouts.

753 integrations are available for loadouts.

753 integrations are available for loadouts.

Plug your entire stack into your AI agents.

Plug your entire stack into your AI agents.

Plug your entire stack into your AI agents.

Skip the integration headache. Plug 750+ tools into Claude Code, Codex, and OpenClaw in one go, and let your agents execute today.

Skip the integration headache. Plug 750+ tools into Claude Code, Codex, and OpenClaw in one go, and let your agents execute today.