Repository navigation
fix(models): keep claude-4-sonnet-thinking in the Sonnet 4 family - #982
Conversation
ozymandiashh
left a comment
There was a problem hiding this comment.
Correct, and the repo corroborates it without needing to consult anything external: src/providers/cursor.ts:33 and src/providers/cursor-agent.ts:58 already render this slug as "Sonnet 4 (Thinking)", with claude-4.5-sonnet-thinking as a separate "Sonnet 4.5 (Thinking)" entry — pinned by tests/providers/cursor.test.ts:31. The provider display maps and the alias table disagreed, and this makes them agree.
It also removes the last inconsistent row in that table. Every dot-versioned slug carries its version through (claude-4.5-sonnet-thinking → claude-sonnet-4-5, claude-4.6-sonnet-thinking → claude-sonnet-4-6), and the unversioned claude-4-sonnet / claude-4-sonnet-1m already resolved to claude-sonnet-4. This row was the only one where a suffix quietly promoted a model to a different minor version — same bug class as claude-4-opus, which came from the same original commit and was corrected in #290.
The impact is more than cosmetic: src/parser.ts keys modelBreakdown off getShortModelName, so a Cursor user running both Sonnet 4 Thinking and Sonnet 4.5 had the two collapsed into one "Sonnet 4.5" row in the overview, menubar and sessions breakdowns.
Good call adding the standalone display-name assertion. The parametrized pricing row can't catch this on its own while the two models share rates in the snapshot, so that extra assertion is the only thing actually pinning the identity — and the comment says so, which is what makes it maintainable.
One pre-existing gap this doesn't touch, just noting it so it isn't a surprise: already-finalized days in the daily cache stay bucketed under the old name. getDailyCacheConfigHash is composed only of the local-savings and price-override hashes, and getModelAliasesConfigHash deliberately excludes the builtin table, so nothing invalidates history when BUILTIN_ALIASES changes. Today's numbers are right immediately; older days re-bucket only when their cache is otherwise re-derived. Not a reason to hold this.
Problem
Cursor's unversioned
claude-4-sonnet-thinkingslug was aliased toclaude-sonnet-4-5, even though it identifies the thinking variant of Sonnet 4.This is easy to miss today because Sonnet 4 and Sonnet 4.5 currently have identical rates. The incorrect identity nevertheless surfaces the wrong model name and could become a pricing error if those rates diverge.
Change
claude-4-sonnet-thinkingtoclaude-sonnet-4User impact
Cursor sessions using this slug now appear under Sonnet 4 rather than Sonnet 4.5 and remain attached to the correct pricing family.
Validation
npx vitest run tests/models.test.ts— 154 passednpm test— 2,617 passed, 5 skippednpm run test:locks— 26 passednpx tsc --noEmitnpm run build:clinpm --prefix dash run buildSonnet 4Addresses the confirmed model-alias finding in #912.