Skip to content

Codex desktop on Windows cannot execute agent commands in a WSL repository #49630

Closed

Description

@SimonePa-bit

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

26.928.21956

What subscription do you have?

Plus

What platform is your computer?

Microsoft Windows NT 10.0.26300.0 x64

What issue are you seeing?

The interactive WSL terminal works, but agent execution fails before any project command runs.

Environment details:
Codex desktop version: 26.928.21956
Windows version: Microsoft Windows NT 10.0.26300.0 x64
wsl --version: Versione WSL: 2.7.3.0
Versione kernel: 6.6.114.1-1
Versione WSLg: 1.0.73
Versione MSRDC: 1.2.6676
Versione Direct3D: 1.611.1-81528511
Versione DXCore: 10.0.26100.1-240331-1435.ge-release
Versione di Windows: 10.0.26300.9457
wsl -l -v: NAME STATE VERSION

  • Ubuntu Running 2

What steps can reproduce the bug?

I’m using Codex desktop on Windows with a repository located in Ubuntu WSL:
/home/myname/myproject

The integrated terminal starts in PowerShell at:
\wsl$\Ubuntu\home\myname\myproject

Running wsl manually successfully opens Ubuntu in ~/myproject. The agent can read this terminal’s output through read_thread_terminal, but its execution tools still fail.
Failure 1 — exec_command
Even a minimal pwd command with /bin/bash explicitly selected and login: false fails:
CreateProcess {
message: "Rejected("Failed to create unified exec process: No such file or directory (os error 2)")"
}
This happens with both the repository directory and /tmp as the working directory.

Failure 2 — node_repl
Attempting to read a repository file through the alternative tool fails with:
Mcp error: -32602: js: codex/sandbox-state-meta:
sandboxCwd is not a local file URI:
file:///home/myname/myproject

What is the expected behavior?

Expected behavior: Agent tools should execute commands and access files inside the WSL repository.

Actual behavior: The interactive WSL terminal works, but agent execution fails before any project command runs.
A possible explanation is a mismatch between the Windows execution context and the Linux workspace path, but this has not been confirmed.

Additional information

This is happening across three different machines, it's not an isolated issue.
It happended after working as intendeed in first hours of the day, we didn't change any settings

Activity

  1. added
    app
    on Sep 30, 2026
  2. added
    bug
    windows-os
    tool-calls
    on Sep 30, 2026
  3. twil21be commented on Sep 30, 2026

    @twil21be

    Same here (Codex App 26.928.21956, Windows 10.0.26200 x64, repo in WSL2 Ubuntu, "Run agent in WSL" enabled). I traced the WSL agent with strace -f -p and found the cause of the ENOENT:

    • Every command fails on execve(".../.codex/tmp/arg0/codex-arg0XXXXXX/codex-linux-sandbox", [... "--command-cwd", "/tmp", ... "/bin/bash", "-c", "pwd"]) = -1 ENOENT.
    • The WSL agent creates that arg0 dir (symlinks: codex-linux-sandbox, apply_patch, codex-execve-wrapper). A few seconds after startup a Windows-side "codex.exe exec-server --remote ... --environment-id ccarenv" starts, and tmp/arg0 then contains only a different dir with apply_patch.bat / applypatch.bat. The WSL agent's dir is gone. CODEX_HOME is shared (C:\Users....codex, seen as /mnt/c/... from WSL).
    • Timeline on one boot: WSL app-server 22:53:24, exec-server 22:53:41, helper dir missing by 22:54.
    • Reproduces after a full Windows reboot. Killing exec-server only makes the app respawn it.

    Hypothesis (unverified): the Windows-side cleanup of stale arg0 dirs can't see the lock held by the WSL process (flock on DrvFs) and deletes the live helper dir.

    Workaround: switch the agent to Windows mode and run wsl.exe outside the sandbox (inside the Windows sandbox wsl.exe gets Wsl/Service/E_ACCESSDENIED).

  4. skradfasket commented on Oct 12, 2026

    @skradfasket

    Additional reproduction on Windows 10 19045.6466, WSL2 (Ubuntu-H, Ubuntu 24.04), ChatGPT desktop in Codex mode 26.1007.21434 (installed MSIX OpenAI.Codex 26.1007.2314.0). The standalone WSL Codex CLI 0.162.1 and ordinary WSL shell work.
    With Agent environment set to WSL, a fresh local chat cannot run even pwd:
    Failed to create unified exec process: No such file or directory (os error 2)
    The failure persists with explicit /bin/bash, with and without the configured cwd, in two unrelated WSL directories. A full reboot, fresh chats, restoring the original desktop config, and Windows Apps > Repair did not resolve it. The saved config has runCodexInWindowsSubsystemForLinux = true, and desktop launch logs show spawnCommand=wsl.exe.
    On multiple desktop launches, logs show bundled_executable_relocation_failed for bwrap, operation=stat_source, errorCode=ENOENT, looking under the installed package's app/resources/codex-resources/bwrap. That package file and its intended relocated copy are absent. System /usr/bin/bwrap exists (bubblewrap 0.9.0). The WSL app-server initializes and the Local Work executor connects, so the warning is a lead, not proof that the missing bundled fallback caused the per-command failure. I have not captured the actual child executable path for the failed pwd.
    The app's /feedback dialog said the feedback was received, but some diagnostic files could not be uploaded. A minimal trace showing the selected command executable, sandbox helper path, cwd, and OS error for one failed pwd would help distinguish this from other ENOENT causes. I can provide the separately redacted diagnostic passback if useful.

  5. SimonePa-bit commented on Oct 29, 2026

    @SimonePa-bit
    Author

    seems to work right now

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

    appbugtool-callswindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions