Codex Desktop macOS authentication fails: browser bridge cannot open OAuth URL and callback listener is not started

Open 💬 1 comment Opened Aug 26, 2026 by tverdiukov

Summary

Codex Desktop on macOS cannot complete ChatGPT authentication.

The app generates a valid OAuth URL but fails to open it through its internal browser bridge:

[link-opening] Failed to open link
errorMessage="Failed to open URL"
initiator=open_in_browser_bridge

At the same time, the expected local OAuth callback listener on localhost:1455 is not started.

Because of this, I cannot sign in to Codex Desktop at all.

Environment

  • macOS: 26.6.1
  • Apple Silicon Mac
  • Codex / ChatGPT Desktop version: 26.820.60940
  • Bundle version: 7119
  • Bundle identifier: com.openai.codex
  • URL scheme registered by the app: codex://

Background

I had been using Codex Desktop normally for some time.

Before this authentication failure occurred, I had already noticed a related issue: opening Profile from Codex settings sometimes failed with a macOS application/opening error.

Later I changed the email address on my OpenAI account. This invalidated the existing Codex session, which is expected.

After that, Codex required me to sign in again, but the desktop authentication flow no longer worked.

I do not think changing the email itself is necessarily the root cause, because the external-link/Profile opening problem existed before the email change. The email change appears to have invalidated the old session and exposed the existing authentication/open-link issue.

Actual behavior

When Codex starts, the previous refresh token is rejected:

Failed to refresh token: 401 Unauthorized

"Your session has ended. Please log in again."

code: "refresh_token_invalidated"

The app then reports that no valid ChatGPT token is available:

app_server_connection.auth_status_result
authMethod=chatgpt
hasToken=false
nullReason=auth_token_missing
refreshToken=true
tokenExpiryState=missing

Backend requests subsequently fail with 401 Unauthorized, for example:

desktop_fetch_auth_401
target="GET https://chatgpt.com/backend-api/wham/accounts/check"

and:

chatgpt-account-lookup
accountsHttpStatus=401
authenticatedAccountPresent=false
failureType=account_info_token_unavailable

When I press Sign in with ChatGPT, Codex creates an OAuth URL but fails to open it:

[link-opening] Failed to open link
conversationId=undefined
errorMessage="Failed to open URL"
errorName=Error
initiator=open_in_browser_bridge
url=https://chatgpt.com/codex/desktop-auth?authorize_url=...

The OAuth redirect URI generated by Codex is:

http://localhost:1455/auth/callback

However, immediately after triggering login, there is no process listening on port 1455.

Command:

lsof -nP -iTCP:1455 -sTCP:LISTEN

Result:

(no output)

So the app appears to both:

  1. fail to open the OAuth URL through open_in_browser_bridge;
  2. fail to start the local callback listener on port 1455.

Important diagnostic detail

Opening normal HTTPS URLs from macOS works correctly.

Both of these commands successfully open the browser:

open "https://chatgpt.com"
open -a Safari "https://chatgpt.com"

So the system HTTP/HTTPS handler itself appears to work.

The problem seems specific to Codex Desktop's internal browser-opening/authentication flow.

Steps to reproduce

  1. Install Codex / ChatGPT Desktop on macOS.
  2. Start the app while no valid ChatGPT session exists.
  3. Click Sign in with ChatGPT.
  4. Codex attempts to start OAuth.
  5. The app fails to open the authentication URL.
  6. Authentication cannot proceed.
  7. localhost:1455 is not listening for the OAuth callback.

Expected behavior

Clicking Sign in with ChatGPT should:

  1. start the local callback listener;
  2. open the authentication URL in the default browser;
  3. complete OAuth;
  4. return the session to Codex Desktop;
  5. sign the user into the existing ChatGPT account.

What I already tried

I have already tried all of the following:

  • completely quitting the app;
  • removing ChatGPT/Codex;
  • removing associated application data;
  • reinstalling the latest version;
  • rebooting macOS;
  • re-registering the app with Launch Services;
  • verifying the codex:// URL scheme;
  • testing the app executable directly;
  • testing normal HTTP/HTTPS URL opening;
  • temporarily removing OPENAI_API_KEY from the shell environment;
  • retrying authentication after all of the above.

A full clean reinstall and reboot did not fix the issue.

Launch Services / bundle checks

The installed app reports:

CFBundleShortVersionString = 26.820.60940
CFBundleIdentifier = com.openai.codex

Its URL schemes include:

codex
http
https

The executable is present and valid:

/Applications/ChatGPT.app/Contents/MacOS/ChatGPT:
Mach-O 64-bit executable arm64

Additional note

Before the current login failure, opening Profile from Codex settings could also trigger an application-opening error. This may indicate that the same open_in_browser_bridge / external-link handling issue existed before the authentication session was invalidated.

Please let me know if there are additional logs or diagnostics I can provide.

View original on GitHub ↗

1 Comment

tverdiukov · 1 day ago

Workaround found: authenticating through Codex CLI restores Desktop

I found a workaround that immediately restored the Desktop app.

The Desktop app itself was unable to start/complete the OAuth flow, but the Codex CLI could.

Steps that fixed it:

  1. Installed Codex CLI (npm install -g @openai/codex).
  2. Ran codex logout (it reported Not logged in).
  3. Ran codex login.
  4. CLI successfully started the local login server on http://localhost:1455 and opened/completed the browser OAuth flow.
  5. CLI reported Successfully logged in.
  6. Started Codex Desktop again — it was immediately authenticated and working normally without any additional login.
  7. I then uninstalled the CLI (npm uninstall -g @openai/codex), and Desktop continued to work.

This strongly suggests the Desktop app and CLI share/reuse the resulting authentication state, while the Desktop app's own login flow is failing before it can obtain a fresh token. In particular, CLI successfully starts the localhost:1455 callback listener that Desktop was not starting in my previous tests.

So for affected users, a temporary workaround appears to be:

npm install -g @openai/codex
codex login
# complete ChatGPT login in browser
npm uninstall -g @openai/codex  # optional after Desktop starts working

After codex login succeeded, the previously broken Desktop app started working immediately.