Codex Desktop on Windows leaks orphan git.exe + conhost.exe via ambient commit-history (200+ zombies over 30h, kills Chromium browsers)

Open 💬 2 comments Opened May 15, 2026 by whynot-hime

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

  1. Open Codex Desktop on Windows 11.
  2. Open any workspace that is a git repository.
  3. When Codex prompts about Ambient Suggestions / Commit History, click Accept.
  4. Leave Codex Desktop running for several hours.
  5. Get-Process git, conhost | Group-Object Name | Select Count, Name will show hundreds of accumulated processes.
  6. Get-CimInstance Win32_Process -Filter "Name='git.exe'" shows all of them have CommandLine = git write-tree or git add -u, with ParentProcessId pointing to a dead PID (orphans).
  7. 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.exe is reaped (close pipe handles before exiting the worker), OR
  • Respect the dismissed state 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.

View original on GitHub ↗

2 Comments

olaHalo · 1 month ago

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-Process only shows ~220 active processes using a few GB of RAM.
  • Windows Process Objects continuously increase even though the live process count stays relatively flat.
  • After ~14 minutes:
  • Live processes: ~230
  • Process objects: 91,000+
  • RAMMap shows the missing memory is primarily Page Table memory (~12.7 GB), not process private memory.

The most interesting finding is that RAMMap's Processes tab contains thousands of terminated git.exe entries (roughly 17–18 MB each).

These entries:

  • Do not appear in Task Manager.
  • Do not appear in Get-Process.
  • Do not appear in Get-CimInstance Win32_Process.

This suggests the git.exe processes have exited, but their process objects/page table allocations are not being released.

This is easily reproducible on my machine:

  1. Launch Codex Desktop.
  2. Open a local Unity Git repository.
  3. Use Codex normally.
  4. Observe Process Objects steadily increasing while the live process count remains relatively stable.
  5. RAM usage continues climbing until the system is nearly out of memory.

This appears to be related to #22756, but I wanted to share the additional diagnostics in case they help narrow down the root cause.

suiyuebaobao · 1 month ago

The orphaned git.exe/conhost.exe accumulation 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 new git.exe and 137 new taskkill.exe processes 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.