codex:// protocol handler fails on Windows - # fragment treated as file path
What version of the Codex App are you using (From “About Codex” dialog)?
26.527.3686.0
What subscription do you have?
ChatGPT Pro
What platform is your computer?
"$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" })"
What issue are you seeing?
OS: Windows 11
App version: 26.527.3686.0 (Microsoft Store)
When returning from Gmail OAuth in browser, the callback URL contains a # fragment:
codex://...#type=click&tag=13394687635910341552
Windows shows error:
"Unable to find Electron app at C:\Program Files\WindowsApps\OpenAI.Codex_...\app\co...#type=click&tag=..."
"Cannot find module '...#type=click&tag=...'"
The # and everything after it is being interpreted as a file path instead of a URL fragment.
Reinstalling, resetting, and re-registering the protocol handler did not fix this.
<img width="1920" height="1019" alt="Image" src="https://github.com/user-attachments/assets/bdda9110-87bd-4bc4-99af-581fbd1a60ba" />
What steps can reproduce the bug?
- Open Codex app
- Go to Settings and connect Gmail account
- Browser opens for OAuth authentication
- Complete authentication in browser
- Browser redirects back to Codex via codex:// protocol URL containing # fragment
(e.g. codex://...#type=click&tag=13394687635910341552)
Result: Error dialog appears:
"Unable to find Electron app at C:\Program Files\WindowsApps\OpenAI.Codex_...\app\co...#type=click&tag=..."
"Cannot find module '...#type=click&tag=...'"
The # fragment in the callback URL is being treated as a file path, causing the app to fail.
Gmail connection does not complete.
What is the expected behavior?
After completing Gmail OAuth in the browser, the app should
handle the codex:// callback URL correctly, parse the # fragment
as a URL fragment (not a file path), and successfully complete
the Gmail connection.
Additional information
Tried the following without success:
- Reinstalling the app from Microsoft Store
- Re-registering the protocol handler via PowerShell
- Resetting the app package
- Manually setting registry keys for codex:// protocol handler
- Rebooting and re-registering AppxManifest.xml before launching the app
The app itself launches fine. The issue only occurs when returning
from OAuth flow in the browser.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗