codex - 💡(How to fix) Fix Codex in VS Code causes very high CPU usage in non-git folders, but behaves normally in git repositories on macOS [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#18331Fetched 2026-04-18 05:55:51
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×2closed ×1commented ×1

Error Message

worker_rpc_response_error error={} method=stable-metadata workerId=git This makes it look like Codex may be repeatedly requesting git-related stable metadata in a non-git workspace and entering a retry/error loop that drives renderer/plugin CPU very high. If git metadata is unavailable, I would expect Codex to gracefully detect that situation, skip git-specific metadata work, or fall back without entering a high-frequency retry/error loop.

Fix Action

Fix / Workaround

This is reproducible in a completely clean VS Code environment with only openai.chatgpt installed. This does not appear to require any other third-party extension. The problem is strongly correlated with whether the opened folder is a git repository. A simple workaround is running git init in the folder.

Code Example

mkdir -p ~/Desktop/codex-nongit-repro

---

rm -rf ~/Desktop/vscode-repro-user ~/Desktop/vscode-repro-exts
mkdir -p ~/Desktop/vscode-repro-user ~/Desktop/vscode-repro-exts

code \
  --user-data-dir ~/Desktop/vscode-repro-user \
  --extensions-dir ~/Desktop/vscode-repro-exts \
  --install-extension openai.chatgpt

---

code \
  --user-data-dir ~/Desktop/vscode-repro-user \
  --extensions-dir ~/Desktop/vscode-repro-exts \
  ~/Desktop/codex-nongit-repro

---

ps -Ao pid,ppid,%cpu,%mem,command | \
grep -E 'Code Helper \(Renderer\)|Code Helper \(Plugin\)|Visual Studio Code' | \
grep -v grep | sort -k3 -nr | head -20

---

git init
RAW_BUFFERClick to expand / collapse

What version of the IDE extension are you using?

ChatGPT extension: openai.chatgpt v26.415.20818

What subscription do you have?

ChatGPT Plus

Which IDE are you using?

VS Code: 1.116.0

What platform is your computer?

25.3.0 arm64 arm

What issue are you seeing?

When I open the Codex panel in VS Code inside a non-git folder on macOS, CPU usage becomes abnormally high almost immediately.

The main symptom is that VS Code renderer processes (Code Helper (Renderer)) jump to roughly 200%–300%+ CPU, and the machine becomes noticeably hot. In some runs, the plugin process also becomes elevated.

I narrowed this down with multiple A/B tests:

  • In a clean VS Code environment with no extra extensions, opening a normal folder is fine.
  • After installing only openai.chatgpt, opening Codex in a non-git folder reproduces the high CPU issue.
  • If I open the same environment in a git repository, Codex behaves normally.
  • Even adding only an empty .git shell via git init is enough to make the problem disappear.

The most relevant log pattern I found is repeated warnings like:

worker_rpc_response_error error={} method=stable-metadata workerId=git

I also saw VS Code git logs repeatedly reporting:

fatal: not a git repository (or any of the parent directories): .git

This makes it look like Codex may be repeatedly requesting git-related stable metadata in a non-git workspace and entering a retry/error loop that drives renderer/plugin CPU very high.

What steps can reproduce the bug?

  1. On macOS, create a fresh folder that is not a git repository.

Example:

mkdir -p ~/Desktop/codex-nongit-repro
  1. Start VS Code with a clean user data dir and a clean extensions dir.
rm -rf ~/Desktop/vscode-repro-user ~/Desktop/vscode-repro-exts
mkdir -p ~/Desktop/vscode-repro-user ~/Desktop/vscode-repro-exts

code \
  --user-data-dir ~/Desktop/vscode-repro-user \
  --extensions-dir ~/Desktop/vscode-repro-exts \
  --install-extension openai.chatgpt
  1. Open that non-git folder in the same clean environment.
code \
  --user-data-dir ~/Desktop/vscode-repro-user \
  --extensions-dir ~/Desktop/vscode-repro-exts \
  ~/Desktop/codex-nongit-repro
  1. Open the Codex panel and interact with it briefly.

  2. Observe process usage.

ps -Ao pid,ppid,%cpu,%mem,command | \
grep -E 'Code Helper \(Renderer\)|Code Helper \(Plugin\)|Visual Studio Code' | \
grep -v grep | sort -k3 -nr | head -20
  1. In my case, one or more Code Helper (Renderer) processes quickly rise to about 200%–300%+ CPU.

  2. For A/B comparison, in the same folder, run:

git init
  1. Then reopen the same folder and open Codex again.

  2. After git init, CPU usage returns to normal or near-normal, and the issue is no longer reproducible in the same way.

  3. I also reproduced the same pattern in my normal VS Code environment:

  • non-git folder -> high CPU
  • same folder after git init or in a real git repository -> normal behavior

What is the expected behavior?

Codex should behave normally in both git and non-git folders.

If git metadata is unavailable, I would expect Codex to gracefully detect that situation, skip git-specific metadata work, or fall back without entering a high-frequency retry/error loop.

Opening the Codex panel in a normal non-git project folder should not cause renderer/plugin CPU usage to spike to several hundred percent.

Additional information

Important observations:

This is reproducible in a completely clean VS Code environment with only openai.chatgpt installed. This does not appear to require any other third-party extension. The problem is strongly correlated with whether the opened folder is a git repository. A simple workaround is running git init in the folder.

extent analysis

TL;DR

The high CPU usage issue in VS Code when opening the Codex panel in a non-git folder can likely be mitigated by initializing a git repository in the folder or modifying the Codex extension to handle non-git repositories more efficiently.

Guidance

  • The issue seems to be caused by the Codex extension repeatedly requesting git-related metadata in a non-git workspace, leading to a retry/error loop that drives up CPU usage.
  • To verify this, monitor the CPU usage of the Code Helper (Renderer) processes before and after initializing a git repository in the folder using git init.
  • As a temporary workaround, running git init in the non-git folder can resolve the high CPU usage issue.
  • Further investigation into the Codex extension's handling of non-git repositories and its metadata requests could provide a more permanent solution.

Example

No specific code changes are suggested at this point, but the git init command can be used as a workaround:

git init

Notes

The provided information suggests that the issue is specific to the interaction between the Codex extension and non-git repositories in VS Code. The exact implementation details of the Codex extension and its metadata requests are not provided, which might be necessary for a more detailed analysis.

Recommendation

Apply the workaround by running git init in the non-git folder, as it provides a simple and effective way to mitigate the high CPU usage issue until a more permanent solution is found.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING