Skip to content

Codex Desktop won't open #59439

Open
Open

Description

@shakh0902

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

Codex Desktop: 26.1029.7803.0

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Windows 11, build 26200

What issue are you seeing?

Codex Desktop on Windows: token_exchange_failed despite working CLI authentication

Environment

  • Windows 11, build 26200
  • Codex Desktop: 26.1029.7803.0
  • Codex CLI (npm): 0.162.1
  • Embedded Desktop CLI: 0.166.0-alpha.6
  • VPN: AmneziaWG

Problem

Codex Desktop consistently fails ChatGPT sign-in with:

token_exchange_failed

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

Confirmed working

  • ChatGPT opens successfully in Microsoft Edge.
  • HTTPS connectivity to auth.openai.com works; test requests return expected HTTP 400/405 responses.
  • Both npm and embedded Codex CLI have valid ChatGPT authentication.
  • The embedded CLI successfully executes a model request.
  • WebSocket connectivity returns HTTP 101.
  • config.toml parses correctly and uses model_provider = "openai".

Relevant Desktop log events

  • account_login_completed success=false
  • workspace routing discovery timed out
  • Workspace routing is unavailable
  • Failed to sync primary runtime bundled plugin marketplace
  • marketplace 'openai-primary-runtime' is reserved and cannot be added from this source

Troubleshooting already completed

  • Updated Codex Desktop.
  • Re-registered the Windows application.
  • Disabled WSL integration for Desktop.
  • Corrected the default model provider.
  • Tested the Codex background app-server.
  • Checked Defender events and Windows Firewall rules.
  • Confirmed the error persists.

Request

Please investigate why the Desktop application's OAuth token exchange or workspace-routing initialization fails while the embedded CLI successfully authenticates and executes model requests.

Please advise which specific diagnostic logs or application state can be collected without deleting existing sessions or authentication data.

What steps can reproduce the bug?

Steps to reproduce

  1. On Windows 11 (build 26200), install Codex Desktop version 26.1029.7803.0.
  2. Connect to the internet using Amnezia VPN with the AmneziaWG protocol.
  3. Launch Codex Desktop and select Sign in with ChatGPT.
  4. Complete the browser authentication flow.
  5. Return to Codex Desktop.

Actual behavior

Codex Desktop fails to complete authentication and displays:

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

The issue is reproducible across repeated login attempts.

Desktop logs include:

account_login_completed success=false
workspace routing discovery timed out
Workspace routing is unavailable

Other recurring log messages include:

marketplace `openai-primary-runtime` is reserved and cannot be added from this source
Failed to sync primary runtime bundled plugin marketplace

It has not been established whether these marketplace errors are causally related to the authentication failure.

Expected behavior

After completing browser authentication, Codex Desktop should successfully exchange the authorization code for tokens, sign in to the ChatGPT account, and load the workspace and available models.

Minimal configuration

model_provider = "openai"

[desktop]
runCodexInWindowsSubsystemForLinux = false
integratedTerminalShell = "powershell"

Disabling WSL integration does not resolve the issue.

Additional diagnostics

Environment:

  • OS: Windows 11, build 26200
  • Codex Desktop: 26.1029.7803.0
  • npm Codex CLI: 0.162.1
  • Embedded Desktop CLI: 0.166.0-alpha.6
  • VPN: AmneziaWG

Working functionality:

  • ChatGPT works in Microsoft Edge.
  • Requests to auth.openai.com/oauth/token reach the server and return expected HTTP 400/405 responses for intentionally invalid requests.
  • Both npm and embedded Codex CLI report valid ChatGPT authentication.
  • The embedded CLI successfully completes a model inference request.
  • WebSocket connectivity succeeds with HTTP 101.
  • codex doctor reports config.toml parse ok and the default provider as openai.

Troubleshooting performed:

  • Updated and re-registered the Codex Desktop application.
  • Set the default provider to openai.
  • Disabled WSL integration.
  • Tested the background app-server.
  • Checked Microsoft Defender events.
  • Inspected Windows Firewall rules and confirmed the Codex sandbox network restrictions apply to the dedicated CodexSandboxOffline account.

None of these steps resolved the Desktop authentication failure.

Session ID and token usage

  • Affected Desktop session ID: Not available in the collected diagnostic output.
  • Token usage limit: Not available; the failure occurs during authentication, before a model conversation begins.
  • Context window usage: Not applicable to this login failure.

Request

Please investigate why the Codex Desktop OAuth token exchange or workspace initialization fails while the embedded CLI can successfully authenticate and execute inference requests using the same ChatGPT account.

Please also advise which additional sanitized diagnostic information would help identify the cause without resetting existing sessions or authentication data.

What is the expected behavior?

After completing the ChatGPT authentication flow in the browser, Codex Desktop should successfully exchange the OAuth authorization code for access tokens and sign in to the user's ChatGPT account.

The application should then load the workspace, display the available models, and allow users to create new conversations without authentication errors.

Since both the standalone Codex CLI and the CLI bundled with Codex Desktop can successfully authenticate and execute model requests using the same account and VPN connection, Codex Desktop is expected to work under these conditions as well.

The application should not display token_exchange_failed, workspace routing discovery timed out, or Workspace routing is unavailable during a successful sign-in.

Additional information

Additional information

The issue appears to be specific to the Codex Desktop application rather than a general network connectivity or ChatGPT account authentication failure.

Important diagnostic findings:

  • Both the standalone Codex CLI and the CLI bundled with Codex Desktop are successfully authenticated using ChatGPT.
  • The embedded Desktop CLI (0.166.0-alpha.6) successfully executed a model inference request and returned OK.
  • The Codex Desktop application (26.1029.7803.0) consistently fails with token_exchange_failed.
  • The https://auth.openai.com/oauth/token endpoint is reachable. Intentionally invalid test requests returned expected HTTP 400/405 responses.
  • WebSocket connectivity to ChatGPT succeeds with HTTP 101.
  • ChatGPT works normally in Microsoft Edge InPrivate mode through the same AmneziaWG VPN.
  • The configuration has been validated using codex doctor, with model_provider = "openai" and successful TOML parsing.
  • Disabling WSL integration and switching the integrated terminal to PowerShell did not resolve the issue.
  • Updating and re-registering the Windows application did not resolve the issue.

Additional Desktop log errors:

account_login_completed success=false
workspace routing discovery timed out
Workspace routing is unavailable

The application also repeatedly logs:

marketplace `openai-primary-runtime` is reserved and cannot be added from this source
Failed to sync primary runtime bundled plugin marketplace

It is unclear whether the marketplace synchronization failure is related to the authentication issue.

Security and firewall checks:

  • No matching Microsoft Defender block events were found during the diagnostic window.
  • Windows Firewall contains codex_sandbox_offline_block_* rules, but their local-user restriction was confirmed to target the dedicated CodexSandboxOffline account, not the regular Windows account.
  • No system proxy or relevant proxy environment variables were configured.

Data preservation:

I would prefer a solution that does not require deleting existing Codex sessions, configuration files, workspace history, or stored authentication data.

I can provide additional sanitized Desktop logs, timestamps, and diagnostic output if needed. Please let me know which specific information would be most useful.

Activity

  1. added
    app
    on Nov 4, 2026
  2. added
    bug
    windows-os
    auth
    connectivity
    on Nov 4, 2026
  3. github-actions commented on Nov 4, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  4. changed the title [-]Не открывается Codex Desktop[/-] [+]Codex Desktop won't open[/+] on Nov 4, 2026
  5. github-actions commented on Nov 4, 2026

    @github-actions
    Contributor

    English translation:

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

    Codex Desktop: 26.1029.7803.0

    What subscription do you have?

    ChatGPT Plus

    What platform is your computer?

    Windows 11, build 26200

    What issue are you seeing?

    Codex Desktop on Windows: token_exchange_failed despite working CLI authentication

    Environment

    • Windows 11, build 26200
    • Codex Desktop: 26.1029.7803.0
    • Codex CLI (npm): 0.162.1
    • Embedded Desktop CLI: 0.166.0-alpha.6
    • VPN: AmneziaWG

    Problem

    Codex Desktop consistently fails ChatGPT sign-in with:

    token_exchange_failed

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

    Confirmed working

    • ChatGPT opens successfully in Microsoft Edge.
    • HTTPS connectivity to auth.openai.com works; test requests return expected HTTP 400/405 responses.
    • Both npm and embedded Codex CLI have valid ChatGPT authentication.
    • The embedded CLI successfully executes a model request.
    • WebSocket connectivity returns HTTP 101.
    • config.toml parses correctly and uses model_provider = "openai".

    Relevant Desktop log events

    • account_login_completed success=false
    • workspace routing discovery timed out
    • Workspace routing is unavailable
    • Failed to sync primary runtime bundled plugin marketplace
    • marketplace 'openai-primary-runtime' is reserved and cannot be added from this source

    Troubleshooting already completed

    • Updated Codex Desktop.
    • Re-registered the Windows application.
    • Disabled WSL integration for Desktop.
    • Corrected the default model provider.
    • Tested the Codex background app-server.
    • Checked Defender events and Windows Firewall rules.
    • Confirmed the error persists.

    Request

    Please investigate why the Desktop application's OAuth token exchange or workspace-routing initialization fails while the embedded CLI successfully authenticates and executes model requests.

    Please advise which specific diagnostic logs or application state can be collected without deleting existing sessions or authentication data.

    What steps can reproduce the bug?

    Steps to reproduce

    1. On Windows 11 (build 26200), install Codex Desktop version 26.1029.7803.0.
    2. Connect to the internet using Amnezia VPN with the AmneziaWG protocol.
    3. Launch Codex Desktop and select Sign in with ChatGPT.
    4. Complete the browser authentication flow.
    5. Return to Codex Desktop.

    Actual behavior

    Codex Desktop fails to complete authentication and displays:

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

    The issue is reproducible across repeated login attempts.

    Desktop logs include:

    account_login_completed success=false
    workspace routing discovery timed out
    Workspace routing is unavailable
    

    Other recurring log messages include:

    marketplace `openai-primary-runtime` is reserved and cannot be added from this source
    Failed to sync primary runtime bundled plugin marketplace
    

    It has not been established whether these marketplace errors are causally related to the authentication failure.

    Expected behavior

    After completing browser authentication, Codex Desktop should successfully exchange the authorization code for tokens, sign in to the ChatGPT account, and load the workspace and available models.

    Minimal configuration

    model_provider = "openai"
    
    [desktop]
    runCodexInWindowsSubsystemForLinux = false
    integratedTerminalShell = "powershell"

    Disabling WSL integration does not resolve the issue.

    Additional diagnostics

    Environment:

    • OS: Windows 11, build 26200
    • Codex Desktop: 26.1029.7803.0
    • npm Codex CLI: 0.162.1
    • Embedded Desktop CLI: 0.166.0-alpha.6
    • VPN: AmneziaWG

    Working functionality:

    • ChatGPT works in Microsoft Edge.
    • Requests to auth.openai.com/oauth/token reach the server and return expected HTTP 400/405 responses for intentionally invalid requests.
    • Both npm and embedded Codex CLI report valid ChatGPT authentication.
    • The embedded CLI successfully completes a model inference request.
    • WebSocket connectivity succeeds with HTTP 101.
    • codex doctor reports config.toml parse ok and the default provider as openai.

    Troubleshooting performed:

    • Updated and re-registered the Codex Desktop application.
    • Set the default provider to openai.
    • Disabled WSL integration.
    • Tested the background app-server.
    • Checked Microsoft Defender events.
    • Inspected Windows Firewall rules and confirmed the Codex sandbox network restrictions apply to the dedicated CodexSandboxOffline account.

    None of these steps resolved the Desktop authentication failure.

    Session ID and token usage

    • Affected Desktop session ID: Not available in the collected diagnostic output.
    • Token usage limit: Not available; the failure occurs during authentication, before a model conversation begins.
    • Context window usage: Not applicable to this login failure.

    Request

    Please investigate why the Codex Desktop OAuth token exchange or workspace initialization fails while the embedded CLI can successfully authenticate and execute inference requests using the same ChatGPT account.

    Please also advise which additional sanitized diagnostic information would help identify the cause without resetting existing sessions or authentication data.

    What is the expected behavior?

    After completing the ChatGPT authentication flow in the browser, Codex Desktop should successfully exchange the OAuth authorization code for access tokens and sign in to the user's ChatGPT account.

    The application should then load the workspace, display the available models, and allow users to create new conversations without authentication errors.

    Since both the standalone Codex CLI and the CLI bundled with Codex Desktop can successfully authenticate and execute model requests using the same account and VPN connection, Codex Desktop is expected to work under these conditions as well.

    The application should not display token_exchange_failed, workspace routing discovery timed out, or Workspace routing is unavailable during a successful sign-in.

    Additional information

    Additional information

    The issue appears to be specific to the Codex Desktop application rather than a general network connectivity or ChatGPT account authentication failure.

    Important diagnostic findings:

    • Both the standalone Codex CLI and the CLI bundled with Codex Desktop are successfully authenticated using ChatGPT.
    • The embedded Desktop CLI (0.166.0-alpha.6) successfully executed a model inference request and returned OK.
    • The Codex Desktop application (26.1029.7803.0) consistently fails with token_exchange_failed.
    • The https://auth.openai.com/oauth/token endpoint is reachable. Intentionally invalid test requests returned expected HTTP 400/405 responses.
    • WebSocket connectivity to ChatGPT succeeds with HTTP 101.
    • ChatGPT works normally in Microsoft Edge InPrivate mode through the same AmneziaWG VPN.
    • The configuration has been validated using codex doctor, with model_provider = "openai" and successful TOML parsing.
    • Disabling WSL integration and switching the integrated terminal to PowerShell did not resolve the issue.
    • Updating and re-registering the Windows application did not resolve the issue.

    Additional Desktop log errors:

    account_login_completed success=false
    workspace routing discovery timed out
    Workspace routing is unavailable
    

    The application also repeatedly logs:

    marketplace `openai-primary-runtime` is reserved and cannot be added from this source
    Failed to sync primary runtime bundled plugin marketplace
    

    It is unclear whether the marketplace synchronization failure is related to the authentication issue.

    Security and firewall checks:

    • No matching Microsoft Defender block events were found during the diagnostic window.
    • Windows Firewall contains codex_sandbox_offline_block_* rules, but their local-user restriction was confirmed to target the dedicated CodexSandboxOffline account, not the regular Windows account.
    • No system proxy or relevant proxy environment variables were configured.

    Data preservation:

    I would prefer a solution that does not require deleting existing Codex sessions, configuration files, workspace history, or stored authentication data.

    I can provide additional sanitized Desktop logs, timestamps, and diagnostic output if needed. Please let me know which specific information would be most useful.

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

    appauthbugconnectivitywindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions