[Bug] Desktop WSL mode: codex spawned without shell env, proxy vars missing, AI calls timeout

Open 💬 1 comment Opened May 29, 2026 by Sskift

Environment

  • Codex Desktop: 26.519.11010.0 (Microsoft Store)
  • WSL: Ubuntu-22.04
  • Windows: 11 Home China 10.0.26200

Summary

When Codex Desktop runs in WSL mode, it spawns the codex binary via wsl.exe directly without a shell. Environment variables from ~/.bashrc (HTTP_PROXY/HTTPS_PROXY) are NOT inherited. On networks requiring proxy, all AI calls timeout — UI shows reconnecting indefinitely.

Root Cause

Desktop: wsl.exe <binary> → no shell → no proxy env → cant reach chatgpt.com/backend-api → timeout
Terminal: codex inside login shell → .bashrc loaded → proxy works → chat works

Workaround

Set proxy at Windows user env var level so WSL inherits it:
[System.Environment]::SetEnvironmentVariable("HTTP_PROXY", "http://127.0.0.1:33210", "User")

Suggested Fix

  1. Spawn WSL codex via login shell (wsl -e bash -lc) so shell env vars are sourced
  2. Or document that proxy must be set at Windows/system level for Desktop WSL mode

View original on GitHub ↗

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