Windows Codex Desktop corrupts chrome@openai-bundled cache on startup when Chrome native host locks extension-host.exe
Summary
On Windows Codex Desktop, the bundled Chrome plugin (chrome@openai-bundled 0.1.7) can become unusable after a Codex App restart if Chrome is already running and the Codex Chrome Extension has started its native messaging host.
The native host runs from inside the plugin cache via the latest junction:
%CODEX_HOME%\plugins\cache\openai-bundled\chrome\latest\extension-host\windows\x64\extension-host.exe
On this install, latest points to:
%CODEX_HOME%\plugins\cache\openai-bundled\chrome\0.1.7
During Codex Desktop startup, the app forces a bundled plugin reinstall/refresh. Because extension-host.exe is running from the cache directory being removed/backed up/reinstalled, Windows denies the operation with os error 5. After that, the Chrome plugin cache can be left partially materialized, causing @chrome / Chrome plugin loading to fail.
Environment
- OS: Windows 11 Pro, version
10.0.26200, x64 - Codex Desktop package:
OpenAI.Codex_26.506.3741.0_x64__2p2nqsd0c76g0 - Chrome:
147.0.7727.138 - Chrome plugin:
chrome@openai-bundled0.1.7 - Codex Chrome Extension:
1.1.4_0 - Chrome extension ID:
hehggadaopoacecdllhhajmbjkdcmajg - Codex home path in this report is redacted as
%CODEX_HOME% - Local AppData path in this report is redacted as
%LOCALAPPDATA%
User-visible behavior
After installing the Chrome plugin and Chrome extension:
- The Chrome extension shows connected.
- Codex plugin settings indicate the Chrome plugin is installed/enabled, or installation appears to complete.
- In a new Codex thread, tagging
@chromedoes not expose the Chrome plugin/tools to the assistant. - Codex logs show
missing or invalid plugin.jsonforchrome@openai-bundled. - Manually removing/reinstalling the plugin can fail while Chrome is running.
Reproduction
- On Windows Codex Desktop, install/enable the bundled Chrome plugin.
- Install/enable the Codex Chrome Extension.
- Open Chrome so the extension starts the native messaging host.
- Confirm the native host process is running from:
``text``
%CODEX_HOME%\plugins\cache\openai-bundled\chrome\latest\extension-host\windows\x64\extension-host.exe
- Restart Codex Desktop while Chrome/native host remains running.
- Start a new thread and tag
@chrome, or inspect plugin loading logs.
Expected behavior
Codex Desktop should not corrupt or partially remove the installed Chrome plugin cache while the native host is running. It should either:
- avoid reinstalling/removing the active cache path while the native host is running,
- stop/restart the native host safely before replacing the cache,
- install into a new versioned/staged directory and atomically switch
latest, or - fail cleanly without leaving the cache missing
.codex-plugin/plugin.jsonorassets.
Actual behavior
Codex Desktop attempts a forced bundled plugin reinstall/refresh while the native host is still running from the same cache path. Logs show Windows file-lock failures:
bundled_plugin_reinstall_uninstall_requested pluginId=chrome@openai-bundled pluginName=chrome reason=forced
bundled_plugins_marketplace_install_failed errorCategory=plugin_cache_windows_file_lock errorMessage="failed to uninstall plugin: failed to remove existing plugin cache entry: Access is denied. (os error 5)" installedPluginStatus=current installPhase=uninstall_existing installReason=forced marketplaceName=openai-bundled pluginName=chrome
Other attempts showed the same class of failure during install/backup:
bundled_plugins_marketplace_install_failed errorCategory=plugin_cache_windows_file_lock errorMessage="failed to install plugin: failed to back up plugin cache entry: Access is denied. (os error 5)" installPhase=install_plugin marketplaceName=openai-bundled pluginName=chrome
After this, the Chrome plugin cache can be left incomplete. The cache path exists, but .codex-plugin/plugin.json and/or assets may be missing. The app-server then reports:
failed to load plugin: missing or invalid plugin.json plugin="chrome@openai-bundled" path=%CODEX_HOME%\plugins\cache\openai-bundled\chrome\0.1.7
Local evidence
Before restart, the cache was complete:
%CODEX_HOME%\plugins\cache\openai-bundled\chrome\0.1.7
.codex-plugin
assets
extension-host
scripts
skills
The source bundled marketplace was also complete and had a valid marketplace entry:
{
"name": "chrome",
"source": {
"source": "local",
"path": "./plugins/chrome"
},
"policy": {
"installation": "AVAILABLE",
"authentication": "ON_INSTALL"
},
"category": "Productivity"
}
The cache plugin.json hash matched the source plugin.json hash when manually restored, so the source marketplace was not the broken piece.
Windows Restart Manager identified the lock owner as the Chrome plugin native host:
locked file: %CODEX_HOME%\plugins\cache\openai-bundled\chrome\latest\extension-host\windows\x64\extension-host.exe
owner: extension-host.exe
command: "%CODEX_HOME%\plugins\cache\openai-bundled\chrome\latest\extension-host\windows\x64\extension-host.exe" chrome-extension://hehggadaopoacecdllhhajmbjkdcmajg/ --parent-window=0
restartable: false
Isolation experiment
I ran a controlled restart test that temporarily disabled only the Chrome native host registration/manifest, killed the native host process, restored the Chrome plugin cache metadata, then restarted Codex Desktop.
Before Codex restart:
pluginJson=True
assets=True
registry=False
manifest=False
nativeHostProcessCount=0
latestTarget=%CODEX_HOME%\plugins\cache\openai-bundled\chrome\0.1.7
After Codex restart:
pluginJson=True
assets=True
registry=True
manifest=True
nativeHostProcessCount=0
latestTarget=%CODEX_HOME%\plugins\cache\openai-bundled\chrome\0.1.7
The corresponding Codex Desktop startup log showed a clean forced reinstall path instead of the file-lock failure:
bundled_plugins_runtime_marketplace_written pluginCount=3 pluginNames=["browser-use","chrome","latex-tectonic"]
bundled_plugin_reinstall_uninstall_requested pluginId=chrome@openai-bundled pluginName=chrome reason=forced
bundled_plugin_install_requested pluginName=chrome reason=forced
chrome_native_host_install_requested latestRoot=%CODEX_HOME%\plugins\cache\openai-bundled\chrome\latest nativeHostName=com.openai.codexextension pluginName=chrome
This strongly suggests the failure depends on the Chrome native host holding a file lock on the plugin cache during Codex Desktop's forced bundled plugin reinstall/refresh.
Workaround
Close Chrome completely before restarting Codex Desktop or reinstalling the Chrome plugin, making sure both chrome.exe and extension-host.exe are gone. Then restart Codex Desktop, wait for startup/plugin refresh to finish, and reopen Chrome.
This avoids the cache lock and kept .codex-plugin/plugin.json and assets intact in the isolation test.
Related
- #21670 — same
plugin_cache_windows_file_lock/os error 5class - #21878 — same
chrome@openai-bundled0.1.7native host path and Windows runtime instability - #21598 — Chrome extension connected but Chrome plugin/backend not exposed
11 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I ran into a very similar issue on Windows: the Chrome extension popup showed
Connected, but Codex could no longer expose or use@Chromeafter restarting Codex/Chrome.What helped locally was fully closing both Codex and Chrome, making sure
chrome.exeandextension-host.exewere gone, then starting Codex first, waiting for the Chrome/Browser plugins to load, and only then starting Chrome.I wrote up the steps here in case it helps others:
https://treasure-lung-30f.notion.site/Codex-Chrome-Extension-on-Windows-Setup-and-Troubleshooting-Guide-36830cb58ab8816eb0a4e8b93153a94c
This is just a user workaround from local debugging, not an official fix.
Additional confirmation from another Windows/WSL install, on newer versions.
Environment
26.519.3891.026.519.316511.1.5hehggadaopoacecdllhhajmbjkdcmajgUser-visible symptoms
Connected.@in Codex does not show Chrome as an available mention target.Earlier install/uninstall attempts from Codex also showed:
The uninstall failure was resolved only after stopping stale
extension-host.exeprocesses.Diagnostics
Chrome-side checks pass:
But after restarting Codex, the Chrome plugin cache is again missing key Codex-side files:
The
latestpointer was checked/corrected to:but Chrome still does not appear in
@and is still not exposed as a callable tool in new conversations.Separate Chrome extension hotfix test
A Chrome Web Store review suggested that extension
background.jscalls nonexistentchrome.runtime.getVersion()and should usechrome.runtime.getManifest().version. A temporary local test patch was applied:That patch persisted after restarting Chrome and Codex, and the extension still checked as installed/enabled. However, Codex still did not expose Chrome as a callable tool. So that appears to be a separate extension-side issue, while the remaining blocker is still the Codex-side plugin registration/cache state described in this issue.
Conclusion
This still reproduces on Codex Desktop
26.519.3891.0, bundled Chrome plugin cache26.519.31651, and Chrome extension1.1.5. The important new observation is that Codex restart leaves the Chrome plugin cache missing.codex-plugin/plugin.jsonandapp-server-runtime/node_repl, while the Chrome extension itself remains installed and connected.Additional confirmation on a newer Windows Desktop build, with one extra impact: this can also make
computer-use@openai-bundleddisappear from active discovery/runtime.Environment
OpenAI.Codex_26.527.3686.0_x64__2p2nqsd0c76g026.527.31326hehggadaopoacecdllhhajmbjkdcmajg%CODEX_HOME%What changed versus the original report
On this install,
chrome@openai-bundledhad:as a junction pointing into the temporary bundled marketplace, not a stable versioned cache directory:
So when Chrome kept the Codex Chrome extension native host alive, the native host locked the temporary bundled marketplace path itself:
An exclusive-open test against that file failed with Windows reporting it was being used by another process. There were three lingering
extension-host.exenative messaging processes from the Codex Chrome extension.User-visible symptom
After Codex restart, Computer Use appeared to be installed/enabled in config/cache, but disappeared from active availability:
and the cache still existed:
but the active bundled marketplace was incomplete and only contained
chrome:At runtime, Computer Use failed with:
and the request metadata no longer had Computer Use helper metadata available to the session.
Log evidence
Earlier in the same day/session, the bundled marketplace was healthy and Computer Use was available:
After restart/focus reconcile while the Chrome native host was still alive:
There were also repeated install/reinstall failures in the same class:
Workaround confirmed
The user removed/disabled the Chrome Codex extension, killed three lingering
extension-host.exeprocesses in Task Manager, then restarted Codex Desktop. After that, Computer Use became available again.This suggests the blast radius is larger than just
@chrome: a lockedchromenative host can leave the shared bundled marketplace incomplete, which then breakscomputer-usehelper path resolution even though thecomputer-usecache/config entries still exist.Suggested fix direction
In addition to avoiding replacement of a running native host cache path, it may be worth ensuring
chrome\latestnever points into the temporary bundled marketplace root used for regeneration, or making bundled marketplace regeneration atomic so a lock in one plugin cannot leave the wholeopenai-bundledmarketplace with only a partial plugin set.Additional confirmation on Codex Desktop
26.527.3686.0, with a full Computer Use failure/recovery chain.This appears to be the same underlying issue as the Chrome native host file lock described here, but the blast radius included
computer-use@openai-bundled: the Computer Use native pipe stopped being created because the bundled plugin cache/marketplace entered a partial state after Chrome plugin reconciliation hit Windows file locks.Environment
10.0.26220OpenAI.Codex_26.527.3686.0_x64__2p2nqsd0c76g026.527.31326runCodexInWindowsSubsystemForLinux = false%CODEX_HOME%%LOCALAPPDATA%\Packages\OpenAI.Codex_2p2nqsd0c76g0\LocalCache\Local\Codex\Logs\2026\06\01\...hehggadaopoacecdllhhajmbjkdcmajgFailure sequence observed
Computer Use worked earlier in the same app session:
Later, after bundled plugin reconcile/focus events while the Codex Chrome extension native host was alive, Computer Use failed:
The same time window showed Chrome plugin/native host cache lock failures:
Process inspection found lingering native host processes launched from the Chrome extension:
At one point the active
%CODEX_HOME%\plugins\cache\openai-bundledcache was partial:browserandchromeexisted, butcomputer-usewas missing. The regenerated temporary marketplace did containcomputer-use, so the issue was not that the bundled marketplace source lacked Computer Use; the active cache/session state was inconsistent.The Computer Use client then failed before any
list_apps()call because the desktop app did not inject a native pipe path:The client code path reads the pipe from:
so once the desktop host fails to start/publish the native pipe, the plugin client cannot recover by itself.
Recovery that worked
The durable local workaround was to remove the Chrome native-host trigger, then rebuild bundled caches while Codex/Chrome were fully stopped:
chrome@openai-bundledin Codex settings/config.```toml
[plugins."computer-use@openai-bundled"]
enabled = true
[plugins."browser@openai-bundled"]
enabled = true
[plugins."chrome@openai-bundled"]
enabled = false
```
extension-host.exenative messaging processes.``
text
``%CODEX_HOME%\.tmp\bundled-marketplaces
%CODEX_HOME%\plugins\cache\openai-bundled
One important detail: after
computer-usewas reinstalled into the cache, the already-running Codex process still did not publish the Computer Use pipe. A second Codex restart was required so the desktop host would see the restored helper paths at startup and inject the native pipe path into the session.Successful final state
After the second restart, logs showed:
Files existed again:
No Chrome or
extension-host.exeprocesses remained. The native pipe and helper process existed,sky.list_apps()returned apps, and a Notepad smoke test succeeded by typing and reading back:Suggested product fix
The main issue still seems to be that a running Chrome native host can lock either the active plugin cache or the temporary bundled marketplace path, and a failure in
chromereconciliation can leave the sharedopenai-bundledstate inconsistent enough to break unrelated bundled plugins likecomputer-use.Possible fixes:
extension-host.exefrom a cache/tmp path that bundled reconcile may remove or replace.chrome\latestcannot point into%CODEX_HOME%\.tmp\bundled-marketplaces.chromecannot remove or hide helper paths forcomputer-use.computer-useis installed/restored during a running session, re-run native pipe helper path resolution and publishSKY_CUA_NATIVE_PIPE_DIRECTORYwithout requiring a full app restart.Related symptoms/issues: #25391 and #25571.
Thanks for the detailed write-up. I maintain a small community Codex Skill focused specifically on Windows Codex Desktop failures around the bundled Chrome and Computer Use plugins:
https://github.com/navi118/codex-desktop-doctor-skill
It is not a general Codex repair script, and it does not make automatic destructive changes. The goal is to help an agent collect the relevant local evidence first, especially around the Codex Chrome Extension/native host, bundled marketplace/cache state, Computer Use helper/native pipe availability, and Windows file-lock / access-denied patterns such as
plugin_cache_windows_file_lock,EBUSY,os error 5,missing-helper-path, orWindows Computer Use helper paths are unavailable.This issue is very close to the failure class the Skill was created for: Chrome native-host/cache lifecycle problems on Windows that can leave the bundled plugin cache or runtime marketplace in a partial state, sometimes with Computer Use affected as collateral damage.
Sharing it here as a cautious diagnostic aid, not as an official fix or a one-size-fits-all workaround.
Root cause (confirmed) and a corruption-free fix for the Windows plugin-cache
os error 5/ half-removed cacheI think I've pinned the mechanism behind "failed to remove existing plugin cache entry … (os error 5)" / the half-materialized bundled plugin cache on Windows (this issue, and #21670), and have a small, Windows-scoped fix that I've validated locally.
Where it happens (open-source)
codex-rs/core-plugins/src/store.rs:remove_existing_target()(used byPluginStore::uninstall) callsfs::remove_dir_all(path).remove_old_plugin_versions()callsfs::remove_dir_all(entry.path()).std::fs::remove_dir_alldeletes entries one-by-one. When a file inside the tree is locked — typically the plugin's own native messaging host (extension-host.exe) running out of…/plugins/cache/openai-bundled/chrome/latest/extension-host/windows/x64/, or any file a plugin holds open withoutFILE_SHARE_DELETE— the call deletes some siblings and then fails, leaving a half-removed (corrupt) cache entry that is missing.codex-plugin/plugin.json/assets.Empirical confirmation (Windows 11)
Holding one file in a plugin tree open with
FILE_SHARE_READonly (noFILE_SHARE_DELETE, which is what a running native host effectively does), then callingstd::fs::remove_dir_allon the tree:So
plugin.jsonandassetsare gone but the directory remains — exactly the "missing plugin.json/assets" corruption reported here. Notably, **renaming the parent directory aside is also rejected under this lock**, so "just move it out of the way" is not sufficient on its own.Downstream effect observed on a real install (Desktop
26.601.2237.0): while Chrome'sextension-host.exeholds the bundledchromecache dir, a plugin refresh fails to remove/replace it, after whichcomputer-useresolves toreason=missing-helper-pathand the Computer Use native pipe never starts (the symptom in #25507 / #25512). Fully closing Chrome and restarting Codex — so nothing locks the cache during the refresh — reliably restores it, consistent with this being a lock-during-removal problem.Proposed fix (Windows-scoped, no behavior change elsewhere)
Make the removal corruption-free: relocate the tree with an atomic rename first and only delete the relocated copy, so the canonical path is only ever fully present or fully gone — never half-deleted. If even the rename is blocked by the lock, retry briefly and then return the error with the directory left fully intact, so callers keep the previous valid cache instead of a corrupt one.
remove_existing_targetandremove_old_plugin_versionscall this instead offs::remove_dir_all. On non-Windows it's a thin alias forfs::remove_dir_all(zero behavior change).Test / validation
I validated the removal logic with a standalone reproduction on Windows 11: with one
file held open
FILE_SHARE_READ,std::fs::remove_dir_alldeletes siblings and thenfails (
err=Some(32),plugin.json/assetsalready gone) — a corrupt half-removedtree — while the relocate-first version leaves the tree fully intact and reports the
error; with no lock it removes the tree cleanly. The same behavior is covered by a
#[cfg(windows)]unit test added next to the change instore_tests.rs(installs aplugin, holds a
FILE_SHARE_READhandle on a file inside it, assertsuninstallerrors but the manifest/version survive).
Note: I did not run the full
cargo test -p codex-core-pluginslocally — the crate'sdependency tree builds several C/asm
*-syscrates (aws-lc-sys, ring, zstd-sys, …)that need a full C toolchain I don't have on this machine — so CI is the right place to
exercise the added test.
Offer
I have the change + test ready against
main.docs/contributing.mdsays PRs must be invited — would the team welcome a PR for this? If so I'll sign the CLA and open it.Environment: Windows 11, Codex Desktop
26.601.2237.0, Rust perrust-toolchain.toml(1.95.0).Adding a cross-link because I hit the same Windows native-host file-lock family on a newer build, with an additional Computer Use impact.
Environment observed on 2026-06-08:
OpenAI.Codex_26.602.4764.0_x64__2p2nqsd0c76g026.602.40724The lock/failure was against the generated bundled marketplace path rather than only the stable plugin cache:
Desktop logged
bundled_plugins_marketplace_resolve_failed errorCode=EBUSYwhile trying tormdirthat directory. After that, the generatedopenai-bundledmarketplace was left partial: onlyplugins\chromeremained, with no.agents\plugins\marketplace.jsonand noplugins\computer-use.The immediate downstream effect was that Computer Use helper-path resolution disappeared:
Restoring the generated marketplace manifest/directories from the installed app bundle made the Computer Use native pipe start again, and
setupComputerUseRuntime(...)+sky.list_apps()succeeded.Detailed timeline is in #26785. Main extra signal for this issue: a locked Chrome native host can now break more than
chrome@openai-bundled; it can leave the generatedopenai-bundledmarketplace half-materialized and disable Computer Use helper-path discovery too.Confirming this on Windows 11 25H2 (build 26200) ARM64 — Surface Laptop 7 / Snapdragon X Elite, Codex Desktop 26.602.9276.0 (x64 under emulation).
Same root cause as reported: while Codex refreshes the bundled plugin cache, Chrome's running native host has
extension-host.exelocked, so the cache backup/reinstall fails —failed to back up plugin cache entry: Access is denied. (os error 5)— leaving a partial cache andfailed to load plugin: missing or invalid plugin.json plugin="chrome@openai-bundled".Two extra findings on this setup that may help scope the fix:
~\.codex\.tmp\bundled-marketplaces\openai-bundled\pluginswith onlybrowser+latex, omittingchrome(andcomputer-use), even though all of them ship complete under…\WindowsApps\OpenAI.Codex_<ver>_x64__…\app\resources\plugins\openai-bundled.plugins\cache\openai-bundled\chrome\latestis a junction into that volatile staging folder, so when the stage flickers to incomplete the loader reportsplugin is not installed. The stage flips complete<->incomplete every few minutes on its own.computer-use@openai-bundledplus theopenai-primary-runtimeplugins (documents,spreadsheets,presentations) get logged asconfigured non-curated plugin no longer exists in discovered marketplaces during cache refresh.Result: even with Chrome fully closed (no
chrome.exe/extension-host.exe), the plugin still flickers working<->broken because the staging churns independently. Closing Chrome resolves theAccess is deniedlock half, but not the staging-completeness half.Suggestions: (a) materialize the cached plugin into a stable version dir instead of junctioning
latestinto the volatile.tmpstaging folder; (b) make staging atomic + verified (don't publish a stage missing shipped plugins); (c) don't uninstall configured plugins on a transient discovery miss; (d) a native ARM64 build would likely reduce the underlying file-timing races on Windows-on-ARM.I’m experiencing the same issue on Windows in the current ChatGPT Work/Codex desktop app.
Failed to uninstall plugin.Uploaded feedback/thread ID:
019f6631-a088-7cf0-89ce-c85142dc5b87Additional Windows evidence from a separate Codex Desktop installation (Windows 11, app 26.715.2305.0; bundled Browser plugin 26.715.21425).
Controlled warm-restart result:
IDP.HELU.PSE81 - Command line detection.Important distinction: after recovery, the installed AppX source, generated runtime marketplace, and
%CODEX_HOME%\plugins\cache\openai-bundledhad exact SHA-256 parity; Browser/Chrome/computer-use manifests were present. No matchingplugin_cache_windows_file_lockentry was found in the local Codex log for the failed restart. This suggests either (a) security software can interrupt startup refresh before Codex records a useful cache error, or (b) cache health and plugin registration/rehydration can fail independently.A useful upstream fix/diagnostic would:
Temporary local workaround: close processes that may hold bundled-plugin files, pause the AV shield for the first launch after update, start Codex, allow bundled-plugin refresh to finish, then re-enable the shield.