Skip to content

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

Closed

Description

@AI-exploring

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.

  2. 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.

  2. Reopen Codex Desktop.

  3. Start a new thread in the same workspace.

  4. 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.

  2. Run the same JavaScript / node_repl smoke test.

  3. 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.

Activity

  1. added
    appIssues related to the Codex desktop app
    on May 27, 2026
  2. added
    bugSomething isn't working
    windows-osIssues related to Codex on Windows systems
    mcpIssues related to the use of model context protocol (MCP) servers
    configIssues involving config.toml, config keys, config merging, or config updates
    sandboxIssues related to permissions or sandboxing
    on May 27, 2026
  3. horikoshi-star commented on May 27, 2026

    @horikoshi-star

    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.
  4. horikoshi-star commented on May 27, 2026

    @horikoshi-star

    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

  5. MaxxxDong commented on May 29, 2026

    @MaxxxDong

    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:
      [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:
      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:
      codex.exe sandbox windows powershell.exe -NoProfile -Command "Write-Output sandbox-ok"
      Result:
      windows sandbox failed: spawn setup refresh
      
    • The sandbox log shows the concrete underlying error:
      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.
  6. SL-derick-chang commented on May 29, 2026

    @SL-derick-chang

    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.

  7. cedric-albeke commented on Jun 2, 2026

    @cedric-albeke

    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.

    2. 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.

  8. iceweasel-oai commented on Jun 12, 2026

    @iceweasel-oai
    Contributor

    this is now fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingconfigIssues involving config.toml, config keys, config merging, or config updatesmcpIssues related to the use of model context protocol (MCP) serverssandboxIssues related to permissions or sandboxingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions