Browser Use Node REPL fails in Windows Desktop app with WSL workspace due to unmapped sandboxCwd
Summary
Browser Use / Node REPL does not work in the Codex Windows Desktop app when the agent is configured to run in WSL and the project lives on the WSL filesystem. The Desktop app auto-generates a node_repl MCP server that runs a Windows node_repl.exe, but tool calls send a Linux/WSL sandboxCwd URI (file:///home/...). The Windows-side Node REPL rejects that path as not being a local file URI.
All paths below are anonymized.
Environment
- Codex Desktop app on Windows
- Agent configured to run in WSL2
- Integrated terminal configured as WSL
- WSL distro: Ubuntu 22.04
- Project path inside WSL:
/home/<user>/projects/<repo> - Windows view of same project:
\\wsl.localhost\Ubuntu-22.04\home\<user>\projects\<repo> CODEX_HOMEinside the WSL agent session:/mnt/c/Users/<windows-user>/.codex- Codex CLI from
codex doctor:Codex Doctor v0.142.0 · linux-x86_64 - Desktop/browser runtime version visible in generated MCP env:
BROWSER_USE_CODEX_APP_VERSION=26.616.71553 - Browser Use plugin enabled
Relevant config state:
[desktop]
runCodexInWindowsSubsystemForLinux = true
integratedTerminalShell = "wsl"
[plugins."browser-use@openai-bundled"]
enabled = true
Reproduction Steps
- On Windows, configure Codex Desktop to run the agent in WSL.
- Open a project located on the WSL filesystem, e.g.
/home/<user>/projects/<repo>. - Enable the Browser Use plugin.
- Start/restart Codex Desktop.
- Inspect MCP configuration from the WSL agent session:
codex mcp get node_repl
Codex Desktop auto-generates a user-level MCP server similar to:
[mcp_servers.node_repl]
command = "/mnt/c/Users/<windows-user>/AppData/Local/OpenAI/Codex/runtimes/cua_node/<runtime-id>/bin/node_repl.exe"
startup_timeout_sec = 120
[mcp_servers.node_repl.env]
BROWSER_USE_AVAILABLE_BACKENDS = "chrome"
CODEX_HOME = "C:\\Users\\<windows-user>\\.codex"
CODEX_CLI_PATH = "/usr/local/bin/codex"
WSLENV = "..."
- Trigger a Node REPL JS call, for example through Browser Use setup or directly via the exposed
node_repl/jstool.
Actual Behavior
The Node REPL tool is visible, but every JS execution fails immediately:
tool call failed for `node_repl/js`
Caused by:
Mcp error: -32602: js: codex/sandbox-state-meta: sandboxCwd is not a local file URI: file:///home/<user>/projects/<repo>
This blocks Browser Use entirely. The in-app browser cannot be automated from Codex in this setup.
Expected Behavior
When the Desktop app is configured to run the agent in WSL, Browser Use should work for WSL-hosted projects. Either:
- the
node_replMCP process should run in the matching WSL/Linux environment, or - Codex should map the WSL sandbox cwd to a Windows-local/UNC path before passing it to a Windows-side
node_repl.exe, e.g.\\wsl.localhost\Ubuntu-22.04\home\<user>\projects\<repo>, or - Browser Use should provision its internal Node REPL / backend in a way that does not mix Windows runtime expectations with Linux
file:///home/...sandbox metadata.
Additional Diagnostics
codex doctor --summary from the WSL agent session confirms the agent/runtime is Linux/WSL:
Codex Doctor v0.142.0 · linux-x86_64
Environment: Ubuntu 22.04, WSL_DISTRO_NAME present
Configuration: config loaded from /mnt/c/Users/<windows-user>/.codex/config.toml
MCP: 1 server (1 stdio)
Sandbox: restricted fs + restricted network
codex mcp get node_repl confirms the generated MCP server uses a Windows executable:
command: /mnt/c/Users/<windows-user>/AppData/Local/OpenAI/Codex/runtimes/cua_node/<runtime-id>/bin/node_repl.exe
cwd: -
I also tested adding an explicit UNC cwd to the generated MCP block:
cwd = '\\wsl.localhost\Ubuntu-22.04\home\<user>\projects\<repo>'
Codex accepted and displayed that cwd via codex mcp get node_repl, but the tool still failed with the same sandboxCwd is not a local file URI: file:///home/... error. After restarting Codex Desktop, the generated MCP block was overwritten again and the explicit cwd was removed.
I also tested disabling the Chrome and Computer Use plugins while keeping Browser Use enabled. Codex Desktop still regenerated the same Windows node_repl.exe MCP block with BROWSER_USE_AVAILABLE_BACKENDS = "chrome".
I did not use --disable-sandbox; this report is about the default sandboxed path.
8 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
This is related to #29413 and likely shares the same root cause, but this report covers a distinct reproduction variant: the project is stored on the native WSL filesystem under
/home/..., not on a Windows-mounted/mnt/c/...path. It also specifically blocks Browser Use / in-app browser automation, not only Chrome extension bootstrap.\n\nI tested adding an explicit Windows UNCcwdfor the generatednode_replMCP server, e.g.\\wsl.localhost\Ubuntu-22.04\home\<user>\projects\<repo>. Codex accepted and displayed thatcwd, but the tool call still failed because the internally sent sandbox metadata remainedsandboxCwd=file:///home/.... After restarting Codex Desktop, the generated MCP block was overwritten again.\n\nSo this may be the same underlying sandboxCwd mapping issue as #29413, but it confirms the failure also affects native WSL filesystem projects and Browser Use / IAB.I put up a branch for the WSL-to-Windows
sandboxCwdpath mismatch described here:https://github.com/openai/codex/compare/main...Nicolas0315:codex/wsl-windows-mcp-sandbox-cwd?expand=1
Commit:
187047147bcf16a2f6a8fe302b8e7263482f9f90What it changes:
.exelaunched through interop, rewrites only thecodex/sandbox-state-meta.sandboxCwdvalue for that MCP call./mnt/c/...to a Windows drive file URI such asfile:///C:/..../home/...tofile://wsl.localhost/<distro>/home/....Verification:
just fmt,git diff --check, focusedcodex-coretests, existingmcp_sandbox_cwdtests,codex-mcpmetadata test, andcargo check -p codex-core -p codex-mcpall passed.cyberagent-mac-m5max: fetched the commit over SSH,git diff --check, focused tests, andcargo check -p codex-core -p codex-mcppassed.nicolas2025: fetched over SSH,git diff --check, focused tests, andcargo check -p codex-core -p codex-mcppassed; no lingering cargo/rustc/link processes.nicolas-macbook-pro: fetched over SSH andgit diff --checkpassed; cargo is not installed there.rtx5060ti: fetched over SSH andgit diff --checkpassed; Rust build is blocked by the machine's knownlink.exesetup issue (link: extra operand ...), with no lingering cargo/rustc/link processes.git merge-tree --write-tree origin/main HEADis clean against currentorigin/main(69596f0e4).Version and severity update: this still matters on the current Codex
0.143.0setup.The original report was filed with
0.142.0, but Browser Use / Node REPL remains blocked in the Windows Desktop + WSL-backed runtime/workspace configuration. This should be treated as critical for this setup because Browser Use / in-app browser automation is a core Codex Desktop capability, not an optional diagnostic feature.Current relevant setup:
The user-visible impact is that Browser Use cannot be used reliably in this Windows Desktop + WSL-backed configuration.
Current-build update from a fresh Windows Desktop + WSL reproduction.
Current state
26.707.3748.026.707.314280.144.1/home/<wsl-user>/projects/<repo>node_repl.exeMCP is present and enabledCODEX_HOME=C:\Users\<windows-user>\.codex_wslBROWSER_USE_AVAILABLE_BACKENDS="chrome"A no-op JS call still fails before execution with the exact error tracked here:
The failure persists after fully quitting and relaunching Codex Desktop.
Separate Desktop eligibility gate
The same fresh launch also logs:
Settings correspondingly shows:
Both
browser_useandin_app_browserare enabled.Runtime health isolation
The primary Workspace Dependencies runtime is now healthy and Settings reports
26.709.11516; its bundled Nodev24.14.0and Python3.12.13execute successfully. This rules out the previously missing workspace dependency bundle as the cause of the Node REPLsandboxCwdfailure.This suggests there are currently two distinct gates for WSL Browser Use:
sandboxCwdURI sent to a Windows-side stdio MCP process is not translated from WSL semantics; andreason=wsl-disabled.A
sandboxCwdtranslation fix appears necessary, but may not by itself enable the in-app Browser unless the Desktop availability gate and IAB backend provisioning are also changed.Fresh reproduction on 2026-07-13 with a newer Windows Desktop build.\n\nEnvironment:\n- Codex Desktop MSIX: 26.707.8479.0\n- Browser runtime/plugin reported in generated node_repl env: 26.707.62119\n- WSL Codex CLI: 0.144.1\n- Agent environment: WSL\n- Integrated terminal: WSL\n- Workspace: native WSL path under /home/<user>/writer\n- Generated node_repl command: Windows node_repl.exe under the Codex cua_node runtime\n\nA minimal call that does not initialize Chrome or browser-client:\n\n nodeRepl.write(nodeRepl.cwd)\n\nstill fails before JavaScript execution:\n\n Mcp error: -32602: js: codex/sandbox-state-meta:\n sandboxCwd is not a local file URI: file:///home/<user>/writer\n\nThe Windows bridge process is present and running, BROWSER_USE_AVAILABLE_BACKENDS is set to chrome, and WSL can map the workspace to:\n\n \\wsl.localhost\Ubuntu\home\<user>\writer\n\nThis remains a pre-browser WSL-to-Windows sandboxCwd translation failure on the current build.
Confirming this exact issue on a later Windows build.
Product shown in About: Powered by Codex & OWL
Version:
26.707.72221Release date:
14 July 2026Platform: Windows, with the agent configured to run in WSL2 / Ubuntu
Project location: WSL filesystem (
/home/...), not/mnt/c/...The built-in browser-control tool fails before executing any requested JavaScript:
The same error occurs for a minimal, harmless JavaScript request that does not attempt navigation or page interaction.
Local Codex session logs record the failure before the supplied JavaScript runs. The Desktop application logs also show that browser control uses a native Windows runtime:
The logged runtime reports:
The observed flow is therefore:
Ordinary repository operations through Codex CLI inside WSL work correctly. This confirms that the repository and normal WSL execution are functional, although the CLI does not expose an equivalent Desktop in-app browser-control bridge.
Windows can access the same repository through its UNC path:
However, I could not complete an equivalent
node_repl/jscomparison from a UNC-backed Codex task. The UNC-backed sessions inspected encountered a separate Windows sandbox/CMD UNC-path error before reaching browser control. Therefore, opening the project through UNC remains an inconclusive workaround rather than a verified fix or failure.I inspected the available Windows and WSL Codex configuration and found no supported user-level setting for translating
sandboxCwdfrom a WSL path into a Windows-accessible representation.No repository files, Codex binaries, bundled runtimes, application configuration, browser-security settings, sandbox settings, or system settings were modified.
Expected behavior: before a WSL-backed task invokes a native Windows MCP or browser-control runtime, Codex should normalize
sandboxCwdto a Windows-accessible path or valid file URI derived from the equivalent Windows or UNC path.The failure appears independent of the repository and website content because it occurs before the requested JavaScript executes.
I can provide sanitized excerpts from the Codex session log and Desktop application log if useful.
Additional current-build check from
26.707.72221:codex-cli 0.144.4.0.144.5; release notes do not include the WSLsandboxCwdfix.187047147bcf16a2f6a8fe302b8e7263482f9f90exists but is not on currentmain,rust-v0.144.5, orrust-v0.145.0-alpha.16; GitHubshows no associated PR.
file://wsl.localhostmapping string.node_repl/jsstill fails before JS execution with:codex/sandbox-state-meta: sandboxCwd is not a local file URI: file:///home/tdurova/code/personal/wiso-steuer-front-formsbrowser_use_availability_resolved ... reason=wsl-disabled, so even aftersandboxCwdmapping lands, Browser Use maystill need the WSL availability gate addressed.