Codex Windows app exec_command fails with WSL agent environment

Open 💬 1 comment Opened Jun 10, 2026 by 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 を起動する。
  1. Settings で以下に設定する。
  • エージェントの環境: Windows Subsystem for Linux
  • 統合ターミナルのシェル: WSL
  • デフォルトで開く場所: VS Code
  1. WSL2 Ubuntu 側に /mnt/d/test30 が存在する状態にする。
  1. Codex Windows app で test30 のプロジェクトを開く。
  1. Codex に以下を依頼する。

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

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

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗