(model: ModelName)
| 367 | * if the model is not recognized as a public model. |
| 368 | */ |
| 369 | export function getPublicModelDisplayName(model: ModelName): string | null { |
| 370 | if (model.includes('gpt-') || model.includes('codex')) { |
| 371 | if (model === 'gpt-5.2-codex') return 'Codex 5.2' |
| 372 | if (model === 'gpt-5.1-codex') return 'Codex 5.1' |
| 373 | if (model === 'gpt-5.1-codex-mini') return 'Codex 5.1 Mini' |
| 374 | if (model === 'gpt-5.1-codex-max') return 'Codex 5.1 Max' |
| 375 | if (model === 'gpt-5.4') return 'GPT 5.4' |
| 376 | if (model === 'gpt-5.2') return 'GPT 5.2' |
| 377 | return model |
| 378 | } |
| 379 | |
| 380 | switch (model) { |
| 381 | case getModelStrings().opus46: |
| 382 | return 'Opus 4.6' |
| 383 | case getModelStrings().opus46 + '[1m]': |
| 384 | return 'Opus 4.6 (1M context)' |
| 385 | case getModelStrings().opus45: |
| 386 | return 'Opus 4.5' |
| 387 | case getModelStrings().opus41: |
| 388 | return 'Opus 4.1' |
| 389 | case getModelStrings().opus40: |
| 390 | return 'Opus 4' |
| 391 | case getModelStrings().sonnet46 + '[1m]': |
| 392 | return 'Sonnet 4.6 (1M context)' |
| 393 | case getModelStrings().sonnet46: |
| 394 | return 'Sonnet 4.6' |
| 395 | case getModelStrings().sonnet45 + '[1m]': |
| 396 | return 'Sonnet 4.5 (1M context)' |
| 397 | case getModelStrings().sonnet45: |
| 398 | return 'Sonnet 4.5' |
| 399 | case getModelStrings().sonnet40: |
| 400 | return 'Sonnet 4' |
| 401 | case getModelStrings().sonnet40 + '[1m]': |
| 402 | return 'Sonnet 4 (1M context)' |
| 403 | case getModelStrings().sonnet37: |
| 404 | return 'Sonnet 3.7' |
| 405 | case getModelStrings().sonnet35: |
| 406 | return 'Sonnet 3.5' |
| 407 | case getModelStrings().haiku45: |
| 408 | return 'Haiku 4.5' |
| 409 | case getModelStrings().haiku35: |
| 410 | return 'Haiku 3.5' |
| 411 | case getModelStrings().gpt54: |
| 412 | return 'GPT-5.4' |
| 413 | case getModelStrings().gpt53codex: |
| 414 | return 'GPT-5.3 Codex' |
| 415 | case getModelStrings().gpt54mini: |
| 416 | return 'GPT-5.4 Mini' |
| 417 | default: |
| 418 | return null |
| 419 | } |
| 420 | } |
| 421 | |
| 422 | function maskModelCodename(baseName: string): string { |
| 423 | // Mask only the first dash-separated segment (the codename), preserve the rest |
no test coverage detected