t3code icon indicating copy to clipboard operation
t3code copied to clipboard

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

Open henrik092 opened this issue 1 month ago • 6 comments

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/[email protected] 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/[email protected] OK for: @openai/[email protected] want: npm:@openai/[email protected]
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/[email protected] 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

henrik092 avatar Oct 05 '26 19:10 henrik092

[!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/[email protected] 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.

juliusmarminge avatar Oct 05 '26 19:10 juliusmarminge

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).

henrik092 avatar Oct 05 '26 19:10 henrik092

Reproduced on Linux x64 at a12d6ed942 in the web dev app. Installed @openai/[email protected] 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.

juliusmarminge avatar Oct 22 '26 01:10 juliusmarminge

Adding a Windows incident from November 13, 2026, and a recovery UX observation.

Environment

  • Windows x64, OS build 10.0.26200.
  • T3 Code desktop executable version: 0.1.9.
  • Codex CLI: npm-global @openai/[email protected].
  • Node.js 24.15.0 / npm 11.12.1.

Observed failure

The Codex provider was marked Unavailable:

Codex app-server provider probe failed: Codex App Server process exited with code 1:
Error: Missing optional dependency @openai/codex-win32-x64.
Reinstall Codex: npm install -g @openai/codex@latest

Running codex --version outside T3 also exited with code 1 and the same missing-dependency error. The installed npm package declared the Windows platform package, but that dependency was unmet.

Recovery performed

The repair included cleaning up a stale npm staging directory and running:

npm install -g @openai/codex@latest
codex --version

The install completed successfully, codex --version returned codex-cli 0.169.0, and a subsequent codex app-server startup smoke test no longer produced the missing-dependency failure.

Scope and remaining recovery UX

Unlike the original report, T3 did surface the underlying stderr and the reinstall command in this incident. That part of the diagnostics is already helpful.

The remaining suggestion is to recognize this known error as an incomplete Codex installation, provide recovery instructions appropriate to the detected install method, and make it easy to re-run the provider probe after repair. Windows npm recovery guidance could also recommend ending sessions that use the same CLI before reinstalling or upgrading. For updates launched by T3, verifying that Codex actually runs would help catch a missing platform package even when npm reports success.

The original failing install/upgrade log was no longer available. I cannot establish what triggered that install, whether T3 initiated it, or whether the cause was a file lock, an interrupted update, or a download failure. This adds a Windows example of the missing-platform-package state and recovery, rather than confirming the release-propagation cause in the original report.

MINIlaolao avatar Nov 13 '26 09:11 MINIlaolao

[!NOTE] Codex (GPT-6.1 Sol) reporting on behalf of Nosa (@nosabecom).

Adding a fresh Windows x64 reproduction from November 17, 2026, on two separate machines. The generic reinstall advice does not currently recover this case because the version tagged latest has no matching Windows x64 package in the registry.

Observed

Settings → Providers marks Codex Unavailable with:

Codex app-server provider probe failed: Codex App Server process exited with code 1:
Error: Missing optional dependency @openai/codex-win32-x64.
Reinstall Codex: npm install -g @openai/codex@latest.

Both machines had npm-global @openai/[email protected] under nvm-windows (C:\nvm4w\nodejs). Node.js versions were 24.18.0 and 24.22.1; T3 Code was 0.1.11-nightly.20261117.4851. Running codex --version outside T3 reproduced the same failure on both machines. We have not established whether T3 initiated the original upgrades.

Registry and reinstall evidence

At investigation time, @openai/codex had latest: 0.169.1, but the win32-x64 dist-tag still pointed to 0.169.0-win32-x64. The 0.169.1 launcher declares the optional alias @openai/codex-win32-x64: npm:@openai/[email protected].

npm view @openai/[email protected] version dist.tarball
# npm error code E404
# npm error 404 No match found for version 0.169.1-win32-x64

A repair attempt on the first machine exited successfully but left Codex broken:

npm install -g @openai/[email protected] --include=optional --no-audit --no-fund
# changed 1 package in 3s
codex --version
# Error: Missing optional dependency @openai/codex-win32-x64

Working CLI workaround, verified on both machines

npm install -g @openai/[email protected] --include=optional --no-audit --no-fund
codex --version
# codex-cli 0.169.0

After this change, a direct codex app-server smoke test successfully completed initialize and model/list on both machines, returning 10 models. T3 initially retained the previous failed status. After explicitly refreshing the Codex provider on each machine, T3's provider response reported status: ready, installed: true, and version: 0.169.0 on both. The rendered UI was not separately checked.

The underlying missing package is an upstream release issue. The actionable T3 behavior is update/recovery handling: verify that the platform package exists before replacing a working CLI, verify the installed executable after npm exits successfully, retain or offer the last working version, and make re-probing easy after repair. The current UI does surface the underlying missing-dependency stderr, so that original part of this issue appears improved.

nosabecom avatar Nov 17 '26 23:11 nosabecom

Same silent breakage with the Claude provider, without the release race

macOS arm64, T3 Code Nightly, npm 11.19.1, Node 26.9.0, Claude Code npm-global install in ~/.local.

@anthropic-ai/[email protected] and @anthropic-ai/[email protected] were published about 21 hours before the update, so this is not the propagation race described above. The tarball download itself failed.

What happened

  1. At 16:41:52Z, ws.rpc.server.updateProvider ran npm install -g --prefix ~/.local --allow-scripts=@anthropic-ai/claude-code @anthropic-ai/claude-code@latest. It ran for about 476 s and ended as Success.
  2. npm's debug log shows verbose reify failed optional dependency …/node_modules/@anthropic-ai/claude-code-darwin-arm64, with no reason at verbose level. The postinstall (install.cjs) then printed Native package "@anthropic-ai/claude-code-darwin-arm64" not found and exited 0, and npm exited 0.
  3. bin/claude.exe was left as the 500-byte placeholder. Every Claude turn then failed with Claude Code process exited with code 1 before it started. The CLI's stderr (Error: claude native binary not installed.) never reached the UI (see #22873).

Workaround

Re-running npm install -g --prefix ~/.local @anthropic-ai/[email protected] installed the platform package, and claude --version worked again.

Why it matters for this issue

The missing post-update check is not Codex-specific. Any npm-global provider whose binary ships as an optional platform package can be left broken by a failed tarball download, while T3 Code reports the update as successful. Running <cli> --version after the update and showing its stderr, as proposed above, would catch both cases.

[!NOTE] Drafted with GitHub Copilot from the local T3 Code trace and npm debug log.

spklk avatar Nov 21 '26 17:11 spklk