mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-01 12:52:11 +03:00
fix(model-family): fallback lookup also tries bare model name with dots
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).
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user