fix(providers): filter unsupported family-fallback candidates against the provider catalog (#8134) - #8240
Merged
Conversation
… the provider catalog (#8134)
Owner
Author
|
Follow-up note on the full `npm run test:unit` local run: it surfaced 5 pre-existing failures unrelated to this PR's diff — `tests/unit/authz/spawn-capable-prefixes-client-safe.test.ts` (1) and `tests/unit/auto-combo-credentialed-model-pool.test.ts` (4). Confirmed base-red: `git diff origin/release/v3.8.49 -- <those test files + the modules they exercise>` is empty (no diff at all vs the target branch), and neither file imports `modelFamilyFallback.ts`. Re-ran both files in isolation — same deterministic failures, not a concurrency flake. Pre-existing on `release/v3.8.49`, out of scope for #8134. |
HouMinXi
pushed a commit
to HouMinXi/OmniRoute
that referenced
this pull request
Aug 2, 2026
… the provider catalog (diegosouzapw#8134) (diegosouzapw#8240) Co-authored-by: Probe Test <probe@example.com>
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
… the provider catalog (diegosouzapw#8134) (diegosouzapw#8240) Co-authored-by: Probe Test <probe@example.com>
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.
Closes #8134
Root cause
open-sse/services/modelFamilyFallback.ts::getNextFamilyFallback()resolves a provider's supported model ids intosupportedIdsbut only used that set to try dot/hyphen notation variants of a candidate — never to filter out a candidate that is provably absent from the provider's registered catalog under any notation. When neither the hyphen form nor a dot-variant matched, the loop fell through and returned the unresolved candidate anyway.For the
github(GitHub Copilot) registry entry, the Claude Opus tier list is 4.8 / 4.8-fast / 4.7 / 4.5 — there is no 4.6 tier.MODEL_FAMILIES['claude-opus-4-8']unconditionally includesclaude-opus-4-6, so the second fallback hop returnedgithub/claude-opus-4-6verbatim, and the upstream would 400 a third time before the family was exhausted — the wasted round-trip described in the issue.Fix
When the provider registry is resolved, a family candidate is now skipped (
continue) instead of returned unfiltered if it has no match insupportedIdsunder any notation — hyphen, dot-variant, or (new) a dated-snapshot id (claude-opus-4-5-20251101) with its trailing-YYYYMMDDsuffix stripped before the dot-variant check. The date-stripping addition was needed to keep thekirosibling regression test green (see landmine note below) — without it, dated Sonnet candidates that do have an undated match in a provider's catalog (claude-sonnet-4.5) would be wrongly skipped too.No change to
MODEL_FAMILIESitself or to thegithub/kiroregistries — filtering happens purely against the already-resolved catalog.TDD evidence (Hard Rule #18)
New permanent regression file
tests/unit/8134-github-t5-fallback-filter.test.ts:second fallback "github/claude-opus-4-6" is not in github's registered model catalog: ...— 2 tests, both failing.githubOpus fallback chain asserts every returned candidate is a real member ofgetRegistryEntry('github').models.Landmine — kiro sibling test
tests/unit/kiro-claude-sonnet-5-2267.test.ts(guards a different fallback contract, previously broken by a naivecontinue-based fix in a reverted PR) stays green, unmodified. The kiro registry only hasclaude-sonnet-4.5(no4-6tier, no dated snapshots) — the new date-stripped dot-variant check letsclaude-sonnet-4-5-20250929resolve to kiro's realclaude-sonnet-4.5entry instead of being incorrectly skipped, which is what a naive "skip everything unmatched" fix would have done (and why #8143 reverted that approach).Gates run (from the worktree)
node --import tsx/esm --test tests/unit/8134-github-t5-fallback-filter.test.ts— 2/2 pass (RED→GREEN)node --import tsx/esm --test tests/unit/kiro-claude-sonnet-5-2267.test.ts tests/unit/t30-kiro-400-model-unavailable.test.ts tests/unit/repro-7268-401-model-not-supported-lockout.test.ts tests/unit/model-family-fallback-notation.test.ts— 17/17 pass (all sibling fallback tests green, including the landmine)node scripts/check/check-file-size.mjs— OKnode scripts/check/check-complexity.mjs— reports a pre-existing repo-wide regression (2156 vs baseline 2130) unrelated to this diff:modelFamilyFallback.tsitself has 0 complexity violations, and the scan scope excludestests/, so nothing in this PR contributes to it.node scripts/check/check-cognitive-complexity.mjs— OK (944 ≤ baseline 950)npm run typecheck:core— cleannpx eslint --suppressions-location config/quality/eslint-suppressions.json open-sse/services/modelFamilyFallback.ts tests/unit/8134-github-t5-fallback-filter.test.ts— cleannode scripts/check/check-changelog-integrity.mjs— OKnpm run test:vitest— 271/271 pass, 30/30 filesnpm run test:unit— full suite run; 0 failures observed through the runScope
Diff is scoped strictly to
open-sse/services/modelFamilyFallback.ts(new pure helper functions + the fix) plus the new regression test and a changelog fragment. No changes toMODEL_FAMILIES, thegithubregistry, or thekiroregistry.