Repository navigation
Description
Bug
Commit b7ce5aad ("fix(codex): clamp catalog reasoning efforts to installed binary's ladder") introduced clampCatalogModelsToCodexSupport, which runs as the last step of syncCatalogModels and strips any effort rung not found in the installed Codex binary's bundled catalog.
The problem: even on a current Codex binary, codexSupportedReasoningEfforts reads the binary's bundled native model entries (gpt-5.5, gpt-5.4, etc.), and those entries only list low/medium/high/xhigh. So max and ultra are never present in the derived supported set — and the clamp removes them from every model in the catalog, including routed models and the gpt-5.6 family.
Reproduction
- Run opencodex sync with any current Codex binary.
- Check
opencodex-catalog.json— every model'ssupported_reasoning_levelstops out atxhigh.maxandultraare gone. - The Codex UI model picker caps effort selection at
xhighfor all models, includinggpt-5.6-sol,anthropic/claude-sonnet-5, and all other routed providers.
Root cause
codexSupportedReasoningEfforts (src/codex/catalog.ts) scans only bare native slugs (no /) in the bundled catalog for known effort strings. Those slugs ship with supported_reasoning_levels that stop at xhigh in the binary's own bundled catalog — because the binary predates the max/ultra additions to its native ladder. So the derived supported set is {low, medium, high, xhigh}.
The ensureGpt56ReasoningLevels / ensureUltraReasoningLevel calls earlier in the sync correctly add max and ultra, but the clamp at line 2205 undoes all of it before the file is written.
Suggested fixes
Option A — seed the supported set from CODEX_REASONING_LEVELS (simplest)
Treat max and ultra as always-valid in codexSupportedReasoningEfforts regardless of what the bundled native entries happen to declare. They are defined in CODEX_REASONING_LEVELS and the request pipeline already handles wire-clamping to the model's real top rung via nativeEffortClamp/adapters — so letting them through the catalog clamp is safe.
// in codexSupportedReasoningEfforts, seed with the full ladder first
const efforts = new Set(CODEX_REASONING_LEVELS.map(l => l.effort));
// then union in whatever the binary confirmsOption B — version-gate the clamp
Only apply the clamp when the Codex binary is old enough to actually crash on unknown rungs. The commit message cites 0.133.0 as the problematic version. Read the binary version and skip the clamp for binaries >= the first version that accepts max/ultra.
Option C — run ensure-functions after the clamp
ensureGpt56ReasoningLevels / ensureUltraReasoningLevel are explicitly designed to restore max/ultra. Moving them to run after clampCatalogModelsToCodexSupport instead of before would let their intent survive.
Context
- Regression introduced:
b7ce5aad(landed 2026-07-22) - Affects: every model in the synced catalog —
anthropic/claude-sonnet-5,gpt-5.6-sol, all routed providers, etc. CODEX_REASONING_LEVELSinsrc/reasoning-effort.tscorrectly defines all six rungs (low→ultra); the issue is purely in the clamp's source-set derivation from native binary entries that predatemax/ultra.
Activity
lidge-jun commentedon Jul 23, 2026
Verified the mechanism against current
devand a live binary — and the picture is more nuanced than the report.The mechanism is real.
clampCatalogModelsToCodexSupportruns as the last step of sync (src/codex/catalog.ts:2205), andcodexSupportedReasoningEffortsderives the supported set only from bare native slugs in the installed binary's bundled catalog. If that union stops atxhigh, the clamp stripsmax/ultrafrom every model, including routed ones.The claimed trigger does not reproduce on a current binary. On codex-cli 0.144.5:
The derived set is the full six-rung ladder, and the synced
opencodex-catalog.jsonon this machine keepsmax/ultraon all models — the ensure-functions survive the clamp. For strict-enum binaries like 0.133.0 (the case b7ce5aa fixed), stripping is the intended behavior, since that parser rejects unknown rungs.So the open question is which binary you synced with. Could you share:
codex --versioncodex debug models --bundledsupported_reasoning_levelsfor one affected model in your syncedopencodex-catalog.jsonIf there is a binary whose parser accepts
max/ultrabut whose bundled catalog omits them, we'll version-gate the clamp (your Option B) — that's the only option that preserves the 0.133.0 deserialization guard. Options A and C both bypass that guard (A unconditionally, C only for entries the ensure-functions cover, so routed models would still lose rungs on strict binaries).Closing as not-reproducible on current binaries; will reopen immediately with the version details.
Wibias commentedon Jul 23, 2026
@lidge-jun
Summary
The issue is reproducible and appears to be caused by inconsistent Codex binary selection during catalog sync.
On the affected system, the default
codexcommand resolved to an old Codex CLI:A newer Codex binary was also installed:
The newer binary's bundled catalog explicitly included
maxandultra.When
CODEX_CLI_PATHpointed to the newer binary, bothocx restartandocx syncpreservedmaxandultra.When the override was missing or invalid,
ocx syncfell back to the old0.133.0binary and removed them again.What We Tested
codexto version0.133.0.0.145.0-alpha.30.gpt-5.6-sol:low, medium, high, xhigh, max, ultragpt-5.6-terra:low, medium, high, xhigh, max, ultragpt-5.6-luna:low, medium, high, xhigh, maxCODEX_CLI_PATHto the newer binary.ocx restartand confirmedmaxandultrareappeared.ocx syncwithout a valid override and confirmed they disappeared again.CODEX_CLI_PATH, ranocx sync, and confirmedmaxandultrawere preserved.Conclusion
The confirmed failure chain is:
The successful control test was:
The strongest conclusion is:
Correction to the Original Theory
This change is not sufficiently justified:
Reasons:
gpt-5.6-sol.The request-time
nativeEffortClampand the catalog clamp operate at different stages and should not be treated as equivalent.Recommended Fix
--versiondebug models --bundledocx restartocx syncCODEX_CLI_PATHas the highest-priority override.ocx statusocx doctorExample diagnostic output:
Required Tests
CODEX_CLI_PATHoverrides PATH and stored shim targets.CODEX_CLI_PATHproduces a clear warning.maxandultra.ocx statusandocx doctorreport runtime mismatches and recovery steps.Merge pull request #359 from Wibias/fix/stable-codex-runtime-selection
Merge pull request lidge-jun#359 from Wibias/fix/stable-codex-runtime…