Skip to content

Codex Windows app exec_command fails with WSL agent environment #27474

Open

Description

@mao415mao

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

0.139.0

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Windows 11 x64 WSL2 Ubuntu wsl -l -v: Ubuntu Running 2

What issue are you seeing?

Codex Windows app の exec_command が、WSL 設定でも失敗します。

Codex app の設定は以下です。

  • エージェントの環境: Windows Subsystem for Linux
  • 統合ターミナルのシェル: WSL
  • デフォルトで開く場所: VS Code

しかし、Codex Windows app から exec_command で pwd を実行しようとすると、以下のエラーで失敗します。

exec_command failed for /bin/bash -lc pwd:
CreateProcess { message: "Rejected("Failed to create unified exec process: No such file or directory (os error 2)")" }

PowerShell からは WSL2 Ubuntu と bash を正常に起動できます。

wsl -l -v
→ Ubuntu Running VERSION 2

wsl -d Ubuntu -- bash -lc "pwd; ls /mnt/d/test30; which bash"
→ /mnt/c/Users/User
→ AGENTS.md runs
→ /usr/bin/bash

そのため、WSL / Ubuntu / bash 自体は正常です。
Codex Windows app の exec_command / unified exec runner が、WSL 設定時に bash 起動経路を正しく解決できていないように見えます。

What steps can reproduce the bug?

  1. Windows 11 上で Codex Windows app を起動する。

  2. Settings で以下に設定する。

    • エージェントの環境: Windows Subsystem for Linux
    • 統合ターミナルのシェル: WSL
    • デフォルトで開く場所: VS Code
  3. WSL2 Ubuntu 側に /mnt/d/test30 が存在する状態にする。

  4. Codex Windows app で test30 のプロジェクトを開く。

  5. Codex に以下を依頼する。

    記事作業はしないでください。
    exec_command の復旧確認だけをしてください。
    作業ディレクトリは /mnt/d/test30 です。
    まず pwd のみ実行してください。
    成功した場合だけ ls を実行してください。

  6. Codex app の exec_command が以下で失敗する。

    exec_command failed for /bin/bash -lc pwd:
    CreateProcess { message: "Rejected("Failed to create unified exec process: No such file or directory (os error 2)")" }

確認済みのこと:

  • WSL2 Ubuntu は起動できる。
  • Windows PowerShell から wsl -d Ubuntu -- bash -lc ... は成功する。
  • /mnt/d/test30 は WSL 側から読める。
  • /usr/bin/bash は存在する。
  • VS Code では WSL Remote で ~/codex-test を開ける。
  • Codex app は再インストール済み。
  • .codex は .codex_backup に退避済み。
  • Codex app の修復・リセットも実施済み。

What is the expected behavior?

Codex Windows app が Windows Subsystem for Linux に設定されている場合、WSL runner 経由で bash を起動し、pwd を正常に実行できることを期待します。

期待する結果:

/mnt/d/test30

または、現在の WSL ワークスペースのパスが返ること。

実際には、WSL 設定にもかかわらず、Windows CreateProcess で /bin/bash を直接起動しようとしているように見え、os error 2 で失敗します。

Additional information

This issue appears to be specific to Codex Windows app's exec_command / unified exec runner, not WSL itself.

PowerShell can launch WSL and bash successfully:

wsl -d Ubuntu -- bash -lc "pwd; ls /mnt/d/test30; which bash"

Result:

  • WSL starts successfully
  • /mnt/d/test30 is readable
  • /usr/bin/bash exists

Codex CLI also works inside WSL.
The failure occurs only when Codex Windows app tries to run exec_command.

Activity

  1. added
    app
    on Jun 10, 2026
  2. added
    bug
    windows-os
    tool-calls
    on Jun 10, 2026
  3. github-actions commented on Jun 10, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  4. RobbiePlus commented on Sep 30, 2026

    @RobbiePlus

    Additional reproduction on 2026-09-30 (Asia/Shanghai), after updating the ChatGPT/Codex desktop app on a Windows computer.

    • Desktop reported installed version: 26.928.21956 (build 12404, production channel).
    • The selected project is a native WSL path under /home/... .
    • In the desktop Codex chat, a minimal pwd command fails before the shell starts:
      Failed to create unified exec process: No such file or directory (os error 2)
    • The same failure occurs with an explicit /bin/bash shell and /tmp working directory, with /bin/sh in the project directory, and with a simple /bin/true command.
    • No project files were changed and no service was started during these checks.
    • I have not independently checked WSL from outside the desktop app on this computer, so this report isolates the desktop command launch failure but does not claim the WSL distribution itself is healthy.

    This matches the error and WSL desktop execution path reported here. Please confirm whether there is a supported fix or a known-good desktop build for this release line.

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