Codex Windows desktop app deep link / OAuth callback bug
What version of the Codex App are you using (From “About Codex” dialog)?
26.527.3686.0
What subscription do you have?
GPT-plus
What platform is your computer?
win11-x86
What issue are you seeing?
Codex Windows desktop app deep link / OAuth callback bug
Environment:
- Windows 11
- Codex desktop app version: 26.527.3686.0
- Package: OpenAI.Codex_26.527.3686.0_x64__2p2nqsd0c76g0
- App executable: C:\Program Files\WindowsApps\OpenAI.Codex_26.527.3686.0_x64__2p2nqsd0c76g0\app\Codex.exe
Issue:
Codex desktop app launches normally, but any browser/deep-link callback into Codex fails. This happens when connecting Supabase via OAuth and also when switching/login account flows.
Error shown:
"Error launching app"
"Unable to find Electron app at C:\Program Files\WindowsApps\OpenAI.Codex_26.52...\?code=...&state=..."
or
"Unable to find Electron app at C:\Program Files\WindowsApps\OpenAI.Codex_26.52...\type=click&tag=..."
"Cannot find module ..."
Expected:
The codex:// callback URL should be handled by the running Codex app.
Actual:
Electron appears to interpret the callback/query parameters as the Electron app path/module, then fails to find that module.
Tried:
- Repair Codex from Windows Settings
- Reset/reinstall Codex
- Re-register AppX package
- Recreate codex:// registry handler
- Issue persists across account switching and Supabase OAuth flow
Impact:
OAuth/deep-link flows into Codex are broken. Supabase MCP only works after bypassing OAuth and using SUPABASE_ACCESS_TOKEN manually.
What steps can reproduce the bug?
Feedback ID: 019e7310-3e24-7ca2-a019-7a2c0d1f1d11
What is the expected behavior?
Expected:
The codex:// callback URL should be handled by the running Codex app.
Additional information
_No response_
5 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Same build here (
OpenAI.Codex_26.527.3686.0_x64__2p2nqsd0c76g0). I think I've got the root cause pinned, plus two theories I can kill.What actually triggers it
For me it's the ChatGPT connector OAuth flow (hooking up a Microsoft/Outlook mail connector). The chain is: Microsoft login →
https://chatgpt.com/connector_platform_oauth_redirect→codex://oauth_callback?...back into the app. That last hop is what blows up.The upstream authorize URL is
login.microsoftonline.com/common/oauth2/v2.0/authorize, and the interesting (non-secret) bits are:That
codex_scheme__prefix onstateis the tell: once Microsoft auth finishes, it hands back through acodex://deep link. Same thing the Figma (#25188), Supabase (#25368), and connector (#25157 / #25257) reports are all hitting.The actual bug: the URL lands in argv[1] and gets treated as an app path
I grabbed the full command line of the process protocol activation spawns vs a normal launch (
Get-CimInstance Win32_Process -Filter "Name='Codex.exe'").Normal launch (
shell:AppsFolder\OpenAI.Codex_2p2nqsd0c76g0!App):(no positional args)
Protocol activation (
codex://oauth_callback?code=...):So the deep link shows up as the first positional arg, and the bootstrap treats
argv[1]as the app to load. Itpath.resolves the URL against the app dir, which produces:I pulled the exact dialog text via UI Automation (not the truncated version in the tiny dialog):
The fix is for the app to pull the
codex://URL out of argv before app resolution and route it through the single-instance handler, instead of resolving it as a path.This kills the "space in Program Files" theory (#25238)
The dialog truncates to
C:\Program ...because the box is tiny. The real resolved path is the whole URL bolted onto the app dir (...\app\codex:\oauth_callback\?code=...). Nothing got cut at the space. The wholecodex://...string becomes one relative path segment.Warm start fails too (app already running)
codex://oauth_callback?code=...while it was up.Codex.exespawned (titled "Error") instead of the URL going to the running instance.The crash is in app/module resolution, which runs before the single-instance / open-url handler. So the live instance never sees the URL.
Re-registering and registry surgery do nothing (I tried)
codex://already routes to the right exe. Confirmed the activated process is...\app\Codex.exevia CIMExecutablePath. I also found a staleHKCU\Software\Classes\codexkey (hadURL Protocol, noshell\open\command), removed it, and re-registered:Exit 0,
Status=Ok, identical error afterward. The manifest declares<uap:Protocol Name="codex" />correctly and activation hits the right exe. The registry's clean. The bug lives in how the app handles argv.Workaround: there isn't one for connectors
Connector OAuth flows (Microsoft mail, Figma, Supabase, etc.) have no workaround. The connector flow has to return through
codex://oauth_callback, and that's the exact hop that's broken. Nothing client-side fixes it. It needs an app fix.The CLI covers base ChatGPT sign-in, nothing more. It shares
~/.codex/auth.jsonwith the desktop app and logs in over localhost loopback / device code, so it skipscodex://:codex login statusthen shows the session and the app picks it up. That covers login. Connectors still need thecodex://callback, so they stay dead until the app fix lands.Env
26.527.3686.0(OpenAI.Codex_26.527.3686.0_x64__2p2nqsd0c76g0), exe...\app\Codex.exe, Chromium148.0.7778.179Executable=app/Codex.exe,EntryPoint=Windows.FullTrustApplication,<uap:Protocol Name="codex" />Same here. I’m on OpenAI.Codex_26.527.3686.0_x64__2p2nqsd0c76g0 on Windows 11.
I can confirm this is not fixed by:
After setting Codex as the default app for the CODEX link type, opening codex://test still launches Codex.exe but fails with:
"Error launching app"
"Unable to find Electron app at C:\Program Files\WindowsApps\OpenAI.Codex_26.527.3686.0_x64__2p2nqsd0c76g0\app\c...\test"
"Cannot find module ...\test"
So it looks like Windows is routing the protocol to the correct Codex.exe, but Codex/Electron is treating the codex:// URL as the app/module path instead of a deep-link argument.
This also breaks Supabase OAuth / connector flows for me. I worked around Supabase MCP by using SUPABASE_ACCESS_TOKEN, but connector OAuth flows that require codex://oauth_callback still fail.
same here. even codex://test still trigger the problem
Closing as a duplicate of #25157.