codex - 💡(How to fix) Fix [Bug] Desktop WSL mode: codex spawned without shell env, proxy vars missing, AI calls timeout

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

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

Fix Action

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")

RAW_BUFFERClick to expand / collapse

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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix [Bug] Desktop WSL mode: codex spawned without shell env, proxy vars missing, AI calls timeout