Skip to content

Codex Desktop for Windows – authentication loop after opening local project #40699

Description

@spencertys

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

26.818.61809

What subscription do you have?

Pro

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What issue are you seeing?

I am experiencing a persistent authentication loop in Codex Desktop on Windows.

Authentication succeeds in the browser and Codex returns to the application normally. However, as soon as I open a local project/folder, Codex loses authentication and asks me to sign in again. Re-authenticating repeats the same loop.

I have tested:

Passkey authentication and non-passkey authentication
Removing OPENAI_API_KEY temporarily from Windows environment variables
Updating Codex Desktop to the latest available version
Multiple local folders

The problem persists.

The important diagnostic point is that Codex CLI works correctly on the same Windows machine, with the same account and the exact same project folder:

E:\Projets\Test

Codex CLI v0.149.1 authenticates automatically and remains connected.

Desktop logs show:

desktop_fetch_auth_401 hadToken=true

followed immediately by:

hasToken=false nullReason=auth_token_missing refreshToken=true tokenExpiryState=missing

and then:

Missing valid access token or actor biscuit

with HTTP 401 responses on:

/backend-api/accounts/.../settings

and /backend-api/wham/...

Example sequence:

desktop_fetch_auth_401 hadToken=true ... status 401

then:

auth_status_result ... hasToken=false nullReason=auth_token_missing refreshToken=true

This strongly suggests that the Windows Desktop client is losing or failing to attach the ChatGPT authentication token after receiving the first 401, while the underlying Codex authentication remains valid because CLI continues working.

Environment:

Windows x64
Codex Desktop originally affected on 26.818.61809, still affected after update
Codex CLI v0.149.1 works normally
ChatGPT account authentication itself works normally

I can provide the full Codex Desktop log if needed.

What steps can reproduce the bug?

Steps to reproduce

Launch Codex Desktop on Windows.
Sign in with my ChatGPT/OpenAI account. Authentication succeeds in the browser and returns to Codex Desktop.
Open/select a local project folder, for example:
E:\Projets\Test
Codex Desktop immediately loses the authenticated state and asks me to sign in again.
Sign in again successfully.
Return to Codex Desktop and select/open the local folder again.
The same authentication prompt appears again, creating an infinite authentication loop.

Expected behavior

After successful authentication, Codex Desktop should remain signed in and open the local project normally.

Actual behavior

Codex Desktop repeatedly loses authentication after opening the local project and asks me to sign in again.

Important diagnostic information

The same account and the same project work correctly in Codex CLI on the same Windows machine:

OpenAI Codex v0.149.1
directory: E:\Projets\Test

The CLI authenticates automatically and stays connected, so the issue appears to be specific to Codex Desktop.

Desktop logs show the following sequence:

desktop_fetch_auth_401 hadToken=true

followed immediately by:

hasToken=false nullReason=auth_token_missing refreshToken=true tokenExpiryState=missing

and then:

Missing valid access token or actor biscuit

with HTTP 401 responses on account/settings endpoints.

Environment / recent account changes

I am not sure which of these changes is related to the issue, but shortly before the problem I made several account/authentication changes:

I purchased/created an OpenAI API key.
I added OPENAI_API_KEY as a Windows system environment variable.
I later removed it temporarily for testing, but the issue still occurred.
I changed my authentication method.
I added a passkey.
I changed my password.
I also tested signing in without the passkey, but the issue still occurred.

Because several authentication-related changes happened close together, I cannot determine which one, if any, triggered the issue.

Versions tested

Codex Desktop: originally reproduced on 26.818.61809
Still reproducible after updating Codex Desktop
Codex CLI: v0.149.1 works correctly

Session ID / usage / context

I do not currently have a session ID associated with the failed Desktop authentication loop.
The failure occurs immediately when opening the local project, before doing meaningful work in the session.
Token-limit usage and context-window usage do not appear applicable to the reproduction, because the authentication failure happens before a normal Codex interaction starts.

What is the expected behavior?

Expected behavior:

After successfully signing in to my OpenAI/ChatGPT account, Codex Desktop should remain authenticated and allow me to open and work in a local project folder without asking me to sign in again.

The authentication session should persist normally, as it currently does with Codex CLI on the same computer, using the same account and the same local project.

Additional information

Additional information:

The issue appears to be specific to Codex Desktop on Windows.

Codex CLI v0.149.1 works correctly on the same machine, with the same OpenAI/ChatGPT account and the exact same local project folder. The CLI authenticates automatically and remains signed in.

The Desktop logs show a consistent authentication failure sequence:

desktop_fetch_auth_401 hadToken=true

Immediately afterwards:

hasToken=false nullReason=auth_token_missing refreshToken=true tokenExpiryState=missing

Then subsequent requests fail with:

Missing valid access token or actor biscuit

This suggests that Codex Desktop initially has an authentication token, receives a 401 response, and then loses or stops attaching the token even though a refresh token is present.

I also tested the following without resolving the issue:

  • Updated Codex Desktop to the latest available version.
  • Signed in using a passkey.
  • Signed in without using the passkey.
  • Temporarily removed my OPENAI_API_KEY Windows environment variable.
  • Restarted Codex and authenticated again.

Recent account changes that may or may not be related:

  • I created/purchased an OpenAI API key.
  • I added a passkey to my account.
  • I changed my password.
  • I changed authentication-related settings.

I cannot determine whether any of these changes triggered the problem.

The important distinction is that authentication still works correctly in Codex CLI, while Codex Desktop enters an infinite sign-in loop.

I can provide the full Codex Desktop logs if needed.

Activity

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 workingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions