Repository navigation
Description
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.comworks; 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.tomlparses correctly and usesmodel_provider = "openai".
Relevant Desktop log events
account_login_completed success=falseworkspace routing discovery timed outWorkspace routing is unavailableFailed to sync primary runtime bundled plugin marketplacemarketplace '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
- On Windows 11 (build 26200), install Codex Desktop version
26.1029.7803.0. - Connect to the internet using Amnezia VPN with the AmneziaWG protocol.
- Launch Codex Desktop and select Sign in with ChatGPT.
- Complete the browser authentication flow.
- 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/tokenreach 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 doctorreportsconfig.toml parse okand the default provider asopenai.
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
CodexSandboxOfflineaccount.
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 returnedOK. - The Codex Desktop application (
26.1029.7803.0) consistently fails withtoken_exchange_failed. - The
https://auth.openai.com/oauth/tokenendpoint 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, withmodel_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 dedicatedCodexSandboxOfflineaccount, 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
github-actions commentedon Nov 4, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
[-]Не открывается Codex Desktop[/-][+]Codex Desktop won't open[/+]github-actions commentedon Nov 4, 2026
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_faileddespite working CLI authenticationEnvironment
Problem
Codex Desktop consistently fails ChatGPT sign-in with:
token_exchange_failederror sending request for url (https://auth.openai.com/oauth/token)Confirmed working
auth.openai.comworks; test requests return expected HTTP 400/405 responses.config.tomlparses correctly and usesmodel_provider = "openai".Relevant Desktop log events
account_login_completed success=falseworkspace routing discovery timed outWorkspace routing is unavailableFailed to sync primary runtime bundled plugin marketplacemarketplace 'openai-primary-runtime' is reserved and cannot be added from this sourceTroubleshooting already completed
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
26.1029.7803.0.Actual behavior
Codex Desktop fails to complete authentication and displays:
The issue is reproducible across repeated login attempts.
Desktop logs include:
Other recurring log messages include:
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
Disabling WSL integration does not resolve the issue.
Additional diagnostics
Environment:
26.1029.7803.00.162.10.166.0-alpha.6Working functionality:
auth.openai.com/oauth/tokenreach the server and return expected HTTP 400/405 responses for intentionally invalid requests.codex doctorreportsconfig.toml parse okand the default provider asopenai.Troubleshooting performed:
openai.CodexSandboxOfflineaccount.None of these steps resolved the Desktop authentication failure.
Session ID and token usage
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, orWorkspace routing is unavailableduring 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:
0.166.0-alpha.6) successfully executed a model inference request and returnedOK.26.1029.7803.0) consistently fails withtoken_exchange_failed.https://auth.openai.com/oauth/tokenendpoint is reachable. Intentionally invalid test requests returned expected HTTP 400/405 responses.codex doctor, withmodel_provider = "openai"and successful TOML parsing.Additional Desktop log errors:
The application also repeatedly logs:
It is unclear whether the marketplace synchronization failure is related to the authentication issue.
Security and firewall checks:
codex_sandbox_offline_block_*rules, but their local-user restriction was confirmed to target the dedicatedCodexSandboxOfflineaccount, not the regular Windows account.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.