Skip to content

[Bug] Codex desktop 26.609.4994.0 (MSIX) missing Linux codex binary in app/resources — breaks "Run agent in WSL" #28103

Open

Description

@qiyueqiu

[Bug] Codex desktop app 26.609.4994.0 (MSIX) is missing the Linux codex binary in app/resources, breaking "Run agent in WSL"

Summary

On the Microsoft Store / MSIX build of the Codex desktop app, enabling Run agent in WSL fails immediately with:

Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.

The root cause is that the app's bundled-executable relocation step tries to stat a Linux codex binary at ...\app\resources\codex, but that file does not exist in the installed package — only the Windows codex.exe is shipped. As a result the relocation to C:\Users\<user>\.codex\bin\wsl\codex never happens and the app server transport fails to connect.

The app works fine in native Windows mode (using codex.exe); only WSL mode is broken.

Environment

  • Codex desktop app version: 26.609.4994.0 (x64, Microsoft Store / SignatureKind: Store)
  • Package: OpenAI.Codex_26.609.4994.0_x64__2p2nqsd0c76g0
  • OS: Windows 11
  • WSL: WSL2, distro Ubuntu-24.04 (default, Running), kernel 6.6.87.2-microsoft-standard-WSL2

Steps to reproduce

  1. Install the Codex desktop app from the Microsoft Store (version 26.609.4994.0).
  2. In settings, enable Run agent in WSL.
  3. Restart the app.

Expected

The app relocates the bundled Linux codex binary into ~/.codex/bin/wsl/codex and starts the app server inside WSL.

Actual

The app fails to connect with "Unable to locate the Codex CLI binary…". The relocation step throws ENOENT because the source file is missing from the package.

Evidence (from app logs)

Log path: %LOCALAPPDATA%\Packages\OpenAI.Codex_2p2nqsd0c76g0\LocalCache\Local\Codex\Logs\...\codex-desktop-*.log

warning bundled_executable_relocation_failed
  destinationPath=C:\Users\<user>\.codex\bin\wsl\codex
  errorCode=ENOENT
  errorMessage="Bundled executable relocation failed during stat_source"
  errorName=BundledExecutableRelocationError
  executableName=codex
  operation=stat_source
  originalError={"errno":-4058,"code":"ENOENT","syscall":"stat",
    "path":"C:\\Program Files\\WindowsApps\\OpenAI.Codex_26.609.4994.0_x64__2p2nqsd0c76g0\\app\\resources\\codex"}
  platform=win32
  sourceKind=windowsapps
  sourcePath="C:\\...\\app\\resources\\codex"

warning [AppServerConnection] app_server_connection.transport_connect_failed
  errorMessage="Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex."

error [AppServerConnection] fatal_error_broadcasted
  errorMessage="Unable to locate the Codex CLI binary. ..."

Note operation=stat_source: the failure is on the source file, before any copy is attempted.

Confirmation that the source file is genuinely missing

Listing C:\Program Files\WindowsApps\OpenAI.Codex_26.609.4994.0_x64__2p2nqsd0c76g0\app\resources\:

codex-command-runner.exe
codex-notification.wav
codex-windows-sandbox-setup.exe
codex.exe          <-- Windows binary present
                   <-- no extension-less "codex" (Linux ELF) present

So the packaging shipped only the Windows codex.exe and omitted the Linux codex binary that WSL mode requires.

Workarounds attempted (and why they don't help)

  • Installing a system Node + global @openai/codex in WSL, and having codex on PATH in WSL — no effect, because the app does not look up codex via the WSL PATH; it relocates its own bundled binary.
  • Pre-placing a valid Linux codex ELF at the relocation destination (C:\Users\<user>\.codex\bin\wsl\codex) — no effect, because relocation fails at stat_source (the source) before it ever checks the destination.
  • Placing the binary at the source path under C:\Program Files\WindowsApps\...\app\resources\ is not possible (TrustedInstaller-owned, read-only, and would break the package signature).

The only working fallback is to disable WSL mode and run in native Windows mode.

Suggested fix

Include the Linux codex binary in app/resources for the Windows MSIX build (it appears to have been dropped in 26.609.4994.0; an earlier build such as 26.601.x reportedly worked), or make the relocation tolerate a pre-existing valid destination binary instead of hard-failing on a missing source.

Activity

  1. added
    bugSomething isn't working
    appIssues related to the Codex desktop app
    windows-osIssues related to Codex on Windows systems
    app-serverIssues involving app server protocol or interfaces
    on Jun 13, 2026
  2. github-actions commented on Jun 13, 2026

    @github-actions
    Contributor
  3. qiyueqiu commented on Jun 13, 2026

    @qiyueqiu
    Author

    Related issues that appear to share the same root cause or area:

    Possibly the same class of WindowsApps relocation/copy problem (different trigger): #25220 (EFS-encrypted files), #28031 (access denied executing bundled codex.exe), #22672 (non-standard drive).

    In this issue specifically the failure is operation=stat_source on a missing source (app\resources\codex Linux binary absent from the package), which points to a packaging omission rather than a permission/encryption issue.

  4. Jafa7 commented on Jun 13, 2026

    @Jafa7

    I can confirm that this issue also affects Codex Desktop version 26.609.41114.

    Environment:

    • Codex Desktop: 26.609.41114 (released June 12, 2026)
    • Windows: 10.0.26200.8655
    • WSL: 2.7.8.0
    • WSL kernel: 6.18.33.1-1
    • Distribution: Ubuntu
    • Codex CLI inside WSL: 0.139.0
    • CLI path: /home/user/.local/bin/codex

    The CLI works correctly when launched directly inside WSL, including codex app-server --help, but enabling “Run agent in WSL” causes Codex Desktop to fail with:

    “Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.”

    Setting CODEX_CLI_PATH to either the Linux path or the corresponding \wsl.localhost UNC path does not resolve the issue. Removing the variable allows Codex Desktop to start again in native Windows mode.

    This confirms that the issue is not limited to version 26.609.4994.0.

    Image
  5. JorgeMantillaHernandez commented on Jun 14, 2026

    @JorgeMantillaHernandez

    I’m seeing the same issue.

    I installed the Codex Windows app normally from the Microsoft Store. It was working in the default Windows native mode. Then I changed the agent environment to use WSL, restarted Codex, and after that the app failed to start with this error:

    “Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.”

    My app is installed on the C: drive:

    OpenAI.Codex_26.609.4994.0_x64__2p2nqsd0c76g0
    C:\Program Files\WindowsApps\OpenAI.Codex_26.609.4994.0_x64__2p2nqsd0c76g0

    I was able to recover by manually editing:

    C:\Users<user>.codex\config.toml

    and changing:

    runCodexInWindowsSubsystemForLinux = false
    integratedTerminalShell = "powershell"

    So this looks like the WSL mode startup path is broken in this build.

    Image
  6. shuncleopasfang commented on Jun 15, 2026

    @shuncleopasfang

    #28212 (comment)

    The workaround that worked for me was to point CODEX_CLI_PATH to the Desktop-managed WSL cached Codex binary.

  7. LeventAksakal commented on Jun 15, 2026

    @LeventAksakal

    Additional reproduction: WSL mode breaks after switching default distro to opp_env

    I hit what appears to be the same Windows Codex Desktop WSL-mode failure.

    Environment

    • Windows Codex Desktop app from Microsoft Store / MSIX
    • Codex CLI on Windows: codex-cli 0.139.0
    • Windows CLI path:
      C:\Users\leven\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe
    • WSL2 installed
    • Initially default distro was Ubuntu
    • Target distro for work: opp_env
    • Project type: OMNeT++ project that must run inside opp_env

    What happened

    1. Codex Desktop was configured to use WSL mode.
    2. First WSL launch worked while the default WSL distro was Ubuntu.
    3. I shut down WSL.
    4. I changed the default WSL distro to opp_env.
    5. After restarting Codex Desktop, the app failed to start with:
    Codex failed to start.
    Unable to locate the Codex CLI binary.
    Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.
    

    In one failure mode, the app appeared to invoke bash and try to run a Windows path from inside WSL:

    /usr/bin/bash: line 1: /mnt/c/Users/levent/AppData/Local/.../codex.exe: No such file or directory
    

    This is wrong in two ways:

    • The actual Windows user path is C:\Users\leven, not C:\Users\levent.
    • In WSL agent mode, the app should not depend on a Windows codex.exe path.

    Diagnostics

    Windows CLI works:

    where.exe codex
    codex --version

    Output:

    C:\Users\leven\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe
    codex-cli 0.139.0
    

    The app only recovered after forcing Windows-native mode in %USERPROFILE%\.codex\config.toml by changing

    integratedTerminalShell = "wsl"
    runCodexInWindowsSubsystemForLinux = true

    into

    runCodexInWindowsSubsystemForLinux = false
    integratedTerminalShell = "powershell"

    Expected behavior

    Codex Desktop WSL mode should either:

    • reliably use the selected/default WSL distro after restart,
    • provide a documented setting for the WSL distro name,
    • use the native Linux codex available inside that distro,
    • or fail with a clear recovery path, fail-back into windows native or other environments when launching one fails.

    Actual behavior

    Switching to WSL mode can make the desktop app unable to launch at all. Recovery requires manually editing config/state files to force PowerShell/native mode.

    Impact

    This blocks real Linux-native workflows such as OMNeT++ projects that need a specific WSL distro/environment. Using Windows-native mode is not a valid replacement for these projects.

  8. guipmourao commented on Aug 2, 2026

    @guipmourao

    Confirming this also happens on a newer build and the same workaround fixed it for me.

    • Codex desktop (ChatGPT app, Microsoft Store / MSIX): version 26.727.6591.0
    • Windows 11, build 10.0.26200.8875
    • WSL 2.7.11.0, Ubuntu

    App failed to start with:
    ChatGPT failed to start.
    (code=2, signal=null).
    Most recent error: /usr/bin/bash: -c: line 1: unexpected EOF while looking for matching `"'

    Same fix as above worked: edited %USERPROFILE%.codex\config.toml and set

    [desktop]
    integratedTerminalShell = "powershell"
    runCodexInWindowsSubsystemForLinux = false

    then restarted. App now starts fine in native Windows mode. Confirms this is still broken on a build several releases newer than the one originally reported here.

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 appapp-serverIssues involving app server protocol or interfacesbugSomething isn't workingwindows-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