VS Code extension spikes CPU and logs "open-in-target not supported in extension" while rendering diffs after Codex edits files
What issue are you seeing?
When Codex edits code in the VS Code extension and starts rendering the Git diff / thread UI, CPU usage spikes and the machine heats up noticeably.
This does not appear to be caused by the prompt itself. It happens when the response includes file edits and the extension renders the resulting diff UI, especially for multi-file edits.
The extension host logs are filled with these errors/warnings:
open-in-target not supported in extensionlocal-environments is not supported in the extension[IpcClient] Received broadcast but no handler is configured method=thread-stream-state-changed
The dominant error is:
open-in-target not supported in extension
In one session, this was logged 18536 times, with peaks around 805 occurrences per second.
What steps can reproduce the bug?
- Open the Codex VS Code extension.
- Start any task that causes Codex to edit files locally.
- A simple repro prompt is:
Rename this function across the project, update imports/usages, and apply the edits directly.
- Make sure the change affects multiple files so the thread/diff UI renders several file diffs.
- Wait for Codex to stream the edits and render the diff view in the thread.
- Observe:
- CPU usage rises sharply
- the machine heats up
- extension host logs start spamming
open-in-target not supported in extension
This is easier to reproduce with multi-file edits than with a single-file change.
What is the expected behavior?
Rendering diffs after Codex edits files should not trigger unsupported API calls in VS Code extension mode.
Expected behavior:
- the diff UI should render normally without CPU spikes
- the extension should not call Electron-only or unsupported APIs in extension mode
- unsupported optional features should gracefully no-op instead of generating error/log storms
Additional information
Environment:
- macOS
- VS Code extension webview
- Extension version:
openai.chatgpt-26.325.31654-darwin-arm64
I inspected the shipped source maps locally and found what looks like the main cause:
CodeDiffends up queryingopen-in-targets- this still happens in
extensionmode - but the extension host explicitly throws for that API:
open-in-target not supported in extension
I also tested a local hotfix in the installed bundle that gated this query to Electron-only behavior:
queryFn:async()=>document.documentElement.dataset.codexWindowType==="electron"
? Je(`open-in-targets`,{params:{cwd:e}})
: {preferredTarget:null,targets:[],availableTargets:[]}
After that change, the main log storm stopped and the heating issue was greatly reduced. That suggests the bug is likely caused by CodeDiff querying open-in-targets even when running inside the VS Code extension host, where that API is unsupported.
There also appears to be a smaller secondary issue where local-environments is queried in extension mode, but open-in-targets is by far the dominant failure path.
15 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I've encountered the same problem.
After using the latest version of the CodeX vs Code extension and having several conversations with CodeX,
my Macbook Air M4's CPU usage exceeded 100%, and the computer overheated significantly.
@MingLi3306
You can try this:
具体修复思路
修改文件:
/Users/你的用户名称/.vscode/extensions/openai.chatgpt-26.325.31654-darwin-arm64/webview/assets/index-CpiKkRDN.js在打包后的 bundle 中,定位这一段逻辑:
把它改成:
这样修改后:
electron,仍然走原逻辑extension,直接返回空结果,不再触发宿主端 unsupported APIrun this script to fix it
related to https://github.com/openai/codex/issues/16849
Thank you for your help.
+1
Facing the same issue. As soon as I start the VS Code extension and ask anything, the CPU usage jumps to 100% and the fan throttles heavily. This is strange, as I didn’t experience this earlier. Also the thing is when is running the cpu spikes and when is done working then the cpu usage goes down. For long task it just makes it very inconvenient.
codex vs-code extension: 26.5401.11717
macOS 26.3.1
Visual Studio Code: Version: 1.114.0
<img width="385" height="79" alt="Image" src="https://github.com/user-attachments/assets/b915f9e7-6269-428e-b464-4433be5300dd" />
cek https://github.com/openai/codex/issues/16849
@shx2005, I can confirm this appears to be the same bug family, and I reproduced it on a fresh Debian Linux install with only GNOME, Git, VS Code, and the OpenAI extension installed. See Issue 17357.
My observed signatures matched yours:
open-in-target not supported in extensionlocal-environments is not supported in the extension[IpcClient] Received broadcast but no handler is configured method=thread-stream-state-changedOn my side, the issue also caused persistent CPU churn until VS Code was fully closed.
What seems especially useful for triage is that I ran a reversible local hotfix experiment against the installed extension bundle:
thread-stream-state-changed/local-environmentsfailure paths.vscode://codex/open-in-targetsThat result made me think this is broader than one isolated endpoint and more likely a capability-gating mismatch where extension-mode UI/webview code is still exercising host routes that the extension host explicitly marks unsupported.
I also inspected the shipped bundle and found a larger cluster of handlers that explicitly throw as unsupported in extension mode, including:
open-in-targetsset-preferred-applocal-environment-configlocal-environment-config-saveworkspace-directory-entriesremote-workspace-directory-entriesworktree-create-managedworktree-deleteworktree-set-owner-threadSo my guess is the extension is not properly disabling or gating one or more feature families after discovering the host is running in VS Code extension mode.
Follow-up on Debian Linux: the issue reproduced again after the extension auto-updated from 26.406.31014 to 26.409.20454, so the update did not fix it upstream.
In 26.409.20454 I still observed:
open-in-target not supported in extensionthread-stream-state-changedunhandled broadcast warningI then reapplied the same broad local hotfix strategy to the new bundle and restarted VS Code. After that:
open-in-targeterrors disappeared from the active session loglocal-environmentserrors disappearedthread-read-state-changedwarnings remainThat makes me more confident the core issue is an unsupported-host capability mismatch and that the repeated unsupported route failures were the main driver of the persistent CPU storm.
Confirmed on Windows as well.
User-visible symptom in my case:
Local extension log shows:
open-in-target not supported in extensionlocal-environments is not supported in extensionurl=vscode://codex/open-in-targetsEnvironment:
1.115.0openai.chatgpt26.5409.20454--user-data-dir "C:\VSCode\settings\Default1"--extensions-dir "C:\VSCode\extensions\Default"So for me this is not only a CPU/logging issue, but also a broken file-link-opening issue in the Codex chat UI.
Check https://github.com/openai/codex/issues/15330#issuecomment-4248241733
Confirming this still happens on
openai.chatgpt-26.409.20454-darwin-arm64— 84 versions newer than OP's report — and now also affects Google Antigravity (a VS Code fork), not just official VS Code.Repro environment
openai.chatgpt-26.409.20454Observed
open-in-target not supported in extensionerrors at 142/sec (peak)Fix verified
Applied OP's patch via direct edit of the bundled
out/extension.js(replacing boththrow new Error(...)handlers with safe empty responses):After full restart of Antigravity:
Functional impact: the "Open in External App" right-click flow is the only thing that breaks. Chat, code edits, command execution all work normally.
This is also a strong signal that the bug is in the webview's React Query side, not just the host handler — patching the host to return empty is a sufficient workaround because the webview's retry loop stops once it gets a non-error response.
I can reproduce this issue consistently on macOS (Apple Silicon).
codex extension version: 26.409.20454
feedback id: 019d94b8-2535-71d1-80a3-aa9701d9c2c9
Additional observations that may help:
Code Helper (Renderer)process goes up to ~180% CPUIn the VS Code Output panel (Codex), I see repeated errors like:
Error: open-in-target not supported in extension
url=vscode://codex/open-in-targets
This suggests the WebView might be repeatedly attempting to call
an unsupported command, possibly causing a retry loop or continuous re-render.
This might explain why the renderer process consumes high CPU even when idle.
this doesn't work with version above .409. , this fix is obsolete
Update regarding my earlier comment: https://github.com/openai/codex/issues/16850#issuecomment-4235816327
My issue appears to be resolved now.
In my case this was on Windows with VS Code Insiders + the Codex extension, behind a corporate proxy. VS Code already had
http.proxyconfigured, and the usualHTTP_PROXY/HTTPS_PROXYenvironment variables were already set, but WinHTTP was still configured for direct access: