---
← Back to blog

Same bug, same fix

CodexproxyAI

The Codex app kept getting stuck on “thinking”, then “reconnecting 1/5” all the way to “5/5”, then it gave up. The CLI worked fine the whole time.

When I ran codex doctor I got some websocket failure — I forget the exact error, something like “ws xxx failed”. That was the shape of it: the app talks over websocket, the CLI doesn’t, and only one of them was reading my proxy settings.

The fix was a .env file inside Codex’s home folder — CODEX_HOME/.env — with HTTP_PROXY and HTTPS_PROXY set. The app only picked them up from that file.


中文版

Codex 应用一直卡在 “thinking”,然后 “reconnecting 1/5” 一路到 “5/5”,最后直接放弃。CLI 从头到尾都好好的。

codex doctor 的时候,我看到的是某个 websocket 报错——具体错误我记不清了,大概是 “ws xxx failed” 之类。问题大概就是这样:应用走 websocket,CLI 不走,而只有其中一个会读取我的代理设置。

解法是在 Codex 的主目录里放一个 .env 文件——CODEX_HOME/.env——把 HTTP_PROXYHTTPS_PROXY 写进去。应用只认这个文件里的变量。