* 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, )
| 385 | * a specific older version pinned and a newer one is available. |
| 386 | */ |
| 387 | function getModelFamilyInfo( |
| 388 | model: string, |
| 389 | ): { alias: string; currentVersionName: string } | null { |
| 390 | const canonical = getCanonicalName(model) |
| 391 | |
| 392 | // Sonnet family |
| 393 | if ( |
| 394 | canonical.includes('claude-sonnet-4-6') || |
| 395 | canonical.includes('claude-sonnet-4-5') || |
| 396 | canonical.includes('claude-sonnet-4-') || |
| 397 | canonical.includes('claude-3-7-sonnet') || |
| 398 | canonical.includes('claude-3-5-sonnet') |
| 399 | ) { |
| 400 | const currentName = getMarketingNameForModel(getDefaultSonnetModel()) |
| 401 | if (currentName) { |
| 402 | return { alias: 'Sonnet', currentVersionName: currentName } |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | // Opus family |
| 407 | if (canonical.includes('claude-opus-4')) { |
| 408 | const currentName = getMarketingNameForModel(getDefaultOpusModel()) |
| 409 | if (currentName) { |
| 410 | return { alias: 'Opus', currentVersionName: currentName } |
| 411 | } |
| 412 | } |
| 413 | |
| 414 | // Haiku family |
| 415 | if ( |
| 416 | canonical.includes('claude-haiku') || |
| 417 | canonical.includes('claude-3-5-haiku') |
| 418 | ) { |
| 419 | const currentName = getMarketingNameForModel(getDefaultHaikuModel()) |
| 420 | if (currentName) { |
| 421 | return { alias: 'Haiku', currentVersionName: currentName } |
| 422 | } |
| 423 | } |
| 424 | |
| 425 | return null |
| 426 | } |
| 427 | |
| 428 | /** |
| 429 | * Returns a ModelOption for a known Anthropic model with a human-readable |
no test coverage detected