Repository navigation
Commit dc0e4c0
committed
fix(anthropic): reject a longer number, not any dot, in the family tail
The capitalization and dotted-minor repair is right, but widening the
tail from (?!\d) to (?![\d.]) to stop "claude-opus-4.20250514" also
rejected "claude-opus-4-8.1": the minor group matches "8", the tail sees
the following dot, the match is discarded, and the regex backtracks to a
major-only "4.0". That id parsed as Opus 4.8 before this PR, so it would
newly take the legacy thinking.enabled wire shape — the exact 400 this
change exists to prevent, reintroduced for a different id family.
A dotted suffix after a dashed minor is not a dotted minor. The tail's
job is to reject a longer NUMBER, which the original (?!\d) already did;
the dotted-minor support belongs entirely to the [.-] separator. Keeping
(?!\d) and adding only [.-] and /i covers every id the PR intended,
preserves every id the old regex classified correctly, and additionally
recovers "claude-opus-4.20250514" and "claude-opus-4.8.1", which the
wider tail turned into no match at all.
Tests: the adaptive matrix gains the dashed-capitalized and end-of-string
dotted cells so the capitalization and separator axes are covered
independently, plus "claude-opus-4-8.1" as the regression for the above.
The legacy matrix gains a capitalized date-pinned id, which previously
reached that branch by failing to parse rather than by parsing correctly.
The #545 explicit-disable matrix gains "Claude-Sonnet-5" — the only case
that exercises claudeFamilyVersion's second caller, where a miss is
invisible because the request simply goes out without the disable.
Verified red-then-green: with the original tail restored, only the
claude-opus-4-8.1 case fails (59 pass, 1 fail); with this correction,
60 pass, 0 fail. tsc --noEmit clean.1 parent 3304814 commit dc0e4c0
2 files changed
Lines changed: 27 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
472 | | - | |
| 472 | + | |
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
65 | 77 | | |
66 | 78 | | |
67 | 79 | | |
| |||
283 | 295 | | |
284 | 296 | | |
285 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
286 | 304 | | |
287 | 305 | | |
288 | 306 | | |
| |||
327 | 345 | | |
328 | 346 | | |
329 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
330 | 356 | | |
331 | 357 | | |
332 | 358 | | |
| |||
0 commit comments