[Windows][WSL][Auth] Codex Desktop OAuth hangs on consent page after switching Agent Environment to WSL
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
Summary
I encountered an issue with Codex Desktop on Windows 11 after changing the Integrated Terminal Shell setting from PowerShell to WSL.
Codex continued to work normally for some time after this change.
Later, when I sent messages in Codex conversations, the messages were sent but Codex did not return any response.
I signed out of my ChatGPT account in Codex Desktop as a troubleshooting step. After signing out, I had to authenticate again.
The browser authentication flow reached:
https://auth.openai.com/sign-in-with-chatgpt/codex/consent
but the page kept loading indefinitely and the authentication process did not complete.
After reinstalling Codex Desktop, confirming that the Integrated Terminal Shell was set back to PowerShell, and fully shutting down WSL, the OAuth login completed successfully and Codex resumed working normally.
Environment
- OS: Windows 11
- Codex Desktop: Powered by Codex & OWL version 26.901.31953
- WSL: Ubuntu on WSL2
- ChatGPT plan: Plus
- Browser used for OAuth: Google Chrome
- Codex configuration:
C:\Users\admin\.codex\config.toml
Timeline
- Codex Desktop was working normally on Windows.
- I changed the Integrated Terminal Shell setting from PowerShell to WSL.
- Codex continued to work normally initially.
- Later, Codex stopped returning responses when I sent messages in conversations.
- I signed out of my ChatGPT account in Codex Desktop to troubleshoot the problem.
- After signing out, Codex required authentication again.
- The browser OAuth flow reached:
https://auth.openai.com/sign-in-with-chatgpt/codex/consent - The consent page kept loading indefinitely and authentication did not complete.
- I uninstalled and reinstalled Codex Desktop.
- After reinstalling, I checked
config.tomland confirmed the following settings:
[desktop]
runCodexInWindowsSubsystemForLinux = false
integratedTerminalShell = "powershell"
- I fully shut down WSL:
wsl --shutdown
- I confirmed that Ubuntu was stopped:
wsl --list --verbose
Output:
NAME STATE VERSION
Ubuntu Stopped 2
- I then started Codex Desktop again and completed the ChatGPT OAuth login successfully.
- Codex Desktop returned to normal operation.
Initial Symptom
The first symptom was not an OAuth error.
Codex Desktop initially stopped responding to conversations.
When I sent a message:
- the message could be submitted
- Codex did not return a response
- the conversation remained stuck
I signed out only because I was trying to resolve this original problem.
The OAuth problem appeared after signing out and attempting to authenticate again.
OAuth Behavior
During re-authentication:
-
Codex Desktop opened the browser.
-
The ChatGPT authentication flow proceeded to:
https://auth.openai.com/sign-in-with-chatgpt/codex/consent -
The consent page kept loading indefinitely.
-
The expected authentication completion / return to Codex Desktop did not occur.
-
Codex Desktop remained unauthenticated.
During one clean attempt, I did not see a useful JavaScript error in the Chrome DevTools Console.
Troubleshooting Performed
I tested the following during troubleshooting:
- another ChatGPT account
- reinstalling Codex Desktop
- inspecting Chrome DevTools Console
- inspecting Chrome DevTools Network
- fully shutting down WSL
Changing the ChatGPT account did not resolve the issue.
The successful recovery occurred after reinstalling Codex Desktop, confirming that the Integrated Terminal Shell was set to PowerShell, fully stopping WSL, and then authenticating again.
Working Configuration
After reinstalling Codex, the relevant configuration was:
[desktop]
runCodexInWindowsSubsystemForLinux = false
integratedTerminalShell = "powershell"
I then ran:
wsl --shutdown
wsl --list --verbose
and confirmed:
Ubuntu Stopped 2
After starting Codex Desktop again, OAuth authentication completed successfully.
Expected Behavior
Changing the Integrated Terminal Shell from PowerShell to WSL should not cause Codex Desktop conversations to stop responding.
If authentication is required, the ChatGPT OAuth flow should complete normally.
If there is a problem related to the WSL terminal environment, Codex Desktop should provide a clear error instead of:
- silently leaving conversations without responses
- leaving the OAuth consent page loading indefinitely
Workaround
The following sequence restored normal operation in my case:
- Reinstall Codex Desktop.
- Confirm the configuration contains:
[desktop]
runCodexInWindowsSubsystemForLinux = false
integratedTerminalShell = "powershell"
- Fully stop WSL:
wsl --shutdown
- Confirm that Ubuntu is stopped:
wsl --list --verbose
- Start Codex Desktop.
- Sign in with ChatGPT again.
Authentication completed successfully after these steps.
Possible Area to Investigate
I cannot confirm the root cause.
The issue appeared after I changed the Integrated Terminal Shell from PowerShell to WSL.
The original symptom was that Codex conversations stopped returning responses. After signing out, the OAuth authentication flow also became stuck.
Normal operation returned after Codex was reinstalled, the Integrated Terminal Shell was set to PowerShell, WSL was fully stopped, and authentication was attempted again.
This may be worth investigating around the interaction between:
- Codex Desktop on Windows
- the WSL integrated terminal
- the WSL runtime
- ChatGPT OAuth authentication
- the authentication handoff back to Codex Desktop
I am happy to provide additional logs, screenshots, or diagnostics if needed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Windows 11 setup using the Integrated Terminal Shell setting, the [desktop] entries in C:\Users\admin.codex\config.toml, and an active WSL2 Ubuntu environment. Compare OAuth and conversation behavior with PowerShell and after wsl --shutdown; done means conversations return responses and the ChatGPT consent flow completes without reinstalling Codex.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell, rust
- Domain
- authentication, desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100