[Bug]: Codex update always fails when instances share one standalone install #19252
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/server
Steps to reproduce#
- Install Codex with the standalone installer, so the binary lives in
~/.codex/packages/standalone/releases/<version>/bin/codex. - Add two Codex instances in T3 (for example, two accounts) with that binary and their own
CODEX_HOME, such as~/codex-aand~/codex-b. - Wait until a newer Codex is out, then click Update all or the Update button on the update notice.
Expected behavior#
Codex updates, and every instance that uses that install shows the new version.
Actual behavior#
The update fails with "Update command exited with code 1". The installed version doesn't change.
T3 runs codex update with CODEX_HOME set to the instance's home (~/codex-a). Codex only updates itself when its binary sits under $CODEX_HOME/packages/standalone/releases, so it exits with:
Error: Could not detect the Codex installation method. Please update manually: https://developers.openai.com/codex/cli/
The same command works with CODEX_HOME=~/.codex, which is where the install lives.
The cause is in apps/server/src/provider/Drivers/CodexDriver.ts, in makeCodexMaintenanceResolver. It sets env: { CODEX_HOME: sharedHomePath }, which assumes the install always lives in the instance's home.
Impact#
Major degradation or frequent failure
Version or commit#
main at 107f6024ea
Environment#
Linux (Ubuntu 26.04), standalone Codex 0.162.0, three Codex instances sharing one install
Workaround#
Run CODEX_HOME=~/.codex codex update by hand.
shivamhwp(GitHub profile, opens in a new tab) added labelsbug
shivamhwp(GitHub profile, opens in a new tab) added labelsneeds-triage
Also reproduces with a single instance, on remote servers, so it isn't only about several instances sharing one install.
On four Linux hosts running the T3 server (0.1.3-nightly.20261023.3579), the one enabled Codex instance uses a config-only home,
~/.codex_hub. The standalone Codex install is under~/.codex. Update fails on all four withError: Could not detect the Codex installation method.Running
CODEX_HOME=~/.codex codex updateas the same user on each host succeeded and brought Codex to 0.164.0. So the fix needs to run the update against the home that holds the install, not the instance's home.Additional reproduction on Windows x64, using the packaged T3 Code 0.1.3-nightly.20261024.3643 desktop app.
The Codex instance has a separate configuration home (
%USERPROFILE%\.codex-pool) and uses the normal standalone launcher at%LOCALAPPDATA%\Programs\OpenAI\Codex\bin\codex.exe. That launcher'sbindirectory is a Windows junction to%USERPROFILE%\.codex\packages\standalone\current\bin.Normal Codex sessions work, but T3's update fails with:
Update command exited with code 1: Error: Could not detect the Codex installation method. Please update manually: https://developers.openai.com/codex/cli/The original failure occurred with Codex CLI 0.163.0. I confirmed the same detection failure after updating the original installation to 0.164.0: running that same executable's
updatecommand withCODEX_HOMEpointing at.codex-poolexits 1; pointing it at the owning.codexdirectory exits 0.I also checked the home-selection helper and environment callback from #19253 at
671149f96624ea6ba1bde245f6edc7e8487e8ad6against this real Windows launcher. It selects the owning.codexdirectory, and executing the native updater with that environment succeeds. The separate pool configuration remains in place, and the update does not create an additional pool installation.This supports the existing report on Windows as well as Linux. The successful command was a same-version reinstall of 0.164.0, not a test of a newer release through the full PR's desktop UI.
Closing: current main already covers this as of f4147ddf79. If you still see it on a build that includes that commit, reply and we'll reopen.
juliusmarminge closed this
Sign in to join this conversation.
Reproduced on Linux with main at 70e5e384da. In the web dev app, two instances used standalone Codex 0.162.0 with separate CODEX_HOME directories. Update all failed with
Update command exited with code 1: Error: Could not detect the Codex installation method.Running the standalone updater with the installation home succeeded; using either instance home failed.