解决Windows的电脑更新Codex不显示Computer Use和Chrome插件的问题

作者:c_chun 发布时间: 2026-06-30 阅读量:2 评论数:0

之前使用Windows电脑下载的codex插件列表里并不显示computer user和Chrome插件,通过将Codex 的安装位置更改为C盘后,即可显示这两个插件。再更新Codex 后,我发现computer user和Chrome插件又找不到了。

这个问题我最终的有效解决方式非常直接:

在 Codex 内直接发送一句提示词,让 AI 自动修复插件环境

将以下内容完整复制到 Codex 对话中执行

你现在要在 Windows 本机环境中排查并尽量修复 Codex Desktop 的 bundled 插件异常。目标是 Windows 用户目录和 Windows Codex 安装目录。

我的问题现象可能包括:

- Codex 更新后 `Computer Use` 或 `Chrome` 插件消失、不可用、图标不加载。
- 插件页能看到 `computer-use@openai-bundled` / `chrome@openai-bundled`,但点进去报错类似:
  `marketplace file "%USERPROFILE%\.codex\.tmp\bundled-marketplaces\openai-bundled\.agents\plugins\marketplace.json" does not exist`
- 设置页里 Computer Use 显示 unavailable。
- Codex 日志里可能出现 `EBUSY`、`resource busy or locked`、`plugin_cache_windows_file_lock`、`os error 5`、`extension-host.exe`、`extension-host\windows\x64` 等关键词。

请按下面流程执行。所有路径必须通用化,使用 `$env:USERPROFILE`、`$env:LOCALAPPDATA`、`$env:ProgramFiles` 等变量,不要写死某个用户名。

---

0. 基本原则

1. 先诊断,确认是不是 Windows 文件锁导致的 bundled 插件半更新问题;不要一开始就删除目录或改配置。
2. 修复前必须备份。
3. 不要盲目修改 `[windows] sandbox`。
4. 不要暴露任何 token / API key。
5. 如果无法执行 PowerShell,生成 .ps1 脚本。

---

1. 变量初始化

$CodexHome = Join-Path $env:USERPROFILE ".codex"
$BackupRoot = Join-Path $env:USERPROFILE "codex-plugin-backups"
$Desktop = [Environment]::GetFolderPath("Desktop")
$OpenAILocal = Join-Path $env:LOCALAPPDATA "OpenAI"
$CodexLocal = Join-Path $OpenAILocal "Codex"
$ExtensionManifest = Join-Path $OpenAILocal "extension\com.openai.codexextension.json"
$CodexNativeHosts = Join-Path $CodexHome "chrome-native-hosts.json"
$LocalNativeHosts = Join-Path $CodexLocal "chrome-native-hosts.json"
$BundledTmpRoot = Join-Path $CodexHome ".tmp\bundled-marketplaces\openai-bundled"
$BundledMarketplaceJson = Join-Path $BundledTmpRoot ".agents\plugins\marketplace.json"
$PluginCacheRoot = Join-Path $CodexHome "plugins\cache\openai-bundled"
$ChromeCacheRoot = Join-Path $PluginCacheRoot "chrome"
$ComputerUseCacheRoot = Join-Path $PluginCacheRoot "computer-use"

---

2. 修复前备份(必须执行)

$Stamp = Get-Date -Format "yyyyMMdd-HHmmss"
$BackupDir = Join-Path $BackupRoot "openai-bundled-lock-repair-$Stamp"
New-Item -ItemType Directory -Force -Path $BackupDir | Out-Null

$FilesToBackup = @(
  (Join-Path $CodexHome "config.toml"),
  (Join-Path $CodexHome ".codex-global-state.json"),
  $CodexNativeHosts,
  $LocalNativeHosts,
  $ExtensionManifest
)

foreach ($file in $FilesToBackup) {
  if (Test-Path -LiteralPath $file) {
    Copy-Item -LiteralPath $file -Destination $BackupDir -Force
  }
}

---

3. 检测 bundled 插件是否损坏

重点检查:

- marketplace.json 是否存在
- chrome / computer-use 是否缺失 scripts / extension-host
- latest 是否指向 .tmp

---

4. 停止插件进程

Get-Process extension-host -ErrorAction SilentlyContinue | Stop-Process -Force
Get-Process codex-computer-use -ErrorAction SilentlyContinue | Stop-Process -Force

---

5. 重建 bundled marketplace

删除:

$CodexHome\.tmp\bundled-marketplaces\openai-bundled

然后从 Codex 安装目录复制:

C:\Program Files\WindowsApps\OpenAI.Codex*\app\resources\plugins\openai-bundled

重新覆盖到:

$CodexHome\.tmp\bundled-marketplaces\openai-bundled

---

6. 重建 plugin cache

重新生成:

- chrome cache
- computer-use cache
- latest junction

---

7. 修复 native host json

确保不再指向:

- .tmp
- chrome\latest

---

8. 最终验证:

- computer-use@openai-bundled 已启用
- chrome 插件存在
- settings 不再显示 unavailable
- marketplace.json 可正常加载

从 Windows 环境来看,这个问题通常不是“缺插件”,而是:

1. 半更新状态(最常见)
  • Codex 更新时插件未完整解包

  • .tmp/bundled-marketplaces 残缺

2. Windows 文件锁
  • EBUSY

  • os error 5

  • plugin_cache_windows_file_lock

3. marketplace.json 丢失

导致整个插件注册失败

评论