Commit 14f4f0c
fix(copilot): restrict model normalization to claude-prefixed names
GPT model IDs use dots in the pricing catalog (e.g. gpt-5.4) so
applying strings.ReplaceAll universally would convert gpt-5.4 to
gpt-5-4 and cause pricing lookup misses.
Restrict the dot-to-hyphen substitution in normalizeCopilotModel to
names that begin with 'claude-', which are the only Copilot-emitted
IDs that need normalization. All other model names pass through
unchanged.
Add TestNormalizeCopilotModel table test covering claude variants,
gpt-5.4/gpt-5.5, gpt-4o, o3-mini, and the empty string.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 746815f commit 14f4f0c
2 files changed
Lines changed: 32 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
298 | 299 | | |
299 | | - | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
300 | 304 | | |
301 | 305 | | |
302 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
509 | 531 | | |
510 | 532 | | |
511 | 533 | | |
| |||
0 commit comments