From e9ad669c407c368dff6f18530a5d12ee59d89491 Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Fri, 12 Jun 2026 21:03:34 -0300 Subject: [PATCH] fix(model-family): fallback lookup also tries bare model name with dots MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit getNextFamilyFallback normalized dots-to-hyphens ("gemini-3.1-pro-high" → "gemini-3-1-pro-high") but MODEL_FAMILIES keys use the literal dot form. The lookup always missed, returning null for any model whose dots are part of the name rather than a version separator. Fallback: try MODEL_FAMILIES[lookupKey] ?? MODEL_FAMILIES[bareModel] so both naming conventions are covered. Fixes T30 test (pre-existing since v3.8.22). --- open-sse/services/modelFamilyFallback.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/open-sse/services/modelFamilyFallback.ts b/open-sse/services/modelFamilyFallback.ts index 03d4c34e57..216c2748b7 100644 --- a/open-sse/services/modelFamilyFallback.ts +++ b/open-sse/services/modelFamilyFallback.ts @@ -150,9 +150,11 @@ export function getNextFamilyFallback( const provider = parsed.provider || parsed.providerAlias || ""; const prefix = provider ? `${provider}/` : ""; - // Normalize dots to hyphens for the lookup so kiro/claude-opus-4.8 finds the right entry + // Normalize dots to hyphens so kiro/claude-opus-4.8 finds the right entry. + // Fall back to the bare model name to support keys like "gemini-3.1-pro-high" + // whose dots are part of the literal name, not a version separator. const lookupKey = bareModel.replace(/\./g, "-"); - const family = MODEL_FAMILIES[lookupKey]; + const family = MODEL_FAMILIES[lookupKey] ?? MODEL_FAMILIES[bareModel]; if (!family) return null; // Resolve the provider's supported model IDs so we can match notation (dot vs hyphen)