Skip to content

Codex Windows desktop app deep link / OAuth callback bug #25368

Closed as duplicate

Description

@Roins-hub

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

Activity

  1. added
    app
    on May 31, 2026
  2. added
    bug
    windows-os
    auth
    on May 31, 2026
  3. Licantrop0 commented on May 31, 2026

    @Licantrop0

    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:

    redirect_uri = https://chatgpt.com/connector_platform_oauth_redirect
    scope        = openid email offline_access Mail.Read MailboxSettings.Read Mail.Read.Shared User.Read
    state        = codex_scheme__oauth_s_<redacted>
    

    That codex_scheme__ prefix on state is the tell: once Microsoft auth finishes, it hands back through a codex:// 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):

    "C:\Program Files\WindowsApps\OpenAI.Codex_26.527.3686.0_x64__2p2nqsd0c76g0\app\Codex.exe"
    

    (no positional args)

    Protocol activation (codex://oauth_callback?code=...):

    "C:\Program Files\WindowsApps\OpenAI.Codex_26.527.3686.0_x64__2p2nqsd0c76g0\app\Codex.exe" 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. It path.resolves the URL against the app dir, which produces:

    ...\OpenAI.Codex_26.527.3686.0_x64__2p2nqsd0c76g0\app\codex:\oauth_callback\?code=...
    

    I pulled the exact dialog text via UI Automation (not the truncated version in the tiny dialog):

    Error launching app
    Unable to find Electron app at
      C:\Program Files\WindowsApps\OpenAI.Codex_26.527.3686.0_x64__2p2nqsd0c76g0\app\codex:\oauth_callback\?code=...
    Cannot find module
      'C:\Program Files\WindowsApps\OpenAI.Codex_26.527.3686.0_x64__2p2nqsd0c76g0\app\codex:\oauth_callback\?code=...'
    

    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 whole codex://... string becomes one relative path segment.

    Warm start fails too (app already running)

    1. Launched Codex normally: healthy window, ~8 helper procs.
    2. Fired codex://oauth_callback?code=... while it was up.
    3. A brand new Codex.exe spawned (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.exe via CIM ExecutablePath. I also found a stale HKCU\Software\Classes\codex key (had URL Protocol, no shell\open\command), removed it, and re-registered:

    Add-AppxPackage -DisableDevelopmentMode -ForceApplicationShutdown -Register AppxManifest.xml
    

    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.json with the desktop app and logs in over localhost loopback / device code, so it skips codex://:

    codex login --device-auth
    # or
    printenv OPENAI_API_KEY | codex login --with-api-key
    

    codex login status then shows the session and the app picks it up. That covers login. Connectors still need the codex:// callback, so they stay dead until the app fix lands.

    Env

    • App 26.527.3686.0 (OpenAI.Codex_26.527.3686.0_x64__2p2nqsd0c76g0), exe ...\app\Codex.exe, Chromium 148.0.7778.179
    • Manifest: Executable=app/Codex.exe, EntryPoint=Windows.FullTrustApplication, <uap:Protocol Name="codex" />
    • Windows 11
  4. Roins-hub commented on Jun 1, 2026

    @Roins-hub
    Author

    Same here. I’m on OpenAI.Codex_26.527.3686.0_x64__2p2nqsd0c76g0 on Windows 11.

    I can confirm this is not fixed by:

    • Repair / Reset from Windows Settings
    • Uninstalling and reinstalling from Microsoft Store
    • Removing HKCU\Software\Classes\codex
    • Re-registering AppxManifest.xml
    • Re-assigning CODEX link type to Codex in Windows Default Apps

    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.

  5. shumuchen commented on Jun 1, 2026

    @shumuchen

    same here. even codex://test still trigger the problem

  6. ax-openai commented on Jun 12, 2026

    @ax-openai
    Contributor

    Closing as a duplicate of #25157.

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

    appauthbugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions