macOS: Codex auth requests fail with "error sending request" while curl to the same endpoint returns HTTP 200

Resolved 💬 1 comment Opened Aug 10, 2026 by kwis7 Closed Aug 10, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using (From “About Codex” dialog)?

Version 26.803.41515

What subscription do you have?

ChatGPT Pro

What platform is your computer?

macOS, Apple Silicon (arm64)

What issue are you seeing?

Codex Desktop and CLI were previously working normally on this Mac, but suddenly started failing with:

"stream disconnected before completion: error sending request"

I signed out while troubleshooting, and since then I have been unable to sign back in.

Normal OAuth login fails during token exchange with:

"Token exchange failed: error sending request for url (https://auth.openai.com/oauth/token)"

Device authentication also fails:

"Error logging in with device code: error sending request for url (https://auth.openai.com/api/accounts/deviceauth/usercode)"

Web ChatGPT and Web Codex work normally.

I have tested multiple networks (Wi-Fi and mobile hotspot), removed VPN/Clash, verified that system proxies are disabled, and tested both the bundled Codex CLI and standalone stable Codex CLI 0.147.0.

Most importantly, curl can successfully POST to the exact same device-auth endpoint from the same Mac. Both IPv4 and IPv6 return HTTP 200 with a valid device_auth_id and user_code. TLS and certificate verification also succeed.

Therefore, the OpenAI authentication endpoint is reachable from this machine, but Codex itself reports "error sending request" when accessing the same endpoint.

The issue appeared suddenly after Codex had previously been working normally.

What steps can reproduce the bug?

  1. Open Codex Desktop on macOS (Apple Silicon).
  1. Attempt to use Codex normally. Requests fail with:

"stream disconnected before completion: error sending request"

  1. Sign out of Codex and attempt to sign back in using the normal browser OAuth flow.
  1. Complete authentication in the browser. The final token exchange fails with:

"Token exchange failed: error sending request for url (https://auth.openai.com/oauth/token)"

  1. Alternatively, install/run Codex CLI 0.147.0 and execute:

/opt/homebrew/bin/codex login --device-auth

  1. Device authentication immediately fails with:

"error sending request for url (https://auth.openai.com/api/accounts/deviceauth/usercode)"

  1. From the same Mac and network, POST to that exact endpoint using curl:

curl -4 -X POST https://auth.openai.com/api/accounts/deviceauth/usercode -H 'Content-Type: application/json' -d '{}'

  1. The curl request succeeds with HTTP 200 and returns a valid device code. Repeating the test with curl -6 also succeeds with HTTP 200.

The issue is consistently reproducible across both Wi-Fi and a mobile hotspot. Web ChatGPT and Web Codex continue to work normally.

What is the expected behavior?

Codex Desktop and CLI should be able to connect to OpenAI normally and complete requests without "stream disconnected" or "error sending request" errors.

After signing in through the browser, Codex should successfully exchange the authorization code for a token and complete the login.

Similarly, codex login --device-auth should successfully contact the device-auth endpoint, return a device code, and allow authentication to complete.

Since the same OpenAI authentication endpoints are reachable from this Mac via curl, Codex should also be able to communicate with them successfully.

Additional information

_No response_

View original on GitHub ↗

1 Comment

github-actions[bot] contributor · 17 days ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #37467

Powered by Codex Action