node_repl sandbox initialization crashes after updating to the Codex Windows Store version (os error 740)
环境:
Codex 版本:通过 Microsoft Store 安装的 OpenAI.Codex_26.601.2237.0
Windows 版本:Windows 11
安装方式:从旧版 CLI 安装升级到 Microsoft Store 版
问题:
更新到 Store 版后,node_repl MCP 的 sandbox 初始化在每次 kernel 启动时崩溃:windows sandbox failed: spawn setup refresh
根因(已排查):
node_repl.exe 在 %LOCALAPPDATA%\OpenAI\Codex\bin\34ab3e1324cc55b5\(旧 CLI 安装遗留)
Sandbox 初始化试图 spawn %LOCALAPPDATA%\OpenAI\Codex\bin\716dda49c14d31a0\codex-windows-sandbox-setup.exe
Store 容器对该路径的二进制无提权权限:os error 740(请求的操作需要提升权限)
主 Codex 进程的 setup_refresh 使用 WindowsApp 内建版本(C:\Program Files\WindowsApps\...\app\resources\codex-windows-sandbox-setup.exe)通过 payload 机制可以成功提权
但 node_repl kernel 没有这个 fallback,只有一个直接 spawn 路径,导致崩溃
影响:
Computer Use 插件不可用(依赖 nodeRepl.nativePipe.createConnection)
Chrome 插件的部分 node_repl 后端功能受限
内置浏览器也可能受影响
Sandbox 日志关键片段codex.exe setup refresh: spawning ...\bin\...\codex-windows-sandbox-setup.exe
codex.exe setup refresh: failed to spawn ... (os error 740)
已尝试的修复方法
修改 CODEX_CLI_PATH 指向 WindowsApp 版 codex.exe —— 主进程正常,node_repl 仍崩溃
在 node_repl 目录和 bin 目录补充 codex-windows-sandbox-setup.exe —— 无效(同一二进制在不同路径的 spawn 行为不同)
将 sandbox 从 elevated 改为 none 绕过(由于安全策略未实施)
清理 bin 目录旧版本文件 —— 无效,kernel 使用硬编码路径
建议修复
让 node_repl kernel 的 sandbox 初始化使用与主 Codex 进程相同的 setup_refresh payload 机制
或使用 WindowsApp 内建的 codex-windows-sandbox-setup.exe 路径作为默认 fallback
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗