Windows Desktop leaves repeated/stuck git.exe polling processes in multi-repo workspace
Summary
Codex Desktop on Windows repeatedly launches Git polling commands from Codex.exe in a native Windows multi-repo workspace. In the observed sessions, many git.exe processes remain alive after the polling command should have completed.
This reproduced on two Windows PCs against the same style of workspace. The strongest local capture shows 181 distinct git.exe processes first seen during a 45 second high-frequency polling window; 118 of those had Codex.exe as the direct parent while the parent was still alive.
I am not claiming a repository corruption root cause. Some stale index.lock files were observed on one machine, but another machine reproduced the same git.exe command pattern without lock files.
Environment
Machine A:
- Codex Windows app:
OpenAI.Codex_26.616.6631.0_x64__2p2nqsd0c76g0 - Codex app version:
26.616.6631.0 - Windows: Windows 11 Pro, version
10.0.26200, build26200, 64-bit - PowerShell:
5.1.26100.8655 - Git:
git version 2.52.0.windows.1 - Git executable paths observed:
D:\Program Files\Git\cmd\git.exeD:\Program Files\Git\mingw64\bin\git.exe- Workspace shape: native Windows drive, root directory is not itself a Git repo, with multiple child Git repositories.
Machine B:
- Same issue pattern reproduced in another native Windows multi-repo workspace.
- No child repo had
.git/index.lockin that run. - Parent processes had already exited by the time they were queried, so this machine only confirms the command pattern and residue, not the direct parent chain.
Observed commands
The leftover/new git.exe processes use this repeated command family:
git.exe -c core.hooksPath=NUL -c core.fsmonitor=false status --porcelain
git.exe -c core.hooksPath=NUL -c core.fsmonitor=false rev-parse HEAD
git.exe -c core.hooksPath=NUL -c core.fsmonitor=false remote -v
git.exe config --null --get core.fsmonitor
"D:\Program Files\Git\cmd\git.exe" -c core.hooksPath=NUL -c core.fsmonitor= rev-parse --show-toplevel
The rev-parse --show-toplevel command is notable because the captured command line had core.fsmonitor= rather than core.fsmonitor=false.
Direct parent-chain evidence
A high-frequency CIM polling capture on Machine A ran for 45 seconds and wrote these summary values:
{
"SampleRows": 397,
"DistinctGitProcesses": 181,
"FirstSeenWithParentAlive": 178,
"FirstSeenDirectCodexParents": 118
}
Representative captured parent chain:
ParentName: Codex.exe
ParentCommandLine: "C:\Program Files\WindowsApps\OpenAI.Codex_26.616.6631.0_x64__2p2nqsd0c76g0\app\Codex.exe"
Child executable: D:\Program Files\Git\cmd\git.exe
Child command: "D:\Program Files\Git\cmd\git.exe" -c core.hooksPath=NUL -c core.fsmonitor= rev-parse --show-toplevel
Another representative direct child:
ParentName: Codex.exe
ParentCommandLine: "C:\Program Files\WindowsApps\OpenAI.Codex_26.616.6631.0_x64__2p2nqsd0c76g0\app\Codex.exe"
Child executable: D:\Program Files\Git\cmd\git.exe
Child command: "D:\Program Files\Git\cmd\git.exe" config --null --get core.fsmonitor
Earlier in the same investigation, after manually terminating confirmed Git polling residue, new git.exe processes reappeared within about 10 seconds and the direct parent was again observed as Codex.exe.
Lock-file observations
On Machine A, after the issue had already been observed, three zero-byte .git/index.lock files were found in sibling child repositories:
<workspace>\repo-a\.git\index.lock length=0 LastWriteTime=2026-06-22 03:49:45 +08:00
<workspace>\repo-b\.git\index.lock length=0 LastWriteTime=2026-06-22 02:56:43 +08:00
<workspace>\repo-c\.git\index.lock length=0 LastWriteTime=2026-06-22 03:49:45 +08:00
The main repo being worked in did not have index.lock. Machine B reproduced the git.exe residue pattern with all child repos reporting no .git/index.lock.
So the lock files may be a consequence or separate symptom, but they are not required to reproduce the repeated Git polling process pattern.
Flutter investigation boundary
This was originally noticed while investigating Windows shell/child-process reliability in a Flutter workspace. I checked whether the observed Git residue directly explains flutter.bat hangs.
Current minimal probe did not prove a Flutter causal link:
- Direct Dart invocation of Flutter tools: completed in about 1.0s, no timeout.
flutter.bat --versionunder a hard-timeout wrapper: completed in about 1.4s, no timeout.- No evidence currently shows Flutter waiting on
git.exe, and no claim is made that Git residue causes Flutter hangs.
The confirmed issue in this report is the repeated/stuck Git polling process behavior from Codex Desktop on Windows.
Expected behavior
Codex's Git polling/review functionality should either:
- run short Git metadata/status commands and reap them promptly, or
- avoid launching overlapping Git polling commands for the same workspace when prior ones have not exited, and
- avoid leaving stuck/orphaned
git.exeprocesses or stale.git/index.lockfiles.
Actual behavior
Codex Desktop repeatedly launches Git polling commands. Many git.exe processes remain alive, and in one 45 second observation window over 100 newly seen Git processes had Codex.exe as direct parent.
Reproduction outline
- Open a native Windows multi-repo workspace in Codex Desktop.
- Do not run build/test/Flutter commands.
- Observe
git.exeprocesses with PowerShell:
Get-CimInstance Win32_Process -Filter "Name = 'git.exe'" |
Select-Object ProcessId,ParentProcessId,CreationDate,ExecutablePath,CommandLine
- For parent chain, poll quickly enough to catch the parent before it exits:
Get-CimInstance Win32_Process |
Where-Object { $_.Name -in @('Codex.exe','codex.exe','git.exe') } |
Select-Object ProcessId,ParentProcessId,Name,CreationDate,ExecutablePath,CommandLine
- Repeat for 30-60 seconds and count distinct
git.exePIDs and directCodex.exeparents.
Notes
Register-WmiEventwithWin32_ProcessStartTracewas attempted for stronger process-create evidence but was denied by Windows permissions on this machine, so the strongest machine-readable evidence here is high-frequency CIM polling plus direct parent snapshots.- The issue appears environment/app-level, not repository-specific.
10 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Additional cross-machine evidence from a second Windows PC, with repository/workspace names intentionally omitted:
Environment:
OpenAI.Codex_26.616.6631.0_x64__2p2nqsd0c76g026.616.6631.0C:\Program Files\WindowsApps\OpenAI.Codex_26.616.6631.0_x64__2p2nqsd0c76g0git version 2.54.0.windows.15.1.22621.4391Microsoft Windows 11 Pro,10.0.22631, build22631, 64-bitWorkspace/index-lock state:
IndexLockExists=falsebefore/during capture.Codex processes on this machine:
45-second read-only polling sample:
Representative
git.exerecords:Residual snapshot after sampling:
Interpretation from this second machine:
.git/index.lockfiles, so stale index locks are not a required precondition.git.exeprocesses had direct parentCodex.exe/codex.exeduring the 45-second sample.This strengthens the hypothesis that the issue is in Codex Desktop Windows Git metadata/status polling process cleanup, rather than repository-specific state, one Git version, one Windows build, or stale index locks as a required trigger.
Follow-up after reviewing the duplicate suggestions from the bot:
I reviewed #29110 and #29084, plus their linked chain (#28631, #27570, #27382). My current read:
rev-parse --show-toplevel,config --null --get core.fsmonitor,remote -v,status --porcelain). However, it was closed by its reporter as caused by an orphaned/broken.gitfolder inside.codex. This issue is not currently filed as that root cause: it has cross-machine Windows evidence, including one machine with no.git/index.lockin the child repos, and direct parent-chain captures showingCodex.exelaunchinggit.exe.syspolicyd/trustdCPU, not Windows residual/stuckgit.exeprocesses.rev-parse --show-toplevelshape, but is VS Code extension + Linux remote + empty.gitsandbox residue.So this may be in the same Git worker / SCM watcher problem family, with #29110 as the nearest neighbor, but I do not think there is enough evidence to close this as a duplicate yet.
This should be treated as blocker severity for Codex Desktop.
Codex Desktop is a coding agent whose primary workflow is opening Git workspaces. In affected workspaces, the app continuously spawns
git.exe/gitprocesses in the background while idle. On Windows, every spawnedgit.exeprocess and the files it touches can be inspected by Defender or corporate AV. On macOS, eachgitspawn can trigger Gatekeeper/code-signature checks viasyspolicyd/trustd. This turns a background SCM watcher into a system-wide CPU/I/O storm.Observed command on Windows:
Parent process:
Codex.exe.Impact:
.gitignorehygiene helps only some cases; it does not fix continuous background process spawning.git.exefrom antivirus is not acceptable in managed/corporate environments.This is not merely a Git performance issue. Codex is converting idle UI state refresh into repeated trusted-executable launches and whole-worktree security scans.
Expected behavior:
Codex should not poll Git continuously in the background. It should run Git only on explicit user actions or task boundaries, or provide a setting to disable background SCM polling. If background refresh is retained, it needs strict debounce/backoff, single-flight execution, no nested repo traversal, timeout cleanup, and no parallel Git process accumulation.
Severity: Blocker / P0-P1, because the app’s primary target workload is Git repositories, and affected users cannot safely or comfortably keep Codex Desktop open on real projects.
Maintainer triage request:
This is still blocking real Codex Desktop use for us after several days. Could a maintainer please triage this as Blocker / P0-P1, assign an owner, or state what additional signal is needed?
Why I believe this is above ordinary performance severity:
.git/index.lockfiles.git.exeprocesses, with 118 / 101 directCodex.exeorcodex.exeparents.git.exeor workspaces from AV is not an acceptable mitigation.Requested next step:
Please confirm whether this is being tracked internally, whether it maps to the broader Git worker / SCM watcher issue family, and whether a short-term mitigation can be shipped, such as:
If P0 is not appropriate, please say what evidence would move this from
performance bugto a release-blocking Windows Desktop issue.Additional routing signal: I also submitted this through Codex Desktop's Send feedback channel.
Feedback ID:
019f0b42-653b-76e2-99f8-68a6828c9305Posting the ID here so the internal feedback record can be correlated with this public GitHub issue and the reproduction/evidence already attached above.
I am seeing what looks like the same issue.
Feedback/log bundle ID: 019f09ca-366a-7b40-8429-d5db4bdbb987
Environment:
I disabled these settings/features:
[features]
undo = false
codex_git_commit = false
shell_snapshot = false
I also disabled PR drafts and worktree auto-cleanup in the app settings.
Despite restarting Codex, Codex.exe continues to spawn git.exe children repeatedly.
Observed process tree:
Codex.exe -> git.exe
Commands observed:
git add -u
git add -- <files>
git status --porcelain=v1 -z
git ls-files --others --exclude-standard -z
git config --null --get core.fsmonitor
git diff --no-ext-diff --no-textconv --find-renames --name-status -z
git diff --no-ext-diff --no-textconv --find-renames --numstat -z
git diff --no-ext-diff --no-textconv --find-renames --raw -z
The commands include:
-c core.hooksPath=NUL
-c core.fsmonitor=
So it does not appear to be caused by my Git hooks or fsmonitor.
Impact:
Expected:
A setting to disable background Git/review/diff/snapshot polling, or a fix so these Git operations are throttled and only run when needed.
I’m seeing what appears to be the same Git subprocess churn pattern on a newer Windows Codex build, with an additional downstream symptom: most of the visible CPU is sometimes charged to Windows
PcaSvc/ Program Compatibility Assistant Service rather than toCodex.exeorgit.exedirectly.Environment:
OpenAI.Codex_26.623.11225.0_x64__2p2nqsd0c76g0<workspace>D:\Program Files\Git\cmd\git.exepowershell.exe <- codex.exe app-server <- Codex.exe <- explorer.exeObserved behavior:
When Codex is open, Task Manager total CPU rises. The processes at the top are often not Codex itself, but Windows services such as:
Service Host: Program Compatibility Assistant ServiceAntimalware Service ExecutableWMI Provider HostClosing Codex drops the total CPU noticeably.
I captured native Windows counters and ProcMon traces. The strongest evidence so far:
PcaSvcwas hosted bysvchost.exePID13100typeperfover 120s showedPcaSvcpeaking at about95.8%of one logical core, averaging about22.8%MsMpEng.exealso spiked, but lower: peak about57%, average about5.9%7.7%, average about0.2%ProcMon evidence from a 30s capture:
PcaSvcgenerated409,206events in 30sRegOpenKey:120,557RegCloseKey:71,790RegQueryValue:55,074RegQueryKey:49,200CreateFile:22,411D:\Program Files\Git\cmd\git.exeD:\Program Files\Git\mingw64\bin\git.exeC:\Windows\appcompat\Programs\Amcache.hveC:\Windows\appcompat\pca\PcaGeneralDb0.txtHKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlagsMost importantly, ProcMon showed Codex repeatedly creating Git processes. One representative event:
git.exethen starts:In the same 30s ProcMon CSV, I counted
946Process Createevents forD:\Program Files\Git\cmd\git.exe.So my current read is:
PcaSvc, Defender, WMI, or general system CPU instead of highCodex.exeCPU.This also seems related to #20567, but this issue has the closest exact command match because of:
The actionable fix likely needs to be in Codex’s Git polling/root-discovery path: cache/debounce these probes, avoid overlapping Git subprocesses, and avoid repeatedly spawning Git for the same workspace when the result should be stable.
Could a maintainer confirm whether #30235 or #30863 is intended to address this issue?
From the PR descriptions, they appear to cover adjacent Git status safety/timeout paths, but not the Windows Desktop root-discovery / background polling loop reported here, especially repeated:
rev-parse --show-toplevelconfig --null --get core.fsmonitorstatus --porcelain/status --porcelain=v1 -zdiff/ls-files/git addbackground commandsThis issue now has multiple Windows Desktop reproductions, newer Codex builds, feedback/log bundle IDs, and evidence that CPU can be externalized into
PcaSvc/ Defender, making the source look unrelated in Task Manager.If this is tracked internally, please link or summarize the tracking status. If not, could it be assigned an owner or marked as a release-blocking Windows Desktop issue?
Same problem with ChatGPT Codex for Windows on directory without
.git.Version 26.707.62119