Codex Windows App failed to start after switching to WSL mode
What version of the Codex App are you using (From “About Codex” dialog)?
26.803.10989.0
What subscription do you have?
Plus
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
Codex Desktop fails to start when WSL is selected as the execution environment.
<img width="344" height="135" alt="Image" src="https://github.com/user-attachments/assets/63e78903-2fd3-4e93-b8b3-69d4c4fc25fb" />
The WSL codex app-server process is successfully started by the Desktop application and remains running, but the initialization handshake times out.
Running the same app-server binary manually inside WSL works correctly.
The handshake also works when the app-server is launched manually from Windows through wsl.exe:
'{"method":"initialize","id":1,"params":{"clientInfo":{"name":"test","version":"1"}}}' |
wsl.exe -d Ubuntu -- <codex-binary> -c features.code_mode_host=true app-server --analytics-default-enabled
This successfully returns an initialization response.
So the problem only occurs when Codex Desktop launches and communicates with the app-server in WSL.
What steps can reproduce the bug?
- Install Codex Desktop on Windows.
- Select WSL/Ubuntu as the execution environment.
- Restart/start Codex Desktop.
- Wait for initialization.
What is the expected behavior?
It starts
Additional information
_No response_
2 Comments
I'm seeing this same behavior.
Additional diagnostics from a Windows 11 reproduction (posting sanitized data; no raw logs, usernames, keys, or absolute user paths):
Symptom and A/B result
code-mode host exited during handshake; the corresponding desktop log recordsCodex app-server initialize handshake timed out.wsl.exe -d Ubuntu-24.04 -- bash -lc 'codex exec --sandbox read-only "Run pwd using the shell tool and report only the exact output."'completed successfully and the code-mode shell returned the expected working directory.Environment
Environment-variable/config check
CODEX_HOME,CODEX_CLI_PATH,WSLENV, andWSL_DISTRO_NAMEare unset.CODEX_HOME,CODEX_CLI_PATH, andWSLENVare unset.config.tomlcontainsCODEX_HOMEandCODEX_CLI_PATHonly inside[mcp_servers.node_repl.env]; they are not global Windows environment variables. The configuredCODEX_CLI_PATHpoints to the Windows Codex CLI, so it may be worth checking whether this MCP-scoped value is accidentally inherited by the WSL bridge.runCodexInWindowsSubsystemForLinux = falseandintegratedTerminalShell = "powershell"; the failing A/B changes the agent/runtime to WSL.approvals_reviewer = Useris disallowed by the installed requirements and falls back toAutoReview. This is a configuration-compatibility warning, but I cannot establish it as the root cause of the WSL handshake failure.Relevant log excerpt (sanitized)
From the failing Desktop session on 26.803.10989.0:
The desktop logs therefore show that the local stdio process was spawned, then the WSL-discovered SSH app-server transport was selected, but initialization did not complete within 30 seconds. In the PowerShell A/B, local app-server initialization succeeds.
Additional isolation
codex-code-mode-host, and the native WSLcodex execshell test succeeds.Related reports
This appears related to, but is not identical to, #39169 (WSL app-server initialize handshake timeout), #18506 (Windows/WSL bridge, CODEX_HOME and terminal boundary), #14461 (Windows WSL mode fails while PowerShell works), and #16815 (WSL path-boundary failure).
Expected behavior: the Desktop WSL agent should complete initialization and run the same shell request that succeeds in native WSL CLI and in the PowerShell A/B. Could the WSL bridge log (1) the selected transport, (2) the resolved
codexandcodex-code-mode-hostpaths/platforms, (3) the inherited environment after filtering, and (4) the first initialize response/error from the remote app-server instead of only reporting a generic handshake timeout?