Skip to content

Windows: Desktop fails to start after auto-update - stale per-user backend (CODEX_CLI_PATH) and silently invalidated auth session #46154

Open

Description

@hxtao1001

What version of the Codex App are you using (From “About Codex” dialog)?

26.911.7940.0 (Windows package OpenAI.Codex_26.911.7940.0_x64__2p2nqsd0c76g0); bundled CLI in use: codex-cli 0.154.0-alpha.6.2

What subscription do you have?

ChatGPT Plus

What platform is your computer?

No response

What issue are you seeing?

After the Codex desktop app auto-updated, it failed to start: no window appeared for 4+ minutes while the main process burned CPU continuously.

Two independent root causes were found on this machine.

  1. Stale bundled CLI in the per-user runtime directory

The app launches the executable selected by the user-level CODEX_CLI_PATH override, which points at the per-user runtime copy:
C:\Users<user>.codex.sandbox-bin\codex.exe

The MSIX package update only replaces the payload under C:\Program Files\WindowsApps\ and does NOT refresh this per-user copy. After the last update, all four backend binaries in .sandbox-bin differed from the ones bundled in the updated package - and comparing file sizes alone is not enough, because several differ in content while having identical sizes:

  • codex.exe: size identical, content differs
  • codex-code-mode-host.exe: differs (72,471,848 vs 72,471,856)
  • codex-command-runner.exe: size identical, content differs
  • codex-windows-sandbox-setup.exe: size identical, content differs

The app gave no indication it was running a stale app-server; startup simply hung.

  1. Auth session silently invalidated, while login status still reports "logged in"

codex login status reported "Logged in using ChatGPT", while the stored tokens were unusable. Refreshing returned HTTP 401:
{"error":{"message":"Your session has ended. Please log in again.","code":"refresh_token_invalidated"}}

The id_token was expired and the refresh_token had been revoked server-side (the machine had been idle for several days). Nothing in the UI surfaced this - the app just failed to start.

What steps can reproduce the bug?

  1. Use Codex Desktop on Windows with a user-level CODEX_CLI_PATH set. This override is the documented workaround for the "Unable to locate the Codex CLI binary" startup failure (see [Windows 26.820] Codex Desktop cannot start: bundled codex.exe relocation from WindowsApps fails #40700 / [Bug] Windows Desktop app fails to start after update to v26.820.60940 ("Unable to locate Codex CLI" & spawn EINVAL on .cmd wrapper) #40752 / [Windows Desktop] Stale CODEX_CLI_PATH after app update breaks paginated thread restore #40796).
  2. Let the app auto-update through the MSIX store while the override is in place.
  3. Fully exit and relaunch the app.
  4. Observe: no window appears and the main process consumes CPU indefinitely.
  5. Compare each .exe under %USERPROFILE%.codex.sandbox-bin against the same-named file under the updated package's app\resources directory - hashes differ even when file sizes match.
  6. Separately, leave the app unused for several days and relaunch: codex login status still says logged in, but POST https://auth.openai.com/oauth/token with grant_type=refresh_token returns 401 refresh_token_invalidated.

What is the expected behavior?

  1. When the desktop app updates, it should validate the version and/or protocol capabilities of the app-server binary it is about to launch (including one selected via CODEX_CLI_PATH), and either refresh it automatically or refuse to start with an actionable error naming the configured path and the detected version mismatch - instead of hanging silently.

  2. Before opening a thread, the app should verify that stored credentials are still usable (e.g. probe the refresh endpoint). If the session has been invalidated server-side, it should prompt the user to sign in again, instead of continuing to report codex login status: Logged in using ChatGPT.

Additional information

No response

Activity

  1. added
    app
    on Sep 17, 2026
  2. added
    bug
    windows-os
    app-server
    auth
    on Sep 17, 2026
  3. github-actions commented on Sep 17, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

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

    appapp-serverauthbugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions