惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threatpost
aimingoo的专栏
aimingoo的专栏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tailwind CSS Blog
J
Java Code Geeks
博客园_首页
Google Online Security Blog
Google Online Security Blog
Hugging Face - Blog
Hugging Face - Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
I
Intezer
P
Palo Alto Networks Blog
V
Vulnerabilities – Threatpost
雷峰网
雷峰网
O
OpenAI News
SecWiki News
SecWiki News
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
N
News | PayPal Newsroom
Project Zero
Project Zero
Forbes - Security
Forbes - Security
IT之家
IT之家
A
Arctic Wolf
WordPress大学
WordPress大学
Jina AI
Jina AI
T
Tor Project blog
博客园 - 三生石上(FineUI控件)
S
Secure Thoughts
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
博客园 - 聂微东
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Privacy International News Feed
Cloudbric
Cloudbric
G
GRAHAM CLULEY
博客园 - 叶小钗
H
Hacker News: Front Page
腾讯CDC
量子位
Help Net Security
Help Net Security
人人都是产品经理
人人都是产品经理
C
Cyber Attacks, Cyber Crime and Cyber Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
宝玉的分享
宝玉的分享
爱范儿
爱范儿
L
Lohrmann on Cybersecurity
Hacker News - Newest:
Hacker News - Newest: "LLM"
Recorded Future
Recorded Future
C
CERT Recently Published Vulnerability Notes

BlogFinder

日常漫步 Vol.24 之漫步前山河 - 雅余 周报 #1-聊聊本周的收获 - Edwin's Blog 我的OpenCode必装插件与Skill Write Something 掌中之物未必在掌握之中 · CRIVU PiliNara,一个更顺手的 PiliPlus 分支 「NekoEcho」:做一个必有回响的猫娘主题博客 2026-05 书影音总结 简化博客主题 - 安迪 我第一次发布 npm 包 拾花小记#45:中考前的二三事 – 小改学习志 黛西花园5月游 #18 枇杷又熟了的五月月报 一些奇奇怪怪的需求?word仿方正书版的几个小操作 - Xiobb's Blog 0419 御温泉之旅 修复了一些bug,网站基本上趋于稳定了 - 新锐博客 又回到四十年前 如何定义成功 迷鹿屋2026已重新上线 科技冰火两重天+一周回顾 ${title} 热度退了,我反而用得更深了-咕咚同学 我到底该不该换个域名? 随身WIFI折腾记 - 安迪 博客撰写体验提升——hexo pro插件 为什么不用相机把屏幕上的接关密码拍下来? 国清寺与天台山 – Ouroboros ★★★★☆《挽救计划》——久违的经济上行感 - Davidの3号基地 删除右键“打开方式”里多余选项 第三周刊_No.53|一切都会被支付两次 安卓APP通话记录与录音上传踩坑记录 - 子舒的博客 天量下跌 inBox 笔记 2.3.8,把工具栏交给了你-咕咚同学 我把小龙虾搬到了微信-咕咚同学 安好 - 响石潭 Compound Engineering Plugin:让每个工程单元都比上一个更容易 MOSS-TTS Family:开源高质量语音与声音生成模型家族深度解析 Crawl4AI:专为 LLM 设计的开源 Web 爬虫与数据抓取工具 Build Your Own X:从零实现你最喜欢的技术——程序员进阶的终极资源清单 Anthropic Skills:用文件夹教 Claude 专业技能的开源框架 1年的去月球(下) - 梅之夏 欢迎回来。 简单讲讲 ASN.1 与 OID DTV - 直播聚合客户端 5.22-5.27 – 不兴江 还没去过鸭川 – 不兴江 张晶晶同学三刷林志颖 关于我 – 不兴江 爱与嫉妒 – 不兴江 港股被持续做空 备案码花了四百块-咕咚同学 一句话生成封面:我给公众号做了4种风格的AI封面生成技能 「官」方認證 再谈费曼学习法 2026-05-28T00:34:11+08:00 2026-05-28T00:28:45+08:00 离谱的英语学习指南:基于AI的英语进阶系统方法论 iii:零集成架构的后端统一运行时 Claude Code Harness:让 Claude Code 工作有迹可循的工程化框架 Heretic:全自动移除大语言模型审查机制的开源工具 MarkItDown:微软开源的万能文档转 Markdown 利器 Harness:让 Claude Code 秒变多智能体协作工厂 这段时间尽折腾AI Agent了,确实极大地提高了效率 近期动态:两个新站点正式上线啦 误判解除!zhouayuan.com 腾讯安全申诉成功 - 周阿源|玩具设计・插画日常・生活随笔 Ralph:让 AI 编码工具自主循环跑完所有 PRD 任务的量产神器 全都违法 – 个人工作记录 关于zhouayuan.com被误判 “含违规信息” 的说明与申诉记录 - 周阿源|玩具设计・插画日常・生活随笔 小米 MiMo v2.5 Pro 白嫖 最大的人间清醒,兜里有钱,但是不花。 夜晚靓歌(12):于文文现场solo - 王志勇的Blog 今日插画:风扬起的倔强 - 周阿源|玩具设计・插画日常・生活随笔 回门习俗 独立网卡 - 忘记了回忆 500亿入股人工智能企业 从命令行到桌面智能体-咕咚同学 第一性原理读书笔记 行者微评论223-加班の守株待兔-博客|政治与时事-风雨行者 ZOZO开源物理接触求解器:GPU加速的可扩展仿真引擎 OpenStock:开源股票市场交易平台技术深度解析 MoneyPrinterTurbo:基于AI的全自动短视频生成工具深度解析 Claude-Mem:为 Claude Code 构建的持久化记忆压缩系统 Twenty:可代码化定制的企业级开源 CRM 平台技术深度解析 2026-05-26T22:59:17+08:00 企业级开源大模型部署平台 GPUStack 实战教程 1年的去月球(上) - 梅之夏 Sevalla - 静态网站托管服务 不用翻墙、不用注册、不用月费,普通人也能用上 Claude Code 装修灯具要注意⚠️ 黄梅天先锋 - 游子微博 公安备案顺利办结,站点备案全部完成 - 周阿源|玩具设计・插画日常・生活随笔 第三次兑换天猫超市卡了宗宗酱-三维狐少儿编程 Don't think, feel. - Rolen's Blog 人这一辈子,到底图个什么 博客迁移 - Edwin's Blog 情感赛道写作模板 再现本轮行情的典型特征 裁员与平常心-咕咚同学 别让“偷懒”,成为隐私泄露的破绽 片刻 - Jdeal | Life is like a Design.
「亲测有效」Windows Codex:computer use 和Chrome插件无法使用问题解决方案 - 文武科技柜
斌仔 · 2026-06-23 · via BlogFinder

文章目录

  • 📌 问题原因
  • 解决方案
  • 方案二:修复Chrome插件脚本
  • 其他排查建议
  • ✅ 验证修复成功
  • 参考来源

刚更新完 Windows Codex,满心欢喜想用 Computer Use 自动操作——结果插件页一片灰色,Chrome 扩展也毫无反应?别慌,这不是 bug,而是更新切换了插件目录和运行时状态,导致旧进程‘卡’在了过期的通信链路上。

作为踩过无数坑的技术博主,阿斌今天直接给你‘手术刀级’修复方案:让 Codex 自己诊断并重建插件环境。无需手动删文件、改配置,只需一条提示词,3分钟找回所有功能。

下面是原理拆解 + 实操步骤,跟着做,彻底告别插件‘玄学’故障。

Codex 浏览器插件不可用
Codex 浏览器插件不可用
Codex Computer Use 插件不可用
Codex Computer Use 插件不可用

📌 问题原因

  1. 半更新状态:更新时插件未完整解包,.tmp/bundled-marketplaces 目录残缺。
  2. Windows 文件锁:更新过程中文件被占用,导致 EBUSYresource busy or lockedplugin_cache_windows_file_lockos error 5 等错误。
  3. marketplace.json 丢失marketplace.json 文件不存在或损坏,导致整个插件注册失败。

解决方案

Windows 用户(MacOS暂时没有测试过)将下面内容复制直接发给 Codex 来进行修复,修复前请先关闭所有关于 Chrome 的进程

你现在要在 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`。只有日志明确出现 `os error 740` / `请求的操作需要提升` 时,才另行判断是否需要改 `sandbox = "unelevated"`;本提示词处理的是文件锁和 bundled 插件缓存损坏。
4. 不要暴露、打印或复制任何 API key、登录 token、auth.json 内容。
5. 如果你当前无法直接执行 Windows PowerShell,请生成可运行的 `.ps1` 修复脚本放到桌面,并告诉我用 PowerShell 执行。

---

1. 先收集路径

在 Windows PowerShell 中设置这些变量:

$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
  }
}

$StateFile = Join-Path $BackupDir "pre-repair-state.txt"
@(
  "BackupDir=$BackupDir",
  "CodexHome=$CodexHome",
  "BundledTmpRoot=$BundledTmpRoot",
  "PluginCacheRoot=$PluginCacheRoot",
  "",
  "Processes:",
  (Get-Process extension-host,codex-computer-use -ErrorAction SilentlyContinue | Format-Table -AutoSize | Out-String),
  "",
  "Bundled tmp listing:",
  (if (Test-Path -LiteralPath $BundledTmpRoot) { Get-ChildItem -LiteralPath $BundledTmpRoot -Force -Recurse -ErrorAction SilentlyContinue | Select-Object -First 200 FullName,Length | Format-Table -AutoSize | Out-String } else { "missing" }),
  "",
  "Chrome cache listing:",
  (if (Test-Path -LiteralPath $ChromeCacheRoot) { Get-ChildItem -LiteralPath $ChromeCacheRoot -Force -ErrorAction SilentlyContinue | Format-Table -AutoSize | Out-String } else { "missing" }),
  "",
  "Computer Use cache listing:",
  (if (Test-Path -LiteralPath $ComputerUseCacheRoot) { Get-ChildItem -LiteralPath $ComputerUseCacheRoot -Force -ErrorAction SilentlyContinue | Format-Table -AutoSize | Out-String } else { "missing" })
) | Set-Content -LiteralPath $StateFile -Encoding UTF8

---

3. 判断是否属于 Windows 文件锁导致的 bundled 插件损坏

3.1 检查 Codex 插件状态

优先运行:

codex plugin marketplace list
codex plugin list

确认:

- `openai-bundled` marketplace 是否存在。
- `chrome@openai-bundled` 是否 installed / enabled。
- `computer-use@openai-bundled` 是否 installed / enabled。

如果 `codex` 命令因 WindowsApps alias 拒绝访问失败,请不要卡住,改为继续检查文件和日志。

3.2 检查 marketplace 文件和关键插件文件

Test-Path -LiteralPath $BundledMarketplaceJson
Test-Path -LiteralPath (Join-Path $BundledTmpRoot "plugins\chrome\.codex-plugin\plugin.json")
Test-Path -LiteralPath (Join-Path $BundledTmpRoot "plugins\chrome\scripts\browser-client.mjs")
Test-Path -LiteralPath (Join-Path $BundledTmpRoot "plugins\chrome\extension-host\windows\x64\extension-host.exe")
Test-Path -LiteralPath (Join-Path $BundledTmpRoot "plugins\computer-use\.codex-plugin\plugin.json")
Test-Path -LiteralPath (Join-Path $BundledTmpRoot "plugins\computer-use\scripts\computer-use-client.mjs")

如果 `marketplace.json` 缺失,或 `plugins\chrome` / `plugins\computer-use` 目录只有半截内容,说明 bundled marketplace 可能已损坏。

3.3 检查 latest 指向和缓存关键文件

$ChromeLatest = Join-Path $ChromeCacheRoot "latest"
$ComputerUseLatest = Join-Path $ComputerUseCacheRoot "latest"
Get-Item -LiteralPath $ChromeLatest -Force -ErrorAction SilentlyContinue | Format-List *
Get-Item -LiteralPath $ComputerUseLatest -Force -ErrorAction SilentlyContinue | Format-List *

Test-Path -LiteralPath (Join-Path $ChromeLatest "scripts\browser-client.mjs")
Test-Path -LiteralPath (Join-Path $ChromeLatest "extension-host\windows\x64\extension-host.exe")
Test-Path -LiteralPath (Join-Path $ComputerUseLatest "scripts\computer-use-client.mjs")
Test-Path -LiteralPath (Join-Path $ComputerUseLatest "node_modules\@oai\sky\bin\windows\codex-computer-use.exe")

异常特征:

- `latest` 指向 `%USERPROFILE%\.codex\.tmp\bundled-marketplaces\openai-bundled\plugins\chrome` 这类临时目录。
- 目标目录缺少 `scripts\browser-client.mjs`、`extension-host.exe`、`.codex-plugin\plugin.json`、插件图标等关键文件。

3.4 检查日志关键词

$LogRoots = @(
  (Join-Path $env:LOCALAPPDATA "Packages\OpenAI.Codex_2p2nqsd0c76g0\LocalCache\Local\Codex\Logs"),
  (Join-Path $CodexHome "sessions")
)

$Patterns = "EBUSY|resource busy or locked|plugin_cache_windows_file_lock|failed to back up plugin cache entry|failed to remove existing plugin cache entry|os error 5|拒绝访问|marketplace\.json.*does not exist|extension-host\\windows\\x64|Windows Computer Use helper paths are unavailable"

foreach ($root in $LogRoots) {
  if (Test-Path -LiteralPath $root) {
    Get-ChildItem -LiteralPath $root -Recurse -File -ErrorAction SilentlyContinue |
      Sort-Object LastWriteTime -Descending |
      Select-Object -First 80 |
      Select-String -Pattern $Patterns -AllMatches -ErrorAction SilentlyContinue |
      Select-Object Path,LineNumber,Line |
      Format-List
  }
}

如果同时满足下面多项,基本可以确认是本问题:

- 插件页报 `marketplace.json does not exist`。
- 图标不加载。
- `openai-bundled` 的 `.tmp\bundled-marketplaces` 目录缺文件。
- 日志出现 `EBUSY` / `resource busy or locked` / `plugin_cache_windows_file_lock` / `os error 5`。
- 锁相关路径涉及 `extension-host.exe` 或 `extension-host\windows\x64`。

如果主要错误是 `os error 740` / `请求的操作需要提升` / `windows sandbox failed: spawn setup refresh`,先停止本流程,改查 Windows sandbox 权限问题。

---

4. 如果确认是 Windows 文件锁导致的问题,执行修复

4.1 停止可能锁目录的残留进程

先提醒我关闭 Chrome。随后停止这些后台进程:

Get-Process extension-host -ErrorAction SilentlyContinue | Stop-Process -Force
Get-Process codex-computer-use -ErrorAction SilentlyContinue | Stop-Process -Force
Start-Sleep -Seconds 2

不要强杀当前 Codex Desktop 主进程,除非我明确同意;否则可能中断当前会话。

4.2 找到 Codex 安装包里的完整 openai-bundled 源

$BundledSource = $null
$PackageRoots = Get-ChildItem -LiteralPath (Join-Path $env:ProgramFiles "WindowsApps") -Directory -ErrorAction SilentlyContinue |
  Where-Object { $_.Name -like "OpenAI.Codex_*_x64__2p2nqsd0c76g0" } |
  Sort-Object LastWriteTime -Descending

foreach ($pkg in $PackageRoots) {
  $candidate = Join-Path $pkg.FullName "app\resources\plugins\openai-bundled"
  if (Test-Path -LiteralPath (Join-Path $candidate ".agents\plugins\marketplace.json")) {
    $BundledSource = $candidate
    break
  }
}

if (-not $BundledSource) {
  throw "找不到 Codex 安装包中的 openai-bundled 源目录,请先确认 Codex Desktop 已安装且 WindowsApps 可访问。"
}

"Bundled source: $BundledSource"

源目录必须包含:

Test-Path -LiteralPath (Join-Path $BundledSource ".agents\plugins\marketplace.json")
Test-Path -LiteralPath (Join-Path $BundledSource "plugins\chrome\.codex-plugin\plugin.json")
Test-Path -LiteralPath (Join-Path $BundledSource "plugins\computer-use\.codex-plugin\plugin.json")

4.3 读取插件版本

function Get-PluginVersion([string]$PluginDir) {
  $pluginJson = Join-Path $PluginDir ".codex-plugin\plugin.json"
  if (-not (Test-Path -LiteralPath $pluginJson)) {
    throw "缺少 plugin.json: $pluginJson"
  }
  $json = Get-Content -LiteralPath $pluginJson -Raw | ConvertFrom-Json
  if (-not $json.version) {
    throw "plugin.json 中缺少 version: $pluginJson"
  }
  return [string]$json.version
}

$ChromeVersion = Get-PluginVersion (Join-Path $BundledSource "plugins\chrome")
$ComputerUseVersion = Get-PluginVersion (Join-Path $BundledSource "plugins\computer-use")
"ChromeVersion=$ChromeVersion"
"ComputerUseVersion=$ComputerUseVersion"

4.4 重建损坏的 bundled marketplace

Get-Process extension-host -ErrorAction SilentlyContinue | Stop-Process -Force
Get-Process codex-computer-use -ErrorAction SilentlyContinue | Stop-Process -Force
Start-Sleep -Seconds 2

if (Test-Path -LiteralPath $BundledTmpRoot) {
  Remove-Item -LiteralPath $BundledTmpRoot -Recurse -Force -ErrorAction Stop
}

New-Item -ItemType Directory -Force -Path (Split-Path -Parent $BundledTmpRoot) | Out-Null
Copy-Item -LiteralPath $BundledSource -Destination $BundledTmpRoot -Recurse -Force

复制后校验:

Get-Content -LiteralPath $BundledMarketplaceJson -Raw | ConvertFrom-Json | Out-Null
Test-Path -LiteralPath (Join-Path $BundledTmpRoot "plugins\chrome\scripts\browser-client.mjs")
Test-Path -LiteralPath (Join-Path $BundledTmpRoot "plugins\chrome\extension-host\windows\x64\extension-host.exe")
Test-Path -LiteralPath (Join-Path $BundledTmpRoot "plugins\computer-use\scripts\computer-use-client.mjs")

4.5 重建 chrome / computer-use cache

$ChromeSource = Join-Path $BundledSource "plugins\chrome"
$ComputerUseSource = Join-Path $BundledSource "plugins\computer-use"
$ChromeVersionDir = Join-Path $ChromeCacheRoot $ChromeVersion
$ComputerUseVersionDir = Join-Path $ComputerUseCacheRoot $ComputerUseVersion

New-Item -ItemType Directory -Force -Path $ChromeCacheRoot | Out-Null
New-Item -ItemType Directory -Force -Path $ComputerUseCacheRoot | Out-Null

if (Test-Path -LiteralPath $ChromeVersionDir) {
  Remove-Item -LiteralPath $ChromeVersionDir -Recurse -Force
}
if (Test-Path -LiteralPath $ComputerUseVersionDir) {
  Remove-Item -LiteralPath $ComputerUseVersionDir -Recurse -Force
}

Copy-Item -LiteralPath $ChromeSource -Destination $ChromeVersionDir -Recurse -Force
Copy-Item -LiteralPath $ComputerUseSource -Destination $ComputerUseVersionDir -Recurse -Force

重建 latest,优先使用 junction;如果失败则复制成普通目录:

function Reset-Latest([string]$LatestPath, [string]$TargetPath) {
  if (Test-Path -LiteralPath $LatestPath) {
    Remove-Item -LiteralPath $LatestPath -Recurse -Force
  }
  cmd /c mklink /J "`"$LatestPath`"" "`"$TargetPath`"" | Out-Null
  if (-not (Test-Path -LiteralPath $LatestPath)) {
    Copy-Item -LiteralPath $TargetPath -Destination $LatestPath -Recurse -Force
  }
}

Reset-Latest (Join-Path $ChromeCacheRoot "latest") $ChromeVersionDir
Reset-Latest (Join-Path $ComputerUseCacheRoot "latest") $ComputerUseVersionDir

验证 latest 实际指向稳定版本目录,而不是 .tmp 或其他临时路径:

function Assert-LatestTarget([string]$LatestPath, [string]$ExpectedTarget) {
  $item = Get-Item -LiteralPath $LatestPath -Force -ErrorAction SilentlyContinue
  if (-not $item) {
    throw "latest 不存在: $LatestPath"
  }
  $actualTarget = $item.Target
  if (-not $actualTarget) {
    $keyFile = Join-Path $LatestPath "scripts"
    if (-not (Test-Path -LiteralPath $keyFile)) {
      throw "latest 是普通目录但缺少关键内容: $LatestPath"
    }
    "latest OK (plain dir): $LatestPath"
    return
  }
  if ($actualTarget -like "*\.tmp\bundled-marketplaces\*") {
    throw "latest 仍然指向 .tmp 临时目录,修复未生效: $actualTarget"
  }
  if ($actualTarget -like "*\chrome\latest*" -or $actualTarget -like "*\computer-use\latest*") {
    throw "latest 指向自身或循环引用: $actualTarget"
  }
  "latest OK (junction -> $actualTarget): $LatestPath"
}

Assert-LatestTarget (Join-Path $ChromeCacheRoot "latest") $ChromeVersionDir
Assert-LatestTarget (Join-Path $ComputerUseCacheRoot "latest") $ComputerUseVersionDir

校验关键文件:

$RequiredFiles = @(
  (Join-Path $ChromeVersionDir ".codex-plugin\plugin.json"),
  (Join-Path $ChromeVersionDir "scripts\browser-client.mjs"),
  (Join-Path $ChromeVersionDir "extension-host\windows\x64\extension-host.exe"),
  (Join-Path $ChromeVersionDir "assets\google-chrome.png"),
  (Join-Path $ComputerUseVersionDir ".codex-plugin\plugin.json"),
  (Join-Path $ComputerUseVersionDir "scripts\computer-use-client.mjs"),
  (Join-Path $ComputerUseVersionDir "node_modules\@oai\sky\bin\windows\codex-computer-use.exe"),
  (Join-Path $ComputerUseVersionDir "assets\app-icon.png")
)

$Missing = $RequiredFiles | Where-Object { -not (Test-Path -LiteralPath $_) }
if ($Missing.Count -gt 0) {
  throw "修复后仍缺少关键文件:`n$($Missing -join "`n")"
}

4.6 修复 Chrome native host JSON

$ExtensionHostExe = Join-Path $ChromeVersionDir "extension-host\windows\x64\extension-host.exe"
if (-not (Test-Path -LiteralPath $ExtensionHostExe)) {
  throw "找不到 extension-host.exe: $ExtensionHostExe"
}

function Write-JsonNoBom([string]$Path, $Object) {
  $jsonText = $Object | ConvertTo-Json -Depth 20
  [System.IO.File]::WriteAllText($Path, $jsonText, [System.Text.UTF8Encoding]::new($false))
}

foreach ($jsonPath in @($ExtensionManifest, $CodexNativeHosts, $LocalNativeHosts)) {
  if (-not (Test-Path -LiteralPath $jsonPath)) {
    continue
  }
  $obj = Get-Content -LiteralPath $jsonPath -Raw | ConvertFrom-Json
  $changed = $false

  if ($obj.path -and (($obj.path -like "*\chrome\latest\*") -or ($obj.path -like "*\.tmp\bundled-marketplaces\*"))) {
    $obj.path = $ExtensionHostExe
    $changed = $true
  }

  if ($changed) {
    Write-JsonNoBom $jsonPath $obj
  } else {
    Write-JsonNoBom $jsonPath $obj
  }
}

4.7 确认插件启用状态

检查 `$CodexHome\config.toml` 中是否存在这些插件配置。如果已经存在并 enabled,不要重复改:

[plugins."chrome@openai-bundled"]
enabled = true

[plugins."computer-use@openai-bundled"]
enabled = true

[plugins."browser@openai-bundled"]
enabled = true

如果插件缺失或 disabled,再备份后最小化修复。不要改模型 provider、API key、登录态或无关项目配置。

---

5. 最终验证

Get-Content -LiteralPath $BundledMarketplaceJson -Raw | ConvertFrom-Json | Out-Null

Test-Path -LiteralPath (Join-Path $BundledTmpRoot "plugins\chrome\assets\google-chrome.png")
Test-Path -LiteralPath (Join-Path $BundledTmpRoot "plugins\computer-use\assets\app-icon.png")
Test-Path -LiteralPath (Join-Path $ChromeCacheRoot "latest\scripts\browser-client.mjs")
Test-Path -LiteralPath (Join-Path $ChromeCacheRoot "latest\extension-host\windows\x64\extension-host.exe")
Test-Path -LiteralPath (Join-Path $ComputerUseCacheRoot "latest\scripts\computer-use-client.mjs")
Test-Path -LiteralPath (Join-Path $ComputerUseCacheRoot "latest\node_modules\@oai\sky\bin\windows\codex-computer-use.exe")

验证 native host JSON 不再指向 chrome\latest 或 .tmp:

foreach ($jsonPath in @($ExtensionManifest, $CodexNativeHosts, $LocalNativeHosts)) {
  if (-not (Test-Path -LiteralPath $jsonPath)) { continue }
  $content = Get-Content -LiteralPath $jsonPath -Raw
  if ($content -match [regex]::Escape("\chrome\latest\") -or $content -match [regex]::Escape("\.tmp\bundled-marketplaces\")) {
    throw "native host JSON 仍然指向不稳定路径: $jsonPath"
  }
  "NativeHost path OK: $jsonPath"
}

foreach ($jsonPath in @($ExtensionManifest, $CodexNativeHosts, $LocalNativeHosts)) {
  if (Test-Path -LiteralPath $jsonPath) {
    Get-Content -LiteralPath $jsonPath -Raw | ConvertFrom-Json | Out-Null"JSON OK: $jsonPath"
  }
}

如果可用,再运行:

codex plugin marketplace list
codex plugin list

重启 Codex Desktop 后,确认:

- 插件页可以打开 `Chrome` 和 `Computer Use`。
- 插件图标恢复。
- `computer-use@openai-bundled` 和 `chrome@openai-bundled` 是 installed / enabled。
- 设置页 Computer Use 不再显示 unavailable。

---

6. 最终回复要求

请最后告诉我:

1. 是否确认这是 Windows 文件锁导致的 bundled 插件半更新。
2. 证据是什么,例如日志中的 `EBUSY` / `plugin_cache_windows_file_lock` / `os error 5` / `marketplace.json does not exist`。
3. 备份目录在哪里。
4. 实际改了哪些文件或目录。
5. 哪些验证通过。
6. 如果没有修复,请明确卡在哪一步,不要假装已修好。

方案二:修复Chrome插件脚本

  1. 下载 修复Chrome插件脚本 并解压

  2. repair-codex-plugins.ps1修复Codex插件.cmd 放到 C:\Users\用户名\.codex\tools 文件夹下

  3. 双击 修复Codex插件.cmd 文件

    修复Codex插件.cmd界面
    修复Codex插件.cmd界面
  4. 可以先选择 1 检查插件状态

  5. 再选择 3 执行修复

其他排查建议

  1. 检查 Chrome 扩展:确认 Chrome 中 Codex 扩展已安装并启用。
  2. 使用 Codex CLI 检查:运行 codex plugin marketplace listcodex plugin list 查看插件状态。
  3. 检查日志:Codex 桌面端日志位于 %LOCALAPPDATA%\Packages\OpenAI.Codex_*\LocalCache\Local\Codex\Logs,查看是否有 EBUSYresource busy or locked 等错误。
  4. 修改 config.toml:如果 marketplace source 指向残缺目录,可修改 %USERPROFILE%\.codex\config.toml,将 source 改为 %USERPROFILE%\.codex\plugins\cache\openai-bundled\marketplace-source

✅ 验证修复成功

修复后重启 Codex Desktop,确认:

  • 插件页可以打开 ChromeComputer Use
  • 插件图标恢复
  • computer-use@openai-bundledchrome@openai-bundledinstalled / enabled
  • 设置页 Computer Use 不再显示 unavailable

参考来源