Codex Computer Use Plugin 不可用摘要本文详细分析了 Codex 桌面应用中 Computer Use 功能不可用的故障现象、根本原因及完整修复方案。问题根源在于 Codex 的插件同步机制未能正确将computer-use插件和cua_node运行时从 WindowsApps 应用包部署到用户数据目录。修复方案包括手动复制缺失文件、运行修复脚本、验证关键文件结构并提供标准操作流程、手动操作步骤及故障排查清单。文章还包含详细的架构图、目录权限说明和文件结构参考帮助用户彻底解决此问题。日期: 2026-07-01场景: Codex 桌面应用中 Computer Use 功能无法启动相关版本: Codex 桌面应用26.623.11225/ 插件26.623.618251. 问题现象在 Codex 会话中尝试使用 Computer Use 功能控制 Windows 桌面应用时提示无法连接或功能不可用。oai/sky模块找不到或者 native pipe 无法创建连接。具体表现为setupComputerUseRuntime()启动时报错Computer Use native pipe is unavailable找不到scripts/computer-use-client.mjs中的核心模块Node REPL 中无法 importoai/sky运行时2. 问题原因2.1 整体架构Codex 的 Computer Use 功能依赖两个核心组件┌─────────────────────────────────────────────────────────────────┐ │ WindowsApps 应用包 (只读) │ │ │ │ C:\Program Files\WindowsApps\OpenAI.Codex_26.623.11225.0_...\ │ │ ├── app\resources\cua_node\bin\ │ │ │ ├── node.exe (专用 Node.js 运行时) │ │ │ ├── node_repl.exe (Node REPL 宿主) │ │ │ └── node_modules\oai\sky\ (Computer Use Sky API) │ │ │ │ │ └── app\resources\plugins\openai-bundled\plugins\computer-use\│ │ ├── .codex-plugin\plugin.json (插件清单) │ │ ├── scripts\computer-use-client.mjs (入口脚本) │ │ └── skills\computer-use\SKILL.md (Skill 指令) │ └─────────────────────────────────────────────────────────────────┘ │ Codex 启动时自动同步 ▼ ┌─────────────────────────────────────────────────────────────────┐ │ 用户数据目录 (可读写) │ │ │ │ C:\Users\用户\.codex\plugins\cache\openai-bundled\ │ │ ├── browser\26.623.61825\ (✅ 已同步) │ │ └── computer-use\26.623.61825\ (❌ 缺失) │ │ │ │ C:\Users\用户\AppData\Local\OpenAI\Codex\runtimes\cua_node\ │ │ ├── node.exe (❌ 缺失) │ │ ├── node_repl.exe (❌ 缺失) │ │ └── node_modules\oai\sky (❌ 缺失) │ └─────────────────────────────────────────────────────────────────┘2.2 根因Codex 桌面应用的插件同步机制没有正确将computer-use插件和cua_node运行时从 WindowsApps 包部署到用户数据目录。已知可以正常同步的对比项browser插件已正确部署在plugins\cache\openai-bundled\browser\26.623.61825\。可能的原因Codex 首次启动时插件同步过程中断例如网络短暂中断、系统重启cua_node运行时部署因权限问题被阻止应用版本更新后增量同步未覆盖新插件2.3 目录权限说明两个目标目录的权限为用户/组权限CodexSandboxUsersReadAndExecute只读Junbai当前用户FullControl完全控制SYSTEM/AdministratorsFullControl关键约束Codex 的 sandbox 进程以CodexSandboxUsers身份运行该用户对目标目录只有读取权限。因此 sandbox 内的 agent 无法直接修复此问题需要用户以本人身份Junbai直接运行修复脚本。3. 修复方案3.1 原理从 WindowsApps 应用包中手动复制缺失的两个组件到用户数据目录组件源路径目标路径cua_node 运行时...\app\resources\cua_node\bin\%LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\computer-use 插件...\plugins\openai-bundled\plugins\computer-use\%USERPROFILE%\.codex\plugins\cache\openai-bundled\computer-use\26.623.61825\3.2 修复脚本参见同目录下的 fix-computer-use.ps1脚本功能使用robocopy递归复制cua_node运行时会话创建插件缓存目录并复制computer-use插件文件验证所有关键文件就位node.exe、node_repl.exe、plugin.json、computer-use-client.mjs、SKILL.md4. 操作步骤4.1 标准修复流程# 1. 完全退出 Codex 桌面应用# - 任务栏 Codex 图标右键 → 退出# - 或任务管理器结束所有 Codex.exe 进程# 2. 以当前用户身份打开 PowerShell不需要管理员# 进入工作区目录后cd D:\resource\automation-tools-Web# 3. 运行修复脚本powershell-ExecutionPolicy Bypass-File.\fix-computer-use.ps1# 4. 验证脚本输出确认所有文件安装成功# 5. 重启 Codex 桌面应用# 6. 尝试使用 Computer Use 功能4.2 手动操作不依赖脚本如果脚本无法运行可以手动执行以下操作# 定义源和目标路径$appPkgC:\Program Files\WindowsApps\OpenAI.Codex_26.623.11225.0_x64__2p2nqsd0c76g0$pluginVer26.623.61825# 1. 复制 cua_node 运行时robocopy$appPkg\app\resources\cua_node\bin$env:LOCALAPPDATA\OpenAI\Codex\runtimes\cua_node/E/R:2/W:3# 2. 复制 computer-use 插件robocopy$appPkg\app\resources\plugins\openai-bundled\plugins\computer-use$env:USERPROFILE\.codex\plugins\cache\openai-bundled\computer-use\$pluginVer/E/R:2/W:3# 3. 验证$checks ($env:LOCALAPPDATA\OpenAI\Codex\runtimes\cua_node\node.exe,$env:LOCALAPPDATA\OpenAI\Codex\runtimes\cua_node\node_repl.exe,$env:USERPROFILE\.codex\plugins\cache\openai-bundled\computer-use\$pluginVer\.codex-plugin\plugin.json,$env:USERPROFILE\.codex\plugins\cache\openai-bundled\computer-use\$pluginVer\scripts\computer-use-client.mjs)$checks|ForEach-Object{if(Test-Path$_){Write-HostOK:$_}else{Write-HostMISSING:$_}}4.3 彻底重置可选如果需要完全重置 Computer Use 环境# 1. 退出 Codex 后删除已失效的目录Remove-Item$env:LOCALAPPDATA\OpenAI\Codex\runtimes\cua_node-Recurse-Force-ErrorAction SilentlyContinueRemove-Item$env:USERPROFILE\.codex\plugins\cache\openai-bundled\computer-use-Recurse-Force-ErrorAction SilentlyContinue# 2. 重启电脑Restart-Computer# 3. 重新运行修复脚本5. 故障排查清单如果修复后仍无法使用 Computer Use请依次检查#检查项命令/方案1cua_node 运行时文件是否存在Get-ChildItem $env:LOCALAPPDATA\OpenAI\Codex\runtimes\cua_node -Recurse | Select-Object FullName2computer-use 插件缓存是否存在Get-ChildItem $env:USERPROFILE\.codex\plugins\cache\openai-bundled\computer-use -Recurse | Select-Object FullName3Codex 版本是否匹配检查$env:USERPROFILE\.codex\.codex-global-state.json中的版本信息4Codex 是否需要重启修复后必须重启 Codex 桌面应用5是否有其他插件冲突检查~\.codex\plugins\cache\openai-bundled\下是否有异常的空目录6. 文件结构参考修复后应确认的关键文件%LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\ ├── node.exe ├── node_repl.exe ├── nodevars.bat ├── npm / npm.cmd / npm.ps1 ├── npx / npx.cmd / npx.ps1 ├── CHANGELOG.md ├── LICENSE ├── README.md ├── setup.ps1 / setup.sh ├── corepack / corepack.cmd ├── install_tools.bat └── node_modules\ └── oai\ └── sky\ # 核心 Computer Use Sky API 模块 ├── dist\ │ └── project\cua\sky_js\src\targets\windows\internal\ │ └── computer_use_client_base.js └── ...%USERPROFILE%\.codex\plugins\cache\openai-bundled\computer-use\26.623.61825\ ├── .codex-plugin\ │ └── plugin.json # 插件清单名称、版本、描述、接口声明等 ├── assets\ │ └── app-icon.png # 应用图标 ├── scripts\ │ └── computer-use-client.mjs # 核心入口脚本启动 sky API └── skills\ └── computer-use\ └── SKILL.md # Skill 指令文件7. 一些技术细节computer-use-client.mjs通过 Node REPL 的nodeRepl.nativePipe.createConnection()建立 native pipe 通信Native pipe 路径由环境变量SKY_CUA_NATIVE_PIPE_DIRECTORY指定WindowsComputerUseClientBase从oai/sky包动态 import插件版本26.623.61825与 Codex 桌面应用版本26.623.11225同属一个发布轨道本文档供后续排查类似问题时参考。