Skip to content

fix(providers): keep reasoning tiers when a codex catalog sends objects - #14593

Merged
diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.51from
HouMinXi:fix/codex-object-effort-tiers
Sep 24, 2026
Merged

diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.51from
HouMinXi:fix/codex-object-effort-tiers

Conversation

@HouMinXi

Copy link
Copy Markdown
Contributor

Summary

The Codex live catalog reports supported_reasoning_levels as objects shaped {effort: "high"}, not plain strings. The parser kept only strings, so every tier was dropped and a model that supports reasoning arrived with an empty effort list. gpt-6-sol and gpt-6-luna hit this on a live account catalog fetched with client version 0.155.0 (2026-09-22): six and five tiers respectively, all objects.

reasoningEffortValue now reads a string as before, and reads .effort off an object. A number, null, a blank string, or an object with the wrong field is dropped. This is not a per-model allowlist, so the next model that ships the same object shape keeps its tiers without another patch.

Test plan

  • node --import tsx/esm --test --test-name-pattern "upstream sends objects|non-object reasoning" tests/unit/provider-models-discovery-split.test.ts — 2 passed
  • Object list {effort: low..ultra} plus an empty effort and a {value} entry resolves to the six real tiers
  • [1, null, {effort: "high"}] resolves to ["high"] only
  • Removing the object read makes the object-tier test fail

Related to #14547. #14547 stays open. Fast Quality Gates and other inherited failures on release/v3.8.51 are base-red; this diff only touches the Codex catalog parser and its unit test.

The Codex live catalog reports supported_reasoning_levels as objects
shaped {effort}, not plain strings. The parser kept only strings, so
every tier was dropped and a model that clearly supports reasoning
arrived with no effort list. Read the effort field off an object entry
and ignore entries that are neither a string nor that shape.
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Clean, minimal fix — the {effort: "high"} object shape from the live Codex catalog was
silently dropping every tier before this. Ran the full discovery-split suite at your head:
37/37 pass, including the two new object-shape cases. One small ask: I don't see a
changelog.d/fixes/ fragment in the PR's file list — could you add one before merge? Otherwise
this looks merge-ready. (Non-blocking note: #14525 fixes the same object-vs-string catalog
pattern for Grok Build — different file, no overlap, just flagging in case a shared helper is
worth a follow-up.)

@diegosouzapw
diegosouzapw merged commit 6c90a3d into cheaper-inference:release/v3.8.51 Sep 24, 2026
9 of 16 checks passed
diegosouzapw added a commit to TPOHH/OmniRoute that referenced this pull request Sep 29, 2026
Reconcile the discovered-tier routing with the tip's Codex reasoning work:
- applyCodexReasoningSelection now owns the force-rule (cheaper-inference#13556) and
  enabled:false handling plus the reasoning key whitelist (cheaper-inference#13643), so
  the block removed from codex.ts is not lost.
- Legacy caps use the tip's alias sets via getCodexAliasEffortCap.
- Discovery uses readCodexReasoningMetadata as the single source for
  supportedThinkingEfforts/defaultThinkingEffort (drops the duplicate
  helper added with cheaper-inference#14593).
- Thread runtimeModelInfo alongside resolvedThinkingEffort (cheaper-inference#13720).

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants