Skip to content

Codex Desktop OAuth token_exchange_failed immediately after automatic update to 26.810.41047 on macOS #38482

Open

Description

@davidmagro

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

26.810.41047 Released Aug 14, 2026

What subscription do you have?

Pro

What platform is your computer?

MacBook Air M2 (Apple Silicon) macOS 15.6.1

What issue are you seeing?

Codex Desktop was working normally for more than a month. After the app automatically updated, existing conversations began repeatedly showing "Reconnecting" and eventually failed with:

stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses)

I signed out to troubleshoot. Since signing out, I can no longer sign back into Codex Desktop.

Browser authentication proceeds to the localhost callback, but Codex then displays:

token_exchange_failed

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

ChatGPT in Chrome continues to work normally.

The issue reproduces with two different ChatGPT accounts, on both Wi-Fi and a mobile hotspot.

Codex is correctly listening on the OAuth callback port:

codex ... TCP 127.0.0.1:1455 (LISTEN)

curl http://localhost:1455 returns Not Found, confirming the local callback server is responding.

env | grep -i proxy returns nothing, so no proxy environment variables are configured.

The problem started immediately following the automatic Codex Desktop update. No network, account or system configuration changes were made beforehand.

What steps can reproduce the bug?

Open Codex Desktop 26.810.41047 on macOS 15.6.1 / Apple Silicon M2.
Select Sign in with ChatGPT.
Complete authentication in Chrome.
Browser redirects to localhost:1455/auth/callback.
Codex fails to complete authentication.
Error displayed: token_exchange_failed.
Retrying produces the same result.

Reproduces using two separate ChatGPT accounts and both Wi-Fi and mobile hotspot.

What is the expected behavior?

After completing authentication in the browser, Codex Desktop should exchange the OAuth code, sign into my ChatGPT account and open normally.

Additional information

Troubleshooting already completed:

• Restarted Codex Desktop
• Force quit all Codex processes through Activity Monitor
• Signed out and attempted fresh authentication
• Tested a second ChatGPT account, same failure
• Tested Wi-Fi and mobile hotspot, same failure
• Chrome/ChatGPT web works normally
• Tested Chrome Incognito, same failure
• Confirmed Codex is listening on 127.0.0.1:1455
• Confirmed localhost callback server responds
• Confirmed no proxy environment variables are configured
• macOS: 15.6.1
• Hardware: MacBook Air M2 / Apple Silicon
• Codex Desktop: 26.810.41047, released Aug 14, 2026

Codex had been working normally on this Mac for more than a month. The issue began immediately after the automatic Desktop update.

I have deliberately not deleted Codex application data or project files because I do not want to risk losing local project/thread information.

Activity

  1. added
    appIssues related to the Codex desktop app
    on Aug 14, 2026
  2. added
    bugSomething isn't working
    authIssues related to authentication and accounts
    connectivityIssues involving networking or endpoint connectivity problems (disconnections)
    on Aug 14, 2026
  3. Deax commented on Aug 16, 2026

    @Deax

    I can reproduce this independently on a Mac Studio (Apple Silicon) with the current ChatGPT macOS app build 26.810.52044.

    Environment / reproduction:

    • Mac Studio, Apple Silicon (M2 Max)
    • ChatGPT macOS app 26.810.52044
    • Browser ChatGPT login works normally
    • ChatGPT desktop app fails after browser authentication with: Sign-in failed: Login server error: Token exchange failed: error sending request for url (https://auth.openai.com/oauth/token)
    • Codex browser login also fails at the same token exchange with token_exchange_failed
    • Tested normal network and iPhone hotspot: same failure
    • Tested with VPN enabled/disabled: same failure
    • Completely uninstalled/reinstalled the ChatGPT app: same failure
    • Created a fresh macOS user account: same failure
    • An Intel Mac on the same account/network can log into the ChatGPT app successfully

    Network diagnostics from the affected Mac Studio:

    • curl -4 https://auth.openai.com/oauth/token reaches OpenAI successfully
    • curl -4 -X POST https://auth.openai.com/oauth/token reaches the endpoint and returns HTTP 400 Missing required parameter: 'grant_type', demonstrating that HTTPS/TLS and POST connectivity to the token endpoint work
    • TLS certificate verification succeeds
    • No HTTP/HTTPS proxy is configured

    This appears highly consistent with the macOS Apple Silicon OAuth/client issue reported here. The problem is reproducible on the newer 26.810.52044 build as well.

  4. kairosgold commented on Aug 16, 2026

    @kairosgold

    I can reproduce the same issue on another Apple Silicon Mac, and in this case the failure continues even after authentication is restored.

    Environment:

    • MacBook Pro, Apple Silicon / arm64
    • ChatGPT/Codex Desktop 26.810.52044
    • Clash Verge Rev (Mihomo), local mixed proxy; macOS HTTP/HTTPS/SOCKS proxy configured correctly
    • The same ChatGPT account and the same proxy provider/node work in Codex on Windows (slower, but functional)
    • ChatGPT and Work in the browser are functional

    Observed sequence:

    1. Existing Codex conversations repeatedly showed Reconnecting... waiting for network and failed with:
      stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses)
    2. After signing out, browser authentication returned to localhost:1455/auth/callback, but the app failed with:
      token_exchange_failed: error sending request for url (https://auth.openai.com/oauth/token)
    3. A valid auth cache from the working Windows installation was copied to ~/.codex/auth.json using the documented file credential store. Login then succeeded and the desktop UI could create chats, but every Codex request still failed at /backend-api/codex/responses.

    Troubleshooting already completed:

    • Verified macOS HTTP/HTTPS/SOCKS proxy settings and local proxy listener
    • Verified HTTPS connectivity through the proxy with curl
    • Tested system proxy and explicit upper/lowercase HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, WS_PROXY, and WSS_PROXY
    • Tested different proxy ports/nodes
    • Tested DNS fake-IP and normal resolution; flushed macOS DNS cache
    • Checked /etc/hosts
    • Tested reinstall/current build and rollback to 26.730.61639
    • Corrected the Codex config and confirmed authentication status
    • The response-stream failure remains unchanged

    This does not appear to be an account restriction or a generally blocked proxy endpoint, because the same account/network path works in the browser and on Windows. It appears specific to the macOS Apple Silicon desktop transport path.

    Could a maintainer confirm whether additional logs are needed and whether a fixed desktop build or supported workaround is available?

  5. xiaxiaojie1989 commented on Sep 7, 2026

    @xiaxiaojie1989

    Adding another macOS Desktop reproduction with network diagnostics.

    Environment / symptoms:

    • macOS on MacBook Air
    • Codex Desktop login via ChatGPT browser flow
    • Browser authentication proceeds, but the final token exchange fails with:
    Error code: token_exchange_failed
    Details: Token exchange failed: error sending request for url (https://auth.openai.com/oauth/token)
    

    Network diagnostics:

    1. The shell initially had explicit HTTP(S) proxy env vars pointing to a local proxy:
    http_proxy=http://127.0.0.1:4780
    https_proxy=http://127.0.0.1:4780
    HTTP_PROXY=http://127.0.0.1:4780
    HTTPS_PROXY=http://127.0.0.1:4780
    

    With those set, curl -I https://auth.openai.com failed during TLS with:

    HTTP/1.1 200 Connection established
    curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to auth.openai.com:443
    
    1. After unsetting all HTTP/HTTPS/ALL_PROXY variables, TLS connectivity succeeded, but auth.openai.com returned Cloudflare 403:
    HTTP/2 403
    server: cloudflare
    
    1. Repeating with a browser User-Agent still returned a Cloudflare challenge:
    HTTP/2 403
    cf-mitigated: challenge
    server: cloudflare
    
    1. A reqwest-style User-Agent also returned HTTP 403 from Cloudflare.

    This appears consistent with the broader class of Codex OAuth failures where the browser auth step works, but the non-browser token exchange to https://auth.openai.com/oauth/token cannot complete. The Cloudflare cf-mitigated: challenge response may be relevant.

    Note: this is Codex Desktop, not Codex CLI (codex is not installed in the shell on this machine).

    Please consider improving the client-side error surface to expose the underlying HTTP status / Cloudflare response instead of only error sending request for url, and investigate whether the desktop token-exchange request is being challenged or blocked by Cloudflare.

  6. xiaxiaojie1989 commented on Sep 7, 2026

    @xiaxiaojie1989

    Adding another macOS Desktop reproduction with network diagnostics.

    Environment / symptoms:

    • macOS on MacBook Air
    • Codex Desktop login via ChatGPT browser flow
    • Browser authentication proceeds, but the final token exchange fails with:
    Error code: token_exchange_failed
    Details: Token exchange failed: error sending request for url (https://auth.openai.com/oauth/token)
    

    Network diagnostics:

    1. The shell initially had explicit HTTP(S) proxy env vars pointing to a local proxy:
    http_proxy=http://127.0.0.1:4780
    https_proxy=http://127.0.0.1:4780
    HTTP_PROXY=http://127.0.0.1:4780
    HTTPS_PROXY=http://127.0.0.1:4780
    

    With those set, curl -I https://auth.openai.com failed during TLS with:

    HTTP/1.1 200 Connection established
    curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to auth.openai.com:443
    
    1. After unsetting all HTTP/HTTPS/ALL_PROXY variables, TLS connectivity succeeded, but auth.openai.com returned Cloudflare 403:
    HTTP/2 403
    server: cloudflare
    
    1. Repeating with a browser User-Agent still returned a Cloudflare challenge:
    HTTP/2 403
    cf-mitigated: challenge
    server: cloudflare
    
    1. A reqwest-style User-Agent also returned HTTP 403 from Cloudflare.

    This appears consistent with the broader class of Codex OAuth failures where the browser auth step works, but the non-browser token exchange to https://auth.openai.com/oauth/token cannot complete. The Cloudflare cf-mitigated: challenge response may be relevant.

    Note: this is Codex Desktop, not Codex CLI (codex is not installed in the shell on this machine).

    Please consider improving the client-side error surface to expose the underlying HTTP status / Cloudflare response instead of only error sending request for url, and investigate whether the desktop token-exchange request is being challenged or blocked by Cloudflare.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appauthIssues related to authentication and accountsbugSomething isn't workingconnectivityIssues involving networking or endpoint connectivity problems (disconnections)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions