Repository navigation
fix(routing): read Codex max/ultra models from the alias sets in reasoning rules - #14720
Merged
diegosouzapw merged 1 commit intoSep 29, 2026
Conversation
…oning rules Reasoning-routing rules decided which Codex models accept `max` / `ultra` with a hard-coded gpt-5.6 regex, in two places in policy.ts and once more in the rules editor. The Codex executor's suffix parsing reads CODEX_MAX_ALIAS_MODELS / CODEX_ULTRA_ALIAS_MODELS instead (its effort clamp table agrees with them), and those sets already include gpt-6-astra, so the rule gate and the executor disagreed: - a rule forcing `max` or `ultra` counted cx/gpt-6-astra (and its effort variants) as incompatible: filterComboForReasoningDecision dropped it from the target combo, and a single cx/gpt-6-astra target was reported unsupported, although the executor serves it at both tiers; - cx/gpt-6-astra-max / -ultra were not read as max / ultra requests, so a rule matching on source effort `max` never matched them; - the rules editor hid `max` / `ultra` for GPT-6 Astra targets and warned they were unsupported. Both checks now go through src/shared/reasoning/codexExtendedEffort.ts, which reads the alias sets. Suffix parsing still requires the exact base model; the capability gate and the editor still accept `<base>` or `<base>-<suffix>`. Models added to the sets later are picked up without another copy of the list. Tests: tests/unit/reasoning-routing-codex-extended-effort.test.ts fails on the previous policy.ts (6 of 8 cases) and passes now; it iterates the alias sets, so new members are covered automatically. Comments in reasoning-routing.test.ts that named the "legacy gpt-5.6 regex" now name the alias-set fallback.
QuangBlue
force-pushed
the
fix/codex-reasoning-rules-alias-sets
branch
from
September 24, 2026 04:17
cb51d4c to
5c58965
Compare
Owner
|
Thanks @QuangBlue — nice cleanup. Reading the max/ultra models from the executor's alias sets removes the drift that made Astra targets get skipped/400ed under forced |
diegosouzapw
added a commit
to lorenzozanee/OmniRoute
that referenced
this pull request
Sep 29, 2026
…s sets Merge the release tip (diegosouzapw#14720 moved the Codex max/ultra capability check to the executor alias sets) and keep this PR's openai/ prefix fix on top: the rules-editor helper now strips openai/ and delegates to codexModelFamilySupportsExtendedEffort, so the dashboard and the executor share one model list. Adds a case for an openai/ gpt-6 variant.
diegosouzapw
pushed a commit
that referenced
this pull request
Sep 29, 2026
Maintainer rework: merged the tip, where #14720 moved the Codex max/ultra check to the executor alias sets; the rules-editor helper now strips openai/ and delegates to that shared check (red->green proven: without the openai/ strip 2/4 fail, with it 4/4; reasoning-routing suites 20/20). Boarded on the release/v3.8.51 tip (3a2678f) with the b3 release-drain batch (26 PRs): typecheck:core and the open-sse typecheck are clean, ESLint is clean on every changed file, migration numbering OK, and the focused tests of the whole board pass 611/611 (51 files). File-size ceiling growth is reconciled in the wave follow-up. Thank you @lorenzozanee!
diegosouzapw
added a commit
to kang-heewon/OmniRoute
that referenced
this pull request
Sep 29, 2026
…w#14720 codex alias-set helper)
diegosouzapw
pushed a commit
that referenced
this pull request
Sep 29, 2026
…6-luna (#14059) Maintainer rework (release drain 2026-09-28): reconciled with the release/v3.8.51 tip three times — kept the tip's opencode-zen Responses routing (#14230) and layered the PR's reasoning metadata on it; ported the provider-namespace fix onto the shared Codex alias-set helpers from #14720/#14964 (policy now checks modelIdForRegistry; rules editor strips any provider prefix, luna coerces a saved ultra to max) and fixed the tip's leftover STANDARD_EFFORTS reference in the simulator select. Red->green: luna-reasoning-effort-400 fails 2/5 on the tip, 5/5 here; new github/opencode-zen efforts case fails on the tip, passes here. Focused suites 114/114 (13 files) + api-key-routing-editor vitest 6/6; typecheck:core, open-sse typecheck and ESLint clean; eslint-suppressions.json byte-identical to the tip. Thank you @kang-heewon!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Reasoning-routing rules decide whether a Codex model accepts
max/ultrawith a hard-coded GPT-5.6 regex. The regex appears twice insrc/lib/reasoningRouting/policy.tsand once more in the rules editor (src/shared/components/ReasoningRoutingRules.tsx). The Codex executor's suffix parsing readsCODEX_MAX_ALIAS_MODELS/CODEX_ULTRA_ALIAS_MODELSinopen-sse/executors/codex/reasoningSuffix.tsinstead, and its effort clamp table agrees with those sets. The sets already includegpt-6-astra, so the rule gate and the executor disagree about GPT-6 Astra:maxorultracountscx/gpt-6-astraand its effort variants (e.g.cx/gpt-6-astra-high) as incompatible, andfilterComboForReasoningDecision()removes them from the rule's target combo.[cx/gpt-6-astra, cx/gpt-5.6-sol, cx/gpt-5.6-luna, cx/gpt-6-astra-max], forcedmaxreports "2 incompatible combo target(s) will be skipped", both of them Astra.cx/gpt-6-astratarget is reportedunsupported, soapplyDecision()insrc/sse/handlers/reasoningRouting.tsrejects the request with 400 "Reasoning effort 'max' is not supported by the configured target". The executor serves Astra at both tiers.cx/gpt-6-astra-maxandcx/gpt-6-astra-ultraare not read asmax/ultrarequests.extractReasoningIntent()keeps the suffix in the model id and returns no effort, so a rule that matches on source effortmaxnever matches them.max/ultrafor GPT-6 Astra targets and shows the "unsupported" warning.The review of #14677 found this gap. That PR adds
gpt-6-sol(max and ultra) andgpt-6-luna(max only) to the same alias sets, and the regex would miss them too.Changes
New
src/shared/reasoning/codexExtendedEffort.tsreads the alias sets and exports two helpers:isCodexExtendedEffortBaseModel(model, effort)matches only the exact base model, as the old^gpt-5\.6-(?:sol|terra|luna)$did. The suffix parser inpolicy.tsuses it.codexModelFamilySupportsExtendedEffort(model, effort)also accepts<base>-<suffix>variants, as the old(?:-|$)regexes did. The capability gate inpolicy.tsand the rules editor use it.Both accept an optional
codex/orcx/prefix and ignore case. The module lives insrc/sharedso that the client component does not import fromopen-sse/executorsdirectly.policy.tsandReasoningRoutingRules.tsxcall these helpers instead of their regex copies. The gate order incapabilityFor()is unchanged: static registry vocabulary, then declared efforts, then the operator override, and only then this fallback.reasoningSuffix.tsitself is not touched, so this PR does not conflict with feat(sse): add GPT-6 Sol and Luna to the Codex catalog #14677. Once both are merged, Sol and Luna are covered here without another edit.For GPT-5.6 models, every input the old regexes accepted or rejected gives the same result. The only difference is that the gate now also trims whitespace; the editor already did. The models whose result changes are the alias-set members the regex did not name (today:
gpt-6-astra).Out of scope:
extendedUnsupportedWarningtext still says "suitable Codex GPT-5.6 models". Rewording it changes an English value, andcheck-ui-value-driftwould then require every locale to be updated, so that is better done in a translation pass.getCodexAliasEffortCap()inreasoningSuffix.tsand this module both read the same sets. They could be merged in a follow-up.Tests
New
tests/unit/reasoning-routing-codex-extended-effort.test.ts(8 tests) covers:maxkeeps Astra (the base id and a variant) in a combo;ultrakeeps Astra and still drops the max-onlygpt-5.6-luna;cx/gpt-6-astratarget issupportedfor forcedmaxandultra;ultra;-max/-ultrasuffix parsing for Astra and for every set member;cx/gpt-6-astra-high-maxandcx/gpt-6-astral-maxare not split) and the helper edge cases.The combo and single-target cases use real rules and combos through
resolveReasoningRoutingRule(). Six of the eight fail on the base commit; the two that pass there guard the exact-match behaviour. The tests iterate the sets, so new members are covered automatically.On a local merge of this branch with feat(sse): add GPT-6 Sol and Luna to the Codex catalog #14677, the same tests pass. In that merge:
maxkeepscx/gpt-6-solandcx/gpt-6-luna;ultradrops onlycx/gpt-6-luna;cx/gpt-6-sol-maxis read asmax.Neighbouring tests all pass:
reasoning-routing(its comments now name the alias-set fallback instead of the old regex),reasoning-routing-decision-guards,reasoning-routing-api,codex-reasoning-suffix,codex-astra;reasoning-routing-pipelineandreasoning-routing-reliability;tests/unit/ui/api-key-routing-editor.test.tsx;client-bundle-no-server-only-10692.npm run test:vitest:ui: 2427 passed. The 18 failures come from suites that fail to load because vite cannot bundlenode:sqlite/node:test(MCP server, autoCombo, memory, TLS clients,ComboSortSelect). None of them imports a file this PR changes.ESLint (with suppressions), Prettier,
check:cyclesandcheck:file-sizeare clean.typecheck:corereports only the pre-existing TS2322 insrc/lib/services/cliproxyAccountHealth.ts:157, which is unchanged from the base.check:dashboard-typecheckreports only the pre-existing TS2698 insrc/lib/combos/intelligentRouting.ts, which reproduces with this change reverted.