Skip to content

Codex one-click update right after an OpenAI release leaves Codex without its platform binary #16160

Open

Description

@henrik092

What happened

The desktop app offered a Codex update. I clicked it, and afterwards every Codex thread failed. The provider banner showed Codex app-server provider probe failed: Codex App Server process exited with code 1. and new turns failed with Failed to fork codex provider thread …. Nothing in the UI said that Codex itself was broken or how to fix it.

Diagnosis

  1. The update ran while the release was still propagating. OpenAI published @openai/codex@0.160.1 at 18:33:51Z. Its platform package 0.160.1-linux-x64 is listed at 18:35:04Z. The provider update toast ran npm install -g --prefix <nvm node 22 prefix> --allow-scripts=@openai/codex @openai/codex@latest at 18:36:21Z (ws.rpc.server.updateProvider → ProviderMaintenanceRunner.runCommand, 1.8 s).
  2. npm dropped the platform binary silently. The registry still returned 404 for the linux-x64 tarball at that moment. Because it is an optionalDependency, npm logged reify failed optional dependency and still exited 0. The result was a launcher with no binary: codex --version fails with Error: Missing optional dependency @openai/codex-linux-x64. Reinstall Codex: npm install -g @openai/codex@latest.
  3. T3 Code showed only the exit code. The post-update refresh (probeCodexAppServerProvider) failed with CodexAppServerProcessExitedError: … exited with code 1, and the codex stderr with the actual cause never reached the UI. In runCommandAndVerify (apps/server/src/provider/providerMaintenanceRunner.ts) this most likely ends as unchanged, "could not verify the provider version". From that the user cannot tell that the install is broken and that simply re-running the update fixes it. I did not capture the toast text.
    Possible improvements:
  • Before offering or running an npm-based update, check that the tarball for the current platform's optional binary package can actually be fetched, or retry or hold the update for a short window after the publish time.
  • After an update, verify by running the binary (codex --version) and show its stderr. If the output contains Missing optional dependency, report the install as broken and offer to reinstall.
  • Include the child's stderr in CodexAppServerProcessExitedError so the provider banner shows the real reason.

Steps to reproduce

Deterministic repro needs a release whose platform tarball is not fetchable yet. To simulate it:

  1. Install Codex globally with npm on Linux x64. T3 resolves it as an npm-global install.
  2. Remove <prefix>/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64. This is the state npm leaves behind after the 404.
  3. Open T3 Code. The provider status shows Codex App Server process exited with code 1 without the underlying Missing optional dependency message, and Codex turns fail with Failed to fork codex provider thread ….
  4. Run the same npm install again: the package is restored and Codex works.

Version

0.0.46-nightly.20261005.2689 (desktop, nightly channel)

Environment

Linux Mint 22.3 x64 (kernel 7.0.0), codex-cli 0.160.1 (npm global in an nvm Node 22.19 prefix, run with Node 24.21 / npm 11.19 from vite-plus on PATH), claude 2.1.289

Evidence

# npm debug log of the update (~/.npm/_logs/2026-10-05T18_36_21_420Z-debug-0.log)
7 verbose argv "install" "--global" "--prefix" "~/.nvm/versions/node/v22.19.0" "--allow-scripts" "@openai/codex" "@openai/codex@latest"
69 silly placeDep node_modules/@openai/codex @openai/codex-linux-x64@0.160.1-linux-x64 OK for: @openai/codex@0.160.1 want: npm:@openai/codex@0.160.1-linux-x64
78 http fetch GET 404 https://registry.npmjs.org/@openai/codex/-/codex-0.160.1-linux-x64.tgz 58ms (cache skip)
79 verbose reify failed optional dependency ~/.nvm/versions/node/v22.19.0/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64
88 verbose exit 0

# registry publish times (npm view @openai/codex time)
0.160.1            2026-10-05T18:33:51.980Z
0.160.1-linux-x64  2026-10-05T18:35:04.137Z

# codex afterwards
Error: Missing optional dependency @openai/codex-linux-x64. Reinstall Codex: npm install -g @openai/codex@latest

# server trace, span tree of the update (local time = UTC+2)
ws.rpc.server.updateProvider
 └ ProviderMaintenanceRunner.runProviderUpdate      Success (1869 ms)
    └ refreshInstance → checkCodexProviderStatus
       └ probeCodexAppServerProvider                Failure: CodexAppServerProcessExitedError: Codex App Server process exited with code 1

Related issues

#14249 (Codex update leaves the install wrong) is related, but its cause is pnpm minimumReleaseAge; here npm silently drops a failed optional platform dependency. Not a duplicate.

Fix applied or workaround

Re-ran npm install -g --prefix <same prefix> @openai/codex@0.160.1 once the tarball was available (the platform package was then installed and codex --version worked), then restarted the desktop app. Re-clicking the provider update should have the same effect.

Filed by

Claude Code (Claude Opus 5.5) via t3 triage

Activity

  1. juliusmarminge commented on Oct 5, 2026

    @juliusmarminge
    Member

    Note

    Grok responding on behalf of Julius.

    Triage

    Thanks for the detailed timeline and debug log, @henrik092! It lines up with current main, and it's separate from #14249.

    What I found

    • The npm-global update runs npm install -g --prefix <prefix> --allow-scripts=@openai/codex @openai/codex@latest (resolvePackageManagedProviderMaintenance in apps/server/src/provider/providerMaintenance.ts). @openai/codex@0.160.1 declares @openai/codex-linux-x64 as an optional alias. When that tarball 404s, npm logs the failed optional dependency only at verbose level and still exits 0, which matches your log. T3 captures npm's default log level, so the command looks successful.
    • The update most likely reports success rather than the "could not verify" warning. checkCodexProviderStatus sets installed: true for every probe failure except CodexAppServerSpawnError, so a launcher that starts and exits 1 counts as installed with version: null. runCommandAndVerify deliberately keeps an update successful when the version is unreadable (this protects a Cursor case where about can fail on a healthy binary).
    • App-server stderr is discarded in makeChildStdio (stderr: () => Sink.drain), so Missing optional dependency @openai/codex-linux-x64 never reaches the banner, which only says the process exited with code 1. The fork error surfaces the same nested cause.
    • Upstream, the same npm optional-dependency behavior is tracked in openai/codex#41021 (platform tarball not published yet) and openai/codex#41283 (tarball fetch fails after publish).

    Likely fix area

    • One option: after a Codex update, treat a probe that fails because the process exited as a failed update, while leaving the null-version success path in place for Cursor.
    • Pass the child's stderr through to CodexAppServerProcessExitedError, so messages like "Missing optional dependency" show up in the UI.
    • Checking that the platform tarball resolves before updating would narrow the publish race, but it wouldn't catch a later download failure like #41283.

    A maintainer will decide on the fix direction.

  2. added
    bugSomething is broken or behaving incorrectly.
    via-triageFiled through npx t3 triage
    on Oct 5, 2026
  3. henrik092 commented on Oct 5, 2026

    @henrik092
    Author

    Related: #14333 (same Missing optional dependency @openai/codex-win32-x64 hidden behind exited with code 1, closed as an install problem; this issue shows how T3's own provider update can produce that state) and #2486 (codex app-server stderr not surfaced).

  4. juliusmarminge commented on Oct 22, 2026

    @juliusmarminge
    Member

    Reproduced on Linux x64 at a12d6ed942 in the web dev app. Installed @openai/codex@0.160.1 into an isolated npm global prefix, verified codex --version, then moved its @openai/codex-linux-x64 package out as described. The CLI printed Missing optional dependency @openai/codex-linux-x64; the app banner showed only Codex App Server process exited with code 1.

    Broken Codex provider banner

    The release-propagation race itself was not replayed. Desktop/Electron has not been checked here.

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

    bugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions