You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
~/.opencodex/codex-runtime.json persists an absolute path to the Codex App's bundled CLI, and that path lives inside a content-hashed directory:
%LOCALAPPDATA%\OpenAI\Codex\bin\<hash>\codex.exe
The Codex App replaces that hashed directory on every update and deletes the previous one. The persisted configured pin then points at a path that no longer exists, and runtime selection falls through to fallback:
Codex runtime: codex
Codex version: unknown
Codex source: fallback
⚠️ No validated Codex runtime found (path does not exist); falling back to `codex`.
A dead configured entry is never discarded or re-resolved. Because the Codex App does not put its hashed bin directory on PATH, the env → configured → shim → PATH → fallback chain introduced in #359 has nothing left to find, and codex does not resolve as a bare command on this host.
I expected a recorded runtime path that no longer exists to be treated as absent — dropped, with resolution continuing down the chain and the file re-persisted — rather than retained while runtime selection degrades to a bare codex fallback.
This is not #3442. That fix covers a pin whose path is real but whose recorded version is old (the entitlement client_version floor). This is a pin whose path does not exist at all.
Reproduction
Observed twice on the same host, the second time live within a single 15-minute window.
Instance 1 — how the pin died
On 2026-09-02, codex-runtime.json recorded "command": "...\\OpenAI\\Codex\\bin\\b99306303521e97e\\codex.exe", "source": "configured", "selectedVersion": "0.151.0-alpha.7.2".
On 2026-09-04, the Codex App updated to 0.153.0. The bundled CLI moved to ...\bin\9ba750cce02d5e5c\, and b99306303521e97e was removed.
From then on, ocx status and ocx doctor reported source=fallback, version=unknown, and the "No validated Codex runtime found (path does not exist)" warning. This survived ocx service restart and an upgrade from 2.42.0 to 2.48.0.
Instance 2 — the same directory replacement observed live
At 2026-09-08 ~21:26 KST, ...\OpenAI\Codex\bin\ contained 9ba750cce02d5e5c (holding codex.exe, codex-cli 0.153.0) and e5208f10301fe5e6 (holding rg.exe).
A Codex App update was applied at ~21:38 KST.
...\bin\ then contained 8e5b6932251c2c1c and c60635126245daef. 9ba750cce02d5e5c no longer existed — roughly 15 minutes after being the live runtime directory.
Any pin written against a hashed directory is therefore invalidated by the next Codex App update.
A stable path exists and is not used
%USERPROFILE%\.codex\plugins\.plugin-appserver\codex.exe carries no hash and is updated in place. Across the update in step 5 it kept the same path and went from codex-cli 0.153.0 to codex-cli 0.153.4. Searching this repository for plugin-appserver returns no results, so the resolver does not appear to consider this location.
Workaround
Repointing command in codex-runtime.json to that stable path restored source=configured with an attested version, and it survived the step-5 update untouched. ocx doctor reports no warnings afterwards.
Analysis and suggested directions
Validate configured at resolution time. When the recorded command does not exist, treat the entry as absent: continue down env → configured → shim → PATH → fallback and re-persist the result, instead of retaining a dead pin and degrading to fallback.
Add the Codex App's stable location as a discovery candidate.%USERPROFILE%\.codex\plugins\.plugin-appserver\codex.exe (and the macOS/Linux equivalents) is the only Codex App path observed here that survives an update.
Refresh selectedVersion on drift. After the workaround, the file still records 0.153.0 while the resolved binary reports 0.153.4. ocx status shows the probed value, so the recorded field goes stale. Harmless here — well above the 0.144.0 gated floor — but it is the same field that tier 2 of resolveCodexEntitlementClientVersion reads (fix(codex): raise a stale runtime's client version to the measured gated floor #3442).
Even if it were available, it could not have recovered this host: with the pin dead and no Codex CLI on PATH, the chain has nothing to resolve to, which is exactly the observed fallback state.
Related: #359 (the resolver and codex-runtime.json), #3442 (stale-but-valid pin version), #356 (shim restore after external npm updates — the analogous problem for npm-installed CLIs).
Version
2.48.0
Operating system
Windows 11 Pro 10.0.26200
Provider and model
No response
Logs or error output
# Before — dead pin (2.48.0, after the 2026-09-04 Codex App update)
$ ocx status
Codex runtime: codex
Codex version: unknown
Codex source: fallback
/!\ No validated Codex runtime found (path does not exist); falling back to `codex`.
Run ocx doctor for diagnosis and recovery.
$ ocx system codex-cli-update check --json
{
"candidateAvailable": false,
"versionEvidence": { "kind": "unavailable" },
"provenance": "unknown",
"managed": false,
"reason": "candidate_unavailable",
"location": null
}
# Intermediate — with the hashed dir temporarily added to PATH, selection# succeeded, but the dead pin was still preferred over it
$ ocx doctor
Codex runtime selection
ok Selected runtime: ...\OpenAI\Codex\bin\9ba750cce02d5e5c\codex.exe (0.153.0, source=path)
!! Preferred runtime unavailable; fell back to ...\bin\9ba750cce02d5e5c\codex.exe
# Hashed directory replacement, observed live# 21:26 KST
9ba750cce02d5e5c/ e5208f10301fe5e6/
# 21:38 KST, after the Codex App update
8e5b6932251c2c1c/ c60635126245daef/
$ ls .../OpenAI/Codex/bin/9ba750cce02d5e5c
ls: cannot access '.../OpenAI/Codex/bin/9ba750cce02d5e5c': No such file or directory
# The stable path across that same update# before: codex-cli 0.153.0 after: codex-cli 0.153.4# path unchanged: %USERPROFILE%\.codex\plugins\.plugin-appserver\codex.exe# After — pin repointed to the stable path
$ ocx status
Codex runtime: C:\Users\[USER]\.codex\plugins\.plugin-appserver\codex.exe
Codex version: 0.153.4
Codex source: configured
$ ocx doctor
(no warnings)
Screenshots and supporting files
No screenshots attached. Every value above was read from ocx status, ocx doctor, ocx system codex-cli-update check --json, directory listings under %LOCALAPPDATA%\OpenAI\Codex\bin\, and codex.exe --version. Account identifiers, tokens, credentials and quota data are excluded.
Redacted configuration
// ~/.opencodex/codex-runtime.json — the recorded command path no longer exists
{
"version": 1,
"command": "C:\\Users\\[USER]\\AppData\\Local\\OpenAI\\Codex\\bin\\b99306303521e97e\\codex.exe",
"source": "configured",
"selectedVersion": "0.151.0-alpha.7.2",
"updatedAt": "2026-09-02T05:57:19.180Z"
}
Checks
I searched existing issues and documentation.
I removed secrets, tokens, account details, request credentials, and personal data.
Client or integration
Codex App
Area
CLI
Summary
~/.opencodex/codex-runtime.jsonpersists an absolute path to the Codex App's bundled CLI, and that path lives inside a content-hashed directory:The Codex App replaces that hashed directory on every update and deletes the previous one. The persisted
configuredpin then points at a path that no longer exists, and runtime selection falls through tofallback:A dead
configuredentry is never discarded or re-resolved. Because the Codex App does not put its hashedbindirectory onPATH, theenv → configured → shim → PATH → fallbackchain introduced in #359 has nothing left to find, andcodexdoes not resolve as a bare command on this host.I expected a recorded runtime path that no longer exists to be treated as absent — dropped, with resolution continuing down the chain and the file re-persisted — rather than retained while runtime selection degrades to a bare
codexfallback.This is not #3442. That fix covers a pin whose path is real but whose recorded version is old (the entitlement
client_versionfloor). This is a pin whose path does not exist at all.Reproduction
Observed twice on the same host, the second time live within a single 15-minute window.
Instance 1 — how the pin died
codex-runtime.jsonrecorded"command": "...\\OpenAI\\Codex\\bin\\b99306303521e97e\\codex.exe","source": "configured","selectedVersion": "0.151.0-alpha.7.2"....\bin\9ba750cce02d5e5c\, andb99306303521e97ewas removed.ocx statusandocx doctorreportedsource=fallback,version=unknown, and the "No validated Codex runtime found (path does not exist)" warning. This survivedocx service restartand an upgrade from 2.42.0 to 2.48.0.Instance 2 — the same directory replacement observed live
...\OpenAI\Codex\bin\contained9ba750cce02d5e5c(holdingcodex.exe,codex-cli 0.153.0) ande5208f10301fe5e6(holdingrg.exe)....\bin\then contained8e5b6932251c2c1candc60635126245daef.9ba750cce02d5e5cno longer existed — roughly 15 minutes after being the live runtime directory.Any pin written against a hashed directory is therefore invalidated by the next Codex App update.
A stable path exists and is not used
%USERPROFILE%\.codex\plugins\.plugin-appserver\codex.execarries no hash and is updated in place. Across the update in step 5 it kept the same path and went fromcodex-cli 0.153.0tocodex-cli 0.153.4. Searching this repository forplugin-appserverreturns no results, so the resolver does not appear to consider this location.Workaround
Repointing
commandincodex-runtime.jsonto that stable path restoredsource=configuredwith an attested version, and it survived the step-5 update untouched.ocx doctorreports no warnings afterwards.Analysis and suggested directions
configuredat resolution time. When the recordedcommanddoes not exist, treat the entry as absent: continue downenv → configured → shim → PATH → fallbackand re-persist the result, instead of retaining a dead pin and degrading tofallback.%USERPROFILE%\.codex\plugins\.plugin-appserver\codex.exe(and the macOS/Linux equivalents) is the only Codex App path observed here that survives an update.selectedVersionon drift. After the workaround, the file still records0.153.0while the resolved binary reports0.153.4.ocx statusshows the probed value, so the recorded field goes stale. Harmless here — well above the 0.144.0 gated floor — but it is the same field that tier 2 ofresolveCodexEntitlementClientVersionreads (fix(codex): raise a stale runtime's client version to the measured gated floor #3442).Two notes on existing recovery paths:
ocx doctor --fix-codex-runtime, added in fix(codex): stable Codex runtime selection for sync/clamp (#297) #359, is not listed inocx doctor --helpon 2.48.0. I did not run it.PATH, the chain has nothing to resolve to, which is exactly the observedfallbackstate.Related: #359 (the resolver and
codex-runtime.json), #3442 (stale-but-valid pin version), #356 (shim restore after external npm updates — the analogous problem for npm-installed CLIs).Version
2.48.0
Operating system
Windows 11 Pro 10.0.26200
Provider and model
No response
Logs or error output
Screenshots and supporting files
No screenshots attached. Every value above was read from
ocx status,ocx doctor,ocx system codex-cli-update check --json, directory listings under%LOCALAPPDATA%\OpenAI\Codex\bin\, andcodex.exe --version. Account identifiers, tokens, credentials and quota data are excluded.Redacted configuration
Checks