* Map a full model name to its family alias and the marketing name of the * version the alias currently resolves to. Used to detect when a user has * a specific older version pinned and a newer one is available.
( model: string, )
| 424 | * a specific older version pinned and a newer one is available. |
| 425 | */ |
| 426 | function getModelFamilyInfo( |
| 427 | model: string, |
| 428 | ): { alias: string; currentVersionName: string } | null { |
| 429 | const canonical = getCanonicalName(model) |
| 430 | |
| 431 | // Sonnet family |
| 432 | if ( |
| 433 | canonical.includes('claude-sonnet-4-6') || |
| 434 | canonical.includes('claude-sonnet-4-5') || |
| 435 | canonical.includes('claude-sonnet-4-') || |
| 436 | canonical.includes('claude-3-7-sonnet') || |
| 437 | canonical.includes('claude-3-5-sonnet') |
| 438 | ) { |
| 439 | const currentName = getMarketingNameForModel(getDefaultSonnetModel()) |
| 440 | if (currentName) { |
| 441 | return { alias: 'Sonnet', currentVersionName: currentName } |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | // Opus family |
| 446 | if (canonical.includes('claude-opus-4')) { |
| 447 | const currentName = getMarketingNameForModel(getDefaultOpusModel()) |
| 448 | if (currentName) { |
| 449 | return { alias: 'Opus', currentVersionName: currentName } |
| 450 | } |
| 451 | } |
| 452 | |
| 453 | // Haiku family |
| 454 | if ( |
| 455 | canonical.includes('claude-haiku') || |
| 456 | canonical.includes('claude-3-5-haiku') |
| 457 | ) { |
| 458 | const currentName = getMarketingNameForModel(getDefaultHaikuModel()) |
| 459 | if (currentName) { |
| 460 | return { alias: 'Haiku', currentVersionName: currentName } |
| 461 | } |
| 462 | } |
| 463 | |
| 464 | return null |
| 465 | } |
| 466 | |
| 467 | /** |
| 468 | * Returns a ModelOption for a known Anthropic model with a human-readable |
no test coverage detected