Codex Desktop on Windows leaks orphan git.exe + conhost.exe via ambient commit-history (200+ zombies over 30h, kills Chromium browsers)
Codex Desktop version: 26.506.3741.0 (MSIX from Microsoft Store)
Platform: Windows 11 Pro 26200, AMD Ryzen 7 6800H, 32 GB RAM
Codex CLI version: N/A — this is the Desktop app
Summary
When default-commit-history for any workspace is set to accepted (i.e., the user accepted the Ambient Suggestions / Commit History consent prompt), Codex Desktop runs a background snapshot loop that invokes git add -u + git write-tree every few tens of seconds. On Windows, each invocation leaks one orphan git.exe + one orphan conhost.exe (parent process exits before the child finishes cleanup, so the children become orphans with no parent and never get reaped).
Over ~30 hours of normal use, this accumulated 221 orphan git.exe + 235 orphan conhost.exe in my session, consuming ~28,000 handles (11% of total system handles) and ~456 PIDs (55% of total processes).
Impact
System-wide handle / process pressure caused Chromium-based browsers (Chrome and Edge, including Edge Guest mode) to fail CreateProcess for utility/renderer subprocesses and exit their entire process tree silently — simultaneous crash of both browsers. No user-mode crash dumps are generated because the browsers exit cleanly (CreateProcess returns failure, top-level process self-terminates). SFC/DISM clean. AMD driver reinstall did nothing.
Repro
- Open Codex Desktop on Windows 11.
- Open any workspace that is a git repository.
- When Codex prompts about Ambient Suggestions / Commit History, click Accept.
- Leave Codex Desktop running for several hours.
Get-Process git, conhost | Group-Object Name | Select Count, Namewill show hundreds of accumulated processes.Get-CimInstance Win32_Process -Filter "Name='git.exe'"shows all of them have CommandLine =git write-treeorgit add -u, withParentProcessIdpointing to a dead PID (orphans).- Eventually open Chrome and Edge — both will crash simultaneously.
State file evidence
%USERPROFILE%\.codex\.codex-global-state.json contains:
"ambient-suggestions:default-statuses": {
"ambient-suggestions:default-statuses:local:F:\\<workspace>": {
"default-commit-history": "accepted"
}
}
Changing "accepted" → "dismissed" only hides the UI suggestions but does NOT stop the background snapshot loop — the leak continues after Codex restart.
Expected behavior
- Either don't spawn the snapshot worker as fire-and-forget on Windows, OR
- Ensure child
git.exeis reaped (close pipe handles before exiting the worker), OR - Respect the
dismissedstate to actually stop background git invocations.
Workaround in use
Scheduled task that kills orphan git.exe / conhost.exe every 3 minutes. Functional but should not be required.
2 Comments
I'm also seeing this on Windows 10 with Codex Desktop and a local Unity Git repository.
After opening the project, memory usage steadily increases until the system is nearly out of RAM.
Findings
This doesn't appear to be a typical process memory leak.
Get-Processonly shows ~220 active processes using a few GB of RAM.The most interesting finding is that RAMMap's Processes tab contains thousands of terminated
git.exeentries (roughly 17–18 MB each).These entries:
Get-Process.Get-CimInstance Win32_Process.This suggests the
git.exeprocesses have exited, but their process objects/page table allocations are not being released.This is easily reproducible on my machine:
This appears to be related to #22756, but I wanted to share the additional diagnostics in case they help narrow down the root cause.
The orphaned
git.exe/conhost.exeaccumulation reported here closely matches the downstream process churn I observed.I published a single-file Windows launcher for the original Microsoft Store/MSIX Codex app:
It starts Codex with a process-scoped
GIT_DIR=NUL. On my machine, the stable trace changed from 247 newgit.exeand 137 newtaskkill.exeprocesses per 10 seconds to 0 and 0 over 15 seconds; WMI Provider Host fell from about 6.6% to 0.9%.Usage: fully exit Codex from the Windows system tray, then run the script.
This is an unofficial workaround, not an upstream fix. It deliberately disables or limits Review, Changes, branch detection, commit, and other Git-backed Codex features. It does not patch Codex, modify repositories or Git configuration, write system environment variables, require elevation, terminate processes, or remove chat history. Launching Codex normally restores Git integration.