[Bug]: Codex 'Update' is offered for T3's own managed binary on default config, and managed setup is pinned to 0.156.1
Before submitting
- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.
Scope vs existing reports. This is not a re-file of the "managed binary cannot self-update" symptom (#19556) or the shared-standalone-install symptom (#19252). Both are real and still open. This report is the narrower, verified defect those two leave unresolved: an instance whose config is entirely default is put on the native-updater path even though the binary it resolves to is T3's own managed install, and the "supported route" (managed setup) cannot install anything newer than a version hardcoded in the app build.
Area
apps/server
Steps to reproduce
- Fresh Codex provider instance with no config at all — no
setupMode, nobinaryPath(exactly what Settings → Providers writes by default). - Let T3 install Codex itself, so
PATHcontains<T3_HOME>\tools\codex\<version>\binandcodexresolves to T3's managed binary. - Wait for a newer Codex release (0.162.1 → 0.163.0 in this report), so T3 shows "Update available".
- Click Update.
Deterministic — reproduces on every Codex release.
Expected behavior
Since the resolved binary is T3's own managed install, T3 should not offer Codex's native self-updater at all: either treat the instance as managed (the path check CodexInstallation.resolveLocal() already performs), or expose no codex update command and let T3's own install path handle the version.
Actual behavior
T3 offers an update command that cannot ever succeed, and the visible version never changes.
Advisory for both instances (~/.t3/caches/codex.json):
{
"status": "behind_latest",
"currentVersion": "0.162.1",
"latestVersion": "0.163.0",
"updateCommand": "C:\\Users\\Administrator\\.t3\\tools\\codex\\0.162.1\\bin\\codex.EXE update",
"canUpdate": true,
"canInstallVersion": false
}
The offered command exits 1:
Error: Could not detect the Codex installation method.
Please update manually: https://developers.openai.com/codex/cli/
Impact
Major degradation or frequent failure
Version or commit
- T3 Code (Nightly)
0.1.1-nightly.20261016.3203—ProductVersion 0.1.1.0,FileVersion 0.1.1-nightly.20261016.3203. This is the newest nightly on GitHub at the time of writing, i.e. newer than the build that shipped the Windows managed-install fix (fix(server): Windows Codex install uses system tar and retries rename, #18523), so the update action is still unfixed on the newest build.
Environment
- Windows Server 2022 (10.0.20348, AMD64), T3 Code desktop nightly, local server.
- Codex: T3-managed install.
~/.t3/tools/codex/contains0.156.1,0.162.1,0.163.0;active.json→{"version":"0.163.0"}after the workaround. - Two Codex instances, both default config:
"codex": { "driver": "codex", "displayName": "Codex", "enabled": true },
"codex-2": { "driver": "codex", "displayName": "Codex 2", "enabled": true,
"config": { "shadowHomePath": "~/.codex-t3/codex-2" } }
Logs or stack traces
$ C:\Users\Administrator\.t3\tools\codex\0.162.1\bin\codex.exe update
Error: Could not detect the Codex installation method. Please update manually: https://developers.openai.com/codex/cli/
exit code 1
Workaround
Hand-install the release into T3's managed layout and point active.json at it (same as in #19556):
- Download
codex-package-x86_64-pc-windows-msvc.tar.gzforrust-v0.163.0from theopenai/codexrelease; SHA-256901028b285614a9974f431f9d9f6534b3e5ed8d62eba4ba64f4762c00f040522(matches the release asset digest). - Extract into
~/.t3/tools/codex/0.163.0/(bin/codex.exe,bin/codex-code-mode-host.exe,codex-path/rg.exe,codex-package.json). - Write
.install-complete.json={"version":"0.163.0","target":"x86_64-pc-windows-msvc","sha256":"901028b2…40522"}andactive.json={"version":"0.163.0"}. - Update the user
PATHentry from…\tools\codex\0.162.1\binto…\tools\codex\0.163.0\bin;codex --version→codex-cli 0.163.0. - Restart T3 Code so the provider re-reads
active.json.
Diagnosis
Why default config lands in the broken branch. packages/contracts/src/settings.ts:
export const CodexSettings = makeProviderSettingsSchema({
setupMode: Schema.optionalKey(Schema.Literals(["managed", "existing"])).pipe(/* hidden */),
binaryPath: makeBinaryPathSetting("codex").pipe(/* placeholder: "codex", clearWhenEmpty: "omit" */),
// …
});
setupMode has no default, and binaryPath defaults to the literal "codex" (resolved via PATH). CodexDriver.ts branches with if (config.setupMode === "managed") … else …, so an instance with no config takes the non-managed branch. Nothing needs to be "set by the user" — this is the out-of-the-box state for anyone whose PATH includes T3's managed Codex directory, which T3 itself adds.
Why the command is offered anyway. In the non-managed branch, CodexDriver.ts builds its maintenance resolver as:
function makeCodexMaintenanceResolver(sharedHomePath: string) {
return makePackageManagedProviderMaintenanceResolver({
provider: DRIVER_KIND,
npmPackageName: "@openai/codex",
nativeUpdate: {
args: ["update"],
isCommandPath: isCodexStandaloneCommandPath,
env: { CODEX_HOME: sharedHomePath },
},
});
}
isCodexStandaloneCommandPath only matches paths containing /packages/standalone/. When the binary is T3-managed, no npm/Homebrew/standalone installer is detected and the resolver falls back to the Codex-native update, which cannot work for a binary outside $CODEX_HOME/packages/standalone/releases/.
T3 already knows this binary is its own. apps/server/src/provider/CodexInstallation.ts explicitly excludes its own managed directory when resolving a "local" Codex:
const realManaged = yield* fs.realPath(managedDirectory).pipe(Effect.option);
if (realExecutablePath.startsWith(`${Option.getOrElse(realManaged, () => managedDirectory)}${path.sep}`))
return null; // treat as managed, not local
So the knowledge needed to suppress the native updater already exists in the codebase; the maintenance resolver simply does not consult it.
Verification of the earlier triage reply on #19556
I checked each claim from the Grok/Julius reply against main and the shipped 0.1.1-nightly.20261016.3203 build.
| Claim | Verdict | Evidence |
|---|---|---|
A managed instance never runs codex update; its maintenance resolver returns no update command |
Correct | CodexManagedProvider.ts: resolveMaintenance: () => Effect.succeed({ provider: DRIVER, packageName: null, update: null }) |
The advisory with updateCommand: … update only happens in non-managed mode |
Correct | CodexDriver.ts builds makeCodexMaintenanceResolver only on the setupMode !== "managed" path |
T3 "moves managed installs to a new version itself through CodexInstallation, based on the model manifest's compatibility data" |
Incorrect as stated | The installed version comes from a hardcoded RELEASES map in CodexInstallation.ts. In this shipped build that map pins only rust-v0.156.1 for all six targets: rg -a -o "rust-v[0-9.]+" server.asar → rust-v0.156.1; rg -a -c "0\.163\.0" server.asar app.asar → no match. install() is reachable only from start(), which uses resolveCodexReleaseAsset(platform, arch); the releaseAsset option is a test seam (CodexInstallation.layer passes only { baseDir }). The model manifest carries no release/version data — its top-level keys are version, updatedAt, compatibility, currentModels, providers — it only classifies versions. So managed setup installs the app build's pin (0.156.1), which is status: "supported" (range >=0.156.0) but below the same build's recommendedRange: ">=0.159.0", and it cannot reach 0.162.1/0.163.0 until an app build bumps the pin. |
| "Did you set the binary path yourself?" | Not applicable — it is the default | No setupMode/binaryPath in settings.json; both come from schema defaults (above) |
| "When that happens, T3 can't trace the path to an installer" | Half right | T3 can detect that the resolved path is inside its managed directory (CodexInstallation.resolveLocal), and does for session resolution; the maintenance resolver just doesn't use that check |
Two-account question from that thread, answered from code: managed setup does support a second account. resolveManagedCodexHomeLayout (CodexManagedHome.ts) derives <stateDir>/providers/codex/<instanceId>/shadow when shadowHomePath is empty and instanceId !== "codex", and CodexManagedProvider.ts reports shadowHomePath from homeLayout.mode === "authOverlay" with auth held separately per instance (makeCodexChatGptAuth). So switching both instances to managed should keep two ChatGPT accounts apart — but it will land on 0.156.1 for now.
Suggested fixes
- In the Codex maintenance resolver, reuse the managed-path check that
CodexInstallation.resolveLocal()already performs: if the resolved binary lives under<baseDir>/tools/codex/, do not expose a nativecodex updateand do not setcanUpdatefrom it — surface T3's own managed install state instead. - If managed setup is the intended route, let it actually reach current Codex. A static
RELEASESmap pinned at 0.156.1 in the same build that recommends>=0.159.0means the supported route installs a version the build itself calls below-recommended, and can never reach a new release without a new app build.
Related issues
- #19556 — same error text; its workaround is the one used above.
- #19252 — same error text, but a user-installed standalone Codex with per-instance
CODEX_HOME; different install shape. - #17442 — no working update action in the UI for Codex.
[!NOTE] Grok responding on behalf of Julius.
Closing as a duplicate of #19556. It's the same install, the same codex.exe update failure, and the same two default-config instances, and you've already posted this analysis there (including the default setupMode/binaryPath finding and the pinned managed release). Let's keep the discussion in #19556 so it all stays in one place.