High idle CPU from background Git scanning of venv/site-packages (desktop)
Summary
Codex desktop shows high CPU while idle when a workspace includes a large Python virtualenv venv/lib/python3.12/site-packages under a Git-visible tree.
At the same time, macOS syspolicyd and trustd also spike.
Environment
- Codex desktop:
260210.1703 - Electron:
40.0.0 - macOS (Apple Silicon)
- Workspace opened in Codex:
/Users/dq/CC - Heavy subtree:
/Users/dq/CC/dq/chatbi-rag-test/venv/lib/python3.12/site-packages- ~14,310 files, ~474 MB
Evidence
Observed around 2026-02-11 09:55-09:57 local time:
- Codex: up to
70.8% - syspolicyd: up to
138.7% - trustd: up to
100.7%
Codex spawned repeated Git child commands like:git --no-optional-locks ... diff --no-index -- /dev/null dq/chatbi-rag-test/venv/lib/python3.12/site-packages/numpy/__init__.pyi
Also observed repeated ENOENT warnings for missing configured workspace paths, suggesting extra background probing.
Repro steps
- Open a large parent folder in Codex.
- Ensure one subtree contains a large Python virtualenv (
venv/site-packages) with many files. - Leave Codex idle.
- Observe high CPU in Codex +
syspolicyd+trustd, with transient Gitdiff --no-indexchildren.
Expected
Idle CPU should stay low, and background scanning should avoid generated dependency directories.
Workaround that fixed it
- Remove stale/overly-broad trusted workspace entries in
~/.codex/config.toml. - Ignore heavy generated folders in experiment area (
venv,.venv,site-packages,vector_data,chroma*).
After this, CPU returned near idle (Codex ~0.0%-0.1%).
Request
Please optimize background repository scanning defaults (exclude generated dirs, debounce/concurrency limits, cache ENOENT with backoff), and add a user setting to limit/disable background scan scope.
<img width="2464" height="306" alt="Image" src="https://github.com/user-attachments/assets/d06e90f8-49f7-4b31-bfb9-44231190a37f" />
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗