Codex in VS Code causes very high CPU usage in non-git folders, but behaves normally in git repositories on macOS

Resolved 💬 3 comments Opened Apr 17, 2026 by KeriaGuma Closed Apr 26, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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.
  1. 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.
  1. For A/B comparison, in the same folder, run:
git init
  1. Then reopen the same folder and open Codex again.
  1. After git init, CPU usage returns to normal or near-normal, and the issue is no longer reproducible in the same way.
  1. 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.

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 4 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #17394

Powered by Codex Action

igorkuznecov · 4 months ago

I put together a small public workaround repo for this stable-metadata non-git loop:

https://github.com/igorkuznecov/patch-codex-extension

What it does:

  • patches the extension host bundle so the non-git stable-metadata path returns null instead of a hard error
  • patches the webview asset so failed stable-metadata requests resolve to null instead of feeding the loop
  • creates .stable-metadata.bak backups
  • includes a restore script
  • uses MIT license

Current version of the script patches all installed openai.chatgpt-* versions it finds under ~/.cursor/extensions or ~/.vscode/extensions, which turned out to matter when multiple extension versions are present.

Tested locally on Cursor extension builds:

  • openai.chatgpt-26.422.62136-darwin-arm64
  • openai.chatgpt-26.422.71525-darwin-arm64

The patch script is here:

  • patch-codex-stable-metadata.sh

Usage:

bash patch-codex-stable-metadata.sh ~/.cursor/extensions
# or
bash patch-codex-stable-metadata.sh ~/.vscode/extensions

Then reload the editor window.

This is only a local workaround, not an upstream fix, but it stopped the renderer/log loop in my repro.

philip-soerensen · 2 months ago

I also reproduce this problem. I had the CPU usage stuck at high consumption, and it dropped back to idle after running git init in the workspace folder.