Repository navigation
Open
Labels
CLIIssues related to the Codex CLIIssues related to the Codex CLIbugSomething isn't workingSomething isn't workingexecIssues related to the `codex exec` subcommandIssues related to the `codex exec` subcommandperformancewindows-osIssues related to Codex on Windows systemsIssues related to Codex on Windows systems
Description
Environment
- codex CLI
0.148.0-alpha.9(Windows) - Windows 10 Pro 22H2, build 19045.6456
- Session type: RDP — the leak accumulates in the RDP session's
dwm.exe; other sessions' dwm instances stay flat - GPU: NVIDIA discrete GPU + Microsoft Remote Display Adapter
Setup
- An automation script launches up to 10
codex exec --ephemeral --json --output-schema ...workers withCREATE_NO_WINDOWand below-normal priority. - Each worker runs a long (~25 min) batch that makes heavy use of the built-in image/vision tool and periodically executes PowerShell commands; on
0.148.0-alpha.9each command spawnscodex-command-runner/ sandbox helper /conhostprocesses.
Symptom
- While the worker fleet is active, the session's
dwm.exehandle count grows steadily at +80–160 handles/min (working set ~+1.2 MB/min). - After a few hours: 20,000+ handles, 500+ MB working set, DWM CPU ~17%, and a visible session-wide slowdown.
- Growth stops when the fleet is idle. A session re-login resets dwm and the cycle repeats.
Investigation
- A
SetWinEventHook(EVENT_OBJECT_SHOW)trace shows ~40–70 transient top-level windows per minute being shown and destroyed within <20 ms while workers are active. dwm handle steps of +2 correlate 1:1 with these SHOW events (46/47 and 64/82 steps within 0–300 ms in separate runs). - The windows die before out-of-context hook delivery, so
GetWindowThreadProcessId/OpenThreadboth fail at that point. Cross-referencing the event thread IDs against whole-system thread snapshots taken every 0.5 s attributes all of them (52/52 in a 45 s window) to the session'scsrss.exe— i.e. they appear to be OS-side (ghost-window-like) machinery triggered by the workload, not windows created by codex directly. - Controlled experiments: mass-spawning hidden console processes (
cmd/powershellwithCREATE_NO_WINDOW, 20–40 each) leaks ≈0 dwm handles per process, so plain conhost churn is not sufficient to reproduce. Suspending cloud-sync/screenshot utilities for 45 s each does not stop the leak; stopping the codex fleet does. - Reducing per-batch shell command count on our side cut process churn from ~86 to ~18 processes/min, but the leak persisted at ~+94–149/min while batches were active — the trigger seems tied to worker activity itself (vision/API loop), not only process spawns.
Possibly related
- [Windows][Desktop 26.707.12708.0] ChatGPT.exe spawns hundreds of taskkill.exe/conhost.exe processes, causing WMI storms and DWM degradation #33776 (DWM handle growth / conhost accumulation with codex on Windows 10 22H2)
Ask
Any insight into what in the exec worker loop could trigger csrss transient-window creation in Win10 RDP sessions (e.g. an unpumped hidden window tripping the hung-window ghosting path)? A CLI-level fix or workaround would remove the need for periodic session re-logins.
Workarounds we currently use
- Fewer shell commands per batch (prompt-side batching)
- Scratch/temp files moved off cloud-synced folders (removes an unrelated second trigger)
- Periodic RDP session re-login to reclaim dwm handles
Metadata
Metadata
Assignees
Labels
CLIIssues related to the Codex CLIIssues related to the Codex CLIbugSomething isn't workingSomething isn't workingexecIssues related to the `codex exec` subcommandIssues related to the `codex exec` subcommandperformancewindows-osIssues related to Codex on Windows systemsIssues related to Codex on Windows systems
Activity
github-actions commentedon Aug 16, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
chess-oai commentedon Aug 28, 2026
ChatGPT v26.825.32147 includes a fix for one cause of Windows stuttering and slowdowns during long sessions. Sandboxed commands could cause Desktop Window Manager (
dwm.exe) resources to accumulate. The fix reuses private Windows desktops for commands with the same permissions.Please update to ChatGPT v26.825.32147 or later, restart the app, and let us know whether this helps.
If the problem continues after updating, please share your version and steps to reproduce.
Thank you for your reports and investigation!