Standalone updater is unavailable when CODEX_HOME differs from the install home

Open 💬 0 comments Opened Aug 26, 2026 by hgijeon

What version of Codex CLI is running?

codex-cli 0.149.1

What subscription do you have?

Not relevant to installation detection.

Which model were you using?

Not applicable.

What platform is your computer?

Darwin 25.5.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

Not applicable; this reproduces in a non-interactive shell.

Codex doctor report

Relevant paths are replaced with $STATE_HOME and $INSTALL_HOME:

{
  "codexVersion": "0.149.1",
  "checks": {
    "installation": {
      "status": "ok",
      "details": {
        "install context": "other (package $INSTALL_HOME/packages/standalone/releases/0.149.1-aarch64-apple-darwin)"
      }
    },
    "updates.status": {
      "status": "warning",
      "details": {
        "update action": "manual or unknown"
      }
    }
  }
}

What issue are you seeing?

When CODEX_HOME points to a directory other than the home that owns an official standalone installation, install detection reports other even though the canonical executable resolves inside packages/standalone/releases/<release>.

As a result, codex update exits with:

Error: Could not detect the Codex installation method. Please update manually: https://developers.openai.com/codex/cli/

The installation itself is intact; only its provenance and update action are misclassified.

What steps can reproduce the bug?

  1. Install Codex with the official standalone installer.
  2. Confirm that the executable resolves into the standalone release tree.
  3. Run Codex with a different home:
STATE_HOME="$(mktemp -d)"
CODEX_HOME="$STATE_HOME" codex doctor --json
CODEX_HOME="$STATE_HOME" codex update

The doctor report shows install context: other, and the update command cannot select the standalone updater.

What is the expected behavior?

Codex should identify the official standalone installation from the canonical executable layout and update that same installation, independently of the runtime CODEX_HOME value.

Additional information

The detector currently validates the canonical release directory against the active CODEX_HOME. The standalone installer also uses CODEX_HOME to select its package root, so changing detection alone would make the updater target the runtime home instead of the existing installation.

A minimal fix has two parts:

- validate the release path against the active CODEX_HOME
+ derive the install home from packages/standalone/releases/<release>

+ pass the derived install home as CODEX_HOME to the standalone installer child only

Regression coverage should verify both classification with a different runtime home and the installer child's target. A local implementation passes the 423 tests in codex-install-context and codex-cli.

View original on GitHub ↗