* Check if a model belongs to a given family by checking if its name * (or resolved name) contains the family identifier.
(model: string, family: string)
| 8 | * (or resolved name) contains the family identifier. |
| 9 | */ |
| 10 | function modelBelongsToFamily(model: string, family: string): boolean { |
| 11 | if (model.includes(family)) { |
| 12 | return true |
| 13 | } |
| 14 | // Resolve aliases like "best" → "claude-opus-4-6" to check family membership |
| 15 | if (isModelAlias(model)) { |
| 16 | const resolved = parseUserSpecifiedModel(model).toLowerCase() |
| 17 | return resolved.includes(family) |
| 18 | } |
| 19 | return false |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * Check if a model name starts with a prefix at a segment boundary. |
no test coverage detected