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