[Bug]: Codex one-click update always fails when the CLI is the ChatGPT.app-bundled binary
Summary
When the configured Codex binary is the CLI bundled inside ChatGPT.app, T3 Code offers a
one-click update (version advisory behind_latest, canUpdate: true) that always fails
immediately. The bundled CLI refuses to self-update, so the button can never work.
Environment
- T3 Code (Nightly) 0.0.46-nightly.20261005.2702, macOS (darwin arm64)
- Codex binary path:
/Applications/ChatGPT.app/Contents/Resources/codex-cli/bin/codex(the workaround recommended in #10514 for users who have ChatGPT desktop but no standalone CLI on PATH) codex-cli 0.160.0(ChatGPT.app bundle), npm@openai/codex@latest= 0.160.1
Steps to reproduce
- Settings → Providers → Codex → Binary path = the ChatGPT.app path above.
- Wait for the "Codex update available" toast.
- Click Update.
Actual
The toast reports "Provider update failed — Codex: Update command exited with code 1."
T3 runs /Applications/ChatGPT.app/.../codex update, which exits 1 in ~25 ms:
Error: Could not detect the Codex installation method. Please update manually: https://developers.openai.com/codex/cli/
Server trace shows three attempts, each runCommand completing in 20–28 ms — nothing is
downloaded or installed. The install itself is fine; only the offered one-click path is
broken.
Direct reproduction, no T3 involved:
CODEX_HOME=$(mktemp -d) /Applications/ChatGPT.app/Contents/Resources/codex-cli/bin/codex update
# exit 1, same error
The cached snapshot confirms the advisory:
"versionAdvisory": {
"status": "behind_latest",
"currentVersion": "0.160.0",
"latestVersion": "0.160.1",
"updateCommand": "/Applications/ChatGPT.app/Contents/Resources/codex-cli/bin/codex update",
"canUpdate": true
}
Expected
Either the update works, or the install is treated as manual-only (no one-click button), the way mise-managed installs already are.
Root cause
resolvePackageManagedProviderMaintenance in
apps/server/src/provider/providerMaintenance.ts falls back to the provider's own updater
for any install no package manager proves (from #15416, commit fe93a5dbd). The
ChatGPT-bundled CLI is not the standalone layout (no /packages/standalone/ in the path)
and no package manager owns the path, so capabilities resolve to <path> update
(lockKey: codex-native), which sets canUpdate: true. That build is updated by the
ChatGPT app and cannot detect its own installation method, so the fallback is guaranteed
to fail.
Proposed fix
Treat a provider executable inside a macOS app bundle (path containing .app/Contents/)
as manual-only in resolvePackageManagedProviderMaintenance, next to the existing mise
branch. canUpdate then becomes false, updateCommand is null, and the toast offers
Settings instead of a button that cannot work. The rule is generic: any provider binary
shipped inside an app bundle belongs to that app, not to T3.
[!NOTE] Grok responding on behalf of Julius.
Triage
Thanks for the precise report and for tracking down the code path, @YL404! This matches what we see in the code, and it looks like a regression from #15416.
What I found
resolvePackageManagedProviderMaintenance(apps/server/src/provider/providerMaintenance.ts) only treats a Codex install as native when the path contains/packages/standalone/(isCodexStandaloneCommandPathinapps/server/src/provider/Drivers/CodexDriver.ts). Anything else without a proven package manager falls through to the provider's own updater.- The ChatGPT.app binary (
/Applications/ChatGPT.app/Contents/Resources/codex-cli/bin/codex, and the older path from #10514 underContents/Resources/codex) doesn't match that layout, npm, mise, or Homebrew, and isn't undernode_modules. So the advisory getsupdateset to<binary> update(lockKey: codex-native), which setscanUpdate: trueand shows the Update button. - That command can't succeed: the bundled CLI exits 1 right away with "Could not detect the Codex installation method" because the ChatGPT app owns the install. The ~25 ms trace with nothing downloaded is consistent with that refusal.
- Mise installs already stay manual-only for a similar reason.
Likely fix area
- One option is the one you suggested: keep the
behind_latestadvisory but treat provider executables inside a macOS app bundle (path containing.app/Contents/) as manual-only, next to the mise branch, socanUpdateis false and the toast points to Settings instead of a button that always fails. - #16352 is open along those lines. #14256 touches the related hint text for installs T3 Code can't update.
A maintainer will decide on the fix direction.
Still reproduces on 0.0.46-nightly.20261012.3010 with the ChatGPT.app bundle at codex-cli 0.162.0-alpha.17.2: codex update exits 1 with "Could not detect the Codex installation method".
Workaround: point the Codex binary path at a standalone install (a pnpm global install in my case), where codex update works.
Closing for housekeeping — the bug is still valid and was confirmed to reproduce on recent nightlies. For whoever picks this up later: PR #16352 implemented the manual-only fix but was closed by mistake and never reopened/merged.