[Windows Desktop] Stale HTTP_PROXY/HTTPS_PROXY in ~/.codex/.env causes infinite Reconnecting loop and os error 10061
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What version of the Codex App are you using (From “About Codex” dialog)?
26.903.71938
What subscription do you have?
ChatGPT Plus
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
Codex Desktop repeatedly showed:
"Reconnecting... waiting for network"
and then:
"stream disconnected before completion: 由于目标计算机积极拒绝,无法连接。 (os error 10061)"
ChatGPT in the browser worked normally on the same computer and network, but Codex Desktop could not complete any request.
After troubleshooting, I found the following entries in:
C:\Users<username>.codex.env
HTTP_PROXY="http://127.0.0.1:7898"
HTTPS_PROXY="http://127.0.0.1:7898"
I then ran:
netstat -ano | findstr :7898
There was no output, confirming that no process was listening on port 7898.
After removing the stale HTTP_PROXY and HTTPS_PROXY entries from .codex.env, fully exiting Codex, and restarting the application, Codex immediately started working normally.
It appears that Codex was attempting to connect through an unavailable local proxy endpoint, but the UI only displayed the generic message "Reconnecting... waiting for network".
Suggested improvement:
When a configured HTTP_PROXY/HTTPS_PROXY endpoint is unreachable, Codex could display the actual proxy host/port or indicate that the configured proxy connection was refused. This would make the root cause much easier to diagnose.
What steps can reproduce the bug?
-
On Windows, create or edit the Codex environment file:
C:\Users\<username>\.codex\.env -
Add the following proxy variables, pointing to a local port where no proxy process is listening:
HTTP_PROXY="http://127.0.0.1:7898" HTTPS_PROXY="http://127.0.0.1:7898" -
Verify that the port is not listening by running:
netstat -ano | findstr :7898For reproduction, this command should return no output.
-
Fully exit Codex Desktop and make sure all Codex processes are closed.
-
Restart Codex Desktop.
-
Open a new Codex conversation and send a simple prompt such as:
hello -
Codex repeatedly shows:
Reconnecting... waiting for networkand eventually reports:
stream disconnected before completion: No connection could be made because the target machine actively refused it. (os error 10061) -
Remove the two proxy variables from
C:\Users\<username>\.codex\.env, fully restart Codex, and send the same prompt again. Codex then works normally.
### What is the expected behavior?
Codex should either:
1. connect normally when no proxy is configured, or
2. if a configured proxy endpoint is unreachable, clearly report that the proxy connection failed and show the effective proxy host/port.
It should not present an unavailable local proxy endpoint only as the generic message:
`Reconnecting... waiting for network`
### Additional information
no
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with the proxy variables in C:\Users<username>.codex.env and an unused local port, then inspect the networking error path that produces the generic reconnecting message. The change is done when an unreachable configured proxy reports its host and port or clearly identifies the refused proxy connection, while normal no-proxy startup still works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- desktop, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100