codex update broken on macOS/Linux (0.143.0): chatgpt.com/codex/install.sh is stale, still serving pre-#31667 line-based awk that can't parse compact GitHub JSON

Open 💬 2 comments Opened Jul 9, 2026 by kaarude

Summary

codex update (and the documented curl ... | sh install path that fetches from chatgpt.com/codex/install.sh) is broken for macOS/Linux as of the 0.143.0 release: it fails with

Could not find Codex package or platform npm release assets for Codex 0.143.0.

The fix for this already shipped in PR #31667 (commit dc23c7bcc, merged 2026-07-09) and is on main at scripts/install/install.sh, but the install script served at https://chatgpt.com/codex/install.sh is still the pre-fix version, so codex update — which fetches from that endpoint — keeps failing.

Root cause

The served install.sh detects release assets via release_asset_digest_or_empty, which parses the GitHub API release JSON with a line-based awk:

/"name":[[:space:]]*"[^"]+"/ {
  name = $0
  sub(/^.*"name":[[:space:]]*"/, "", name)   # greedy ^.* matches the LAST "name": on the line
  sub(/".*$/, "", name)
  ...

The GitHub REST API returns compact, single-line JSON. With the whole document on one line, the greedy ^.*"name": matches up to the last "name": field in the entire document, so name is set to the last asset's name (e.g. openai_codex_cli_bin-...-win_arm64.whl) and never equals the requested macOS/Linux asset. release_asset_exists therefore returns false for every asset, producing the error above.

PR #31667 replaced this with a char-by-char parse_release_metadata parser (fold -b -w 4096 | awk) that is format-agnostic and handles compact JSON correctly.

Evidence that the fix is merged but not deployed

  • Repo copy (main): contains parse_release_metadata — works end-to-end on macOS (Apple Silicon), resolves and installs 0.143.0.
  • Served endpoint (https://chatgpt.com/codex/install.sh, fetched just now): 0 occurrences of parse_release_metadata; still contains the old release_asset_digest_or_empty line-based awk.
$ curl -fsSL https://raw.githubusercontent.com/openai/codex/main/scripts/install/install.sh | grep -c parse_release_metadata
2        # FIXED
$ curl -fsSL https://chatgpt.com/codex/install.sh | grep -c parse_release_metadata
0        # STILL STALE
$ curl -fsSL https://chatgpt.com/codex/install.sh | grep -c release_asset_digest_or_empty
3        # old broken version

Reproduce

$ codex --version
codex-cli 0.142.4
$ codex update
Updating Codex via `sh -c 'curl -fsSL https://chatgpt.com/codex/install.sh | CODEX_NON_INTERACTIVE=1 sh'`...
Could not find Codex package or platform npm release assets for Codex 0.143.0.
Error: ... failed with status exit status: 1

The same install.sh logic fails identically for Linux x64/arm64.

Workaround

Until the endpoint is redeployed, install/update from the GitHub-hosted (fixed) script:

curl -fsSL https://raw.githubusercontent.com/openai/codex/main/scripts/install/install.sh | sh

Ask

Redeploy chatgpt.com/codex/install.sh from current main (so it includes the #31667 fix). Until then, codex update is broken for all macOS/Linux users on standalone installs.

Tested on: macOS 15, Apple Silicon, codex-cli 0.142.40.143.0.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗