Codex Desktop on Windows ignores mcp_servers.node_repl args/command; node_repl fails with windows sandbox failed: spawn setup refresh

Resolved 💬 7 comments Opened May 27, 2026 by AI-exploring Closed Jun 12, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using (From “About Codex” dialog)?

26.519.10634.0

What subscription do you have?

plus

What platform is your computer?

Windows 10 Home, 64-bit, AMD64

What issue are you seeing?

Codex Desktop on Windows is ignoring mcp_servers.node_repl config.

Environment:

  • Windows
  • Codex app path: C:\Program Files\WindowsApps\OpenAI.Codex_26.519.10634.0_x64__2p2nqsd0c76g0
  • Workspace: C:\Users\dkxha\OneDrive\문서\Max Leak Detection Website

Problem:
The JavaScript / node_repl runtime fails immediately with:

windows sandbox failed: spawn setup refresh
reason: stdout_eof

I updated C:\Users\dkxha\.codex\config.toml:

[mcp_servers.node_repl]
args = ["--disable-sandbox"]
command = 'C:\Users\dkxha\AppData\Local\OpenAI\Codex\bin\3c238e29bbc930ff\node_repl.exe'

After fully restarting Codex, node_repl.exe still launches without --disable-sandbox.

Verified with process command line:
"C:\Users\dkxha\AppData\Local\OpenAI\Codex\bin\3c238e29bbc930ff\node_repl.exe"

Expected:
node_repl.exe should launch with --disable-sandbox.

Also tested wrapper workaround:
command = 'C:\Users\dkxha\.codex\node_repl\node_repl_wrapper.cmd'
args = []

Codex still launched the original node_repl.exe directly, ignoring the configured command path.

Conclusion:
mcp_servers.node_repl args and command appear to be ignored or overridden by an internal hardcoded launcher path.

What steps can reproduce the bug?

  1. Use Codex Desktop on Windows.
  1. Edit:

C:\Users\dkxha\.codex\config.toml

  1. Configure node_repl like this:

[mcp_servers.node_repl]
args = ["--disable-sandbox"]
command = 'C:\Users\dkxha\AppData\Local\OpenAI\Codex\bin\3c238e29bbc930ff\node_repl.exe'
startup_timeout_sec = 120

  1. Fully quit Codex Desktop.
  1. Reopen Codex Desktop.
  1. Start a new thread in the same workspace.
  1. Run a minimal JavaScript / node_repl smoke test:

nodeRepl.write('js-ok')

  1. The node_repl runtime fails immediately with:

node_repl kernel exited unexpectedly
windows sandbox failed: spawn setup refresh
reason: stdout_eof

  1. Check the live Windows process command line for node_repl.exe.

Observed command line:

"C:\Users\dkxha\AppData\Local\OpenAI\Codex\bin\3c238e29bbc930ff\node_repl.exe"

Expected command line:

"C:\Users\dkxha\AppData\Local\OpenAI\Codex\bin\3c238e29bbc930ff\node_repl.exe" --disable-sandbox

  1. As an additional test, change config.toml to use a wrapper command:

[mcp_servers.node_repl]
args = []
command = 'C:\Users\dkxha\.codex\node_repl\node_repl_wrapper.cmd'

  1. The wrapper contains:

@echo off
"C:\Users\dkxha\AppData\Local\OpenAI\Codex\bin\3c238e29bbc930ff\node_repl.exe" --disable-sandbox

  1. Fully quit and reopen Codex again.
  1. Run the same JavaScript / node_repl smoke test.
  1. Codex still launches the original node_repl.exe directly instead of the configured wrapper command.

Observed result:
mcp_servers.node_repl args and command appear to be ignored or overridden by an internal launcher path.

What is the expected behavior?

Codex Desktop should respect the configured MCP server command and arguments in C:\Users\dkxha\.codex\config.toml.

When this config is present:

[mcp_servers.node_repl]
args = ["--disable-sandbox"]
command = 'C:\Users\dkxha\AppData\Local\OpenAI\Codex\bin\3c238e29bbc930ff\node_repl.exe'

Codex should launch node_repl.exe with the configured argument:

node_repl.exe --disable-sandbox

If the command path is changed to a wrapper script, Codex should launch that configured wrapper command instead of continuing to launch the original node_repl.exe path.

The JavaScript runtime should start successfully, and Chrome/browser automation that depends on node_repl should be able to connect.

Additional information

This blocks Chrome/browser automation because the JavaScript runtime fails before Chrome can be tested.

Observed runtime error:

node_repl kernel exited unexpectedly
windows sandbox failed: spawn setup refresh
reason: stdout_eof

I verified the live process command line after restarting Codex. Even though config.toml contains args = ["--disable-sandbox"], the actual process command line was:

"C:\Users\dkxha\AppData\Local\OpenAI\Codex\bin\3c238e29bbc930ff\node_repl.exe"

The --disable-sandbox argument was not present.

I also tested a wrapper workaround:

[mcp_servers.node_repl]
args = []
command = 'C:\Users\dkxha\.codex\node_repl\node_repl_wrapper.cmd'

The wrapper script ran the original executable with --disable-sandbox, but after restart Codex still launched the original node_repl.exe directly instead of the configured wrapper command.

This suggests mcp_servers.node_repl args and command are ignored or overridden by an internal launcher path in Codex Desktop on Windows.

View original on GitHub ↗

7 Comments

github-actions[bot] contributor · 1 month ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #24718
  • #24387
  • #24101
  • #24416

Powered by Codex Action

horikoshi-star · 1 month ago

I am seeing the same issue on Codex Desktop for Windows.

Codex App version:
26.519.11010.0

Platform:
Windows

Error:
node_repl kernel exited unexpectedly
windows sandbox failed: spawn setup refresh
reason: stdout_eof

Impact:
Chrome plugin/browser automation cannot connect because node_repl fails before it can list tabs.

Additional checks:

  • Codex Chrome Extension is installed and enabled in Chrome Default profile.
  • Native messaging host manifest exists:

C:\Users\ryoui\AppData\Local\OpenAI\extension\com.openai.codexextension.json

  • HKCU registry key exists:

HKCU\Software\Google\Chrome\NativeMessagingHosts\com.openai.codexextension

  • Opening Chrome Default profile via the plugin script succeeds.
horikoshi-star · 1 month ago

Update: Running Codex Desktop as Administrator makes Chrome plugin/node_repl work on my machine. Without Administrator, node_repl fails with:
windows sandbox failed: spawn setup refresh

MaxxxDong · 1 month ago

Adding another reproduction from Codex Desktop on Windows that matches this issue.

Environment:

  • Codex App package: OpenAI.Codex_26.519.11010.0_x64__2p2nqsd0c76g0
  • Bundled Codex CLI used by the runtime: codex-cli 0.133.0
  • Chrome / Browser plugin cache version observed: 26.519.81530
  • Windows native agent / PowerShell environment

What I verified locally:

  • ~/.codex/config.toml contains:

``toml
[mcp_servers.node_repl]
args = ["--disable-sandbox"]
command = '...\\node_repl.exe'
``

  • node_repl.exe --help confirms --disable-sandbox is a supported option.
  • After fully restarting Codex Desktop multiple times, live node_repl.exe processes are still launched without --disable-sandbox.
  • Minimal node_repl JS fails before any browser work:

``text
node_repl kernel exited unexpectedly
node_repl diagnostics: {"kernel_stderr_tail":"windows sandbox failed: spawn setup refresh","reason":"stdout_eof"}
``

  • Direct bundled CLI sandbox smoke test also fails in the default/elevated path:

``powershell
codex.exe sandbox windows powershell.exe -NoProfile -Command "Write-Output sandbox-ok"
`
Result:
`text
windows sandbox failed: spawn setup refresh
``

  • The sandbox log shows the concrete underlying error:

``text
setup refresh: failed to spawn ...\\codex-windows-sandbox-setup.exe: The requested operation requires elevation. (os error 740)
``

Important distinction:

  • Chrome itself appears healthy.
  • Codex Chrome Extension is installed and enabled in the active Chrome profile.
  • Native messaging host manifest and HKCU registry entry are correct.
  • The Chrome native host is able to start extension-host.exe.
  • The failure happens below Chrome/browser-client: node_repl cannot start its kernel because the Windows sandbox setup-refresh path fails.

Workaround verification:
Running the same bundled CLI with windows.sandbox="unelevated" succeeds:

codex.exe -c 'windows.sandbox="unelevated"' sandbox windows powershell.exe -NoProfile -Command "Write-Output sandbox-unelevated-ok"

Output:

sandbox-unelevated-ok

So this looks like two linked problems:

  1. Codex Desktop ignores or bypasses the user-defined mcp_servers.node_repl.command / args for this plugin-provided Node REPL path.
  2. The hardcoded/default Node REPL path then hits the elevated Windows sandbox spawn setup refresh / os error 740 failure, which makes Chrome/browser automation appear unavailable even though the Chrome extension and native host are healthy.
SL-derick-chang · 1 month ago

I can reproduce what looks like the same failure on Codex Desktop for Windows.

Environment:

Codex Desktop package: OpenAI.Codex_26.519.11010.0_x64__2p2nqsd0c76g0
Codex CLI path from config: C:\Users\user\AppData\Local\OpenAI\Codex\bin\958d608b5e0546a5\codex.exe
codex.exe --version: codex-cli 0.133.0
Node REPL executable: C:\Users\user\AppData\Local\OpenAI\Codex\bin\3c238e29bbc930ff\node_repl.exe
Node path: C:\Users\user\AppData\Local\OpenAI\Codex\bin\5b9024f90663758b\node.exe
Workspace: D:\codex
Windows sandbox config: [windows] sandbox = "elevated"
Minimal repro:

Start Codex Desktop on Windows.

Run a minimal Node REPL MCP call:

nodeRepl.write('ok')
The kernel exits before running the JS:

node_repl kernel exited unexpectedly
node_repl diagnostics: {"kernel_status":"running","kernel_stderr_tail":"windows sandbox failed: spawn setup refresh","reason":"stdout_eof","stream_error":null}
Sandbox log root cause:

[2026-05-29 23:52:30.790 codex.exe] START: C:\Users\user\AppData\Local\OpenAI\Codex\bin\5b9024f90663758b\node.exe --experimental-vm-modules C:\Users\DERICK~1.CHA\AppData\Local\Temp\.tmpo5Xsa5\kernel.js --session-id 6a423ef8e6124c3184cb
[2026-05-29 23:52:30.860 codex.exe] setup refresh: spawning C:\Users\user\AppData\Local\OpenAI\Codex\bin\958d608b5e0546a5\codex-windows-sandbox-setup.exe (cwd=D:\codex, payload_len=4428)
[2026-05-29 23:52:30.865 codex.exe] setup refresh: failed to spawn C:\Users\user\AppData\Local\OpenAI\Codex\bin\958d608b5e0546a5\codex-windows-sandbox-setup.exe: 要求的作業需要提升的權限。 (os error 740)
What I tried:

js_reset, then reran nodeRepl.write('ok'): same failure.

Fully restarted Codex Desktop: same failure.

Set:

[mcp_servers.node_repl]
args = ["--disable-sandbox"]
After restart, the actual process command line was still:

"C:\Users\user\AppData\Local\OpenAI\Codex\bin\3c238e29bbc930ff\node_repl.exe"
The --disable-sandbox argument was not present.

Restarted Codex Desktop in administrator mode: nodeRepl.write('ok') succeeds, and runtime metadata is available:

{
"model": "gpt-5.5",
"sandbox": "windows_elevated"
}
This suggests two related issues:

The Node REPL kernel launch path still tries to run codex-windows-sandbox-setup.exe from the user-local 958d608b5e0546a5 CLI bundle, which fails with Windows os error 740.
Codex Desktop appears to ignore mcp_servers.node_repl.args, so users cannot work around this by passing the built-in --disable-sandbox option.
Running Codex Desktop as administrator is a workaround, but the non-admin failure mode is not obvious from the surfaced Node REPL error.
Normal shell tool calls still succeed through the WindowsApps helper path:

setup refresh: spawning C:\Program Files\WindowsApps\OpenAI.Codex_26.519.11010.0_x64__2p2nqsd0c76g0\app\resources\codex-windows-sandbox-setup.exe
setup refresh: processed 2 write roots (read roots delegated); errors=[]
setup binary completed
So the failure seems specific to the Node REPL kernel launch path / MCP launcher config handling rather than all sandboxed shell commands.

cedric-albeke · 1 month ago

Adding another data point from Windows Codex Desktop, but with a stability/performance workaround rather than only a browser-control workaround.

Environment:

  • Windows 11 Pro
  • Store package: OpenAI.Codex_26.527.7698.0_x64__2p2nqsd0c76g0
  • Main bundled runtime observed: codex-cli 0.128.0
  • node_repl.exe path was under %LOCALAPPDATA%\OpenAI\Codex\bin\34ab3e1324cc55b5\node_repl.exe

Observed behavior:

  • Codex Desktop became increasingly unstable after the 26.527 update: frozen chats, new chats failing to create, and repeated app restarts not clearing the condition.
  • RAM was not the bottleneck: after reboot the machine still had ~49 GB free.
  • node_repl.exe was spawned even after setting plugin/browser-related config off.
  • After restart, the explicit enabled = false I added under [mcp_servers.node_repl] was gone/ignored; the live process still launched as only node_repl.exe, with no useful user-provided args.
  • Each node_repl.exe spawned its own child codex.exe app-server --listen stdio://.

Mitigation that materially improved stability:

  1. Disable the bundled browser/computer-use plugin:
[plugins."browser@openai-bundled"]
enabled = false
  1. Stop running node_repl.exe processes and their direct child codex.exe app-server --listen stdio:// processes.
  1. Reversibly rename the local node_repl.exe launchers so Desktop cannot respawn them:
%LOCALAPPDATA%\OpenAI\Codex\bin\34ab3e1324cc55b5\node_repl.exe
%LOCALAPPDATA%\OpenAI\Codex\bin\node_repl.exe

to e.g.

node_repl.exe.disabled-YYYYMMDD-HHMMSS

Impact:

  • Internal browser/computer-use automation is disabled/broken by this workaround.
  • External browsers and normal Codex chat/task execution continue to work.
  • After doing this, the app became dramatically more stable and agents became much faster at processing tasks.

This supports the theory that Desktop is not honoring the user-visible mcp_servers.node_repl config for this path, and that the hardcoded/internal node_repl launcher can become a major stability/performance problem beyond just breaking browser control.

iceweasel-oai contributor · 1 month ago

this is now fixed