fix: claude_sonnet_5 was priced 50% high — fold into 0.16.6 - #154
Merged
Conversation
The preset carried Sonnet 4.6's entire price row — $3/$15 with $0.30/$3.75 cache rates, uniformly 1.5x the real figures — from v0.9.0 through v0.16.5. Every cost_usd and session_cost_usd for that model overstated spend by half, across 18 releases. Now $2/$10 with $0.20/$2.50, verified against Anthropic's pricing page and models.dev on 2026-08-23 rather than copied from main. test_new_generation_presets pinned only output_per_million, so it failed on this change and had to be corrected — but a one-field assertion is how the original error survived, and would let a partial correction pass just as quietly. It now pins all four rates. Mutation-checked: leaving cache_read stale at 0.3 fails it. Corrected on the 0.18.0 line by #121; this back-ports it. The drift alarm that catches this class of error (tests/price_audit.rs) is 0.18.0-only, so this line has the corrected numbers but not the guard. 518 passed, clippy clean under -Dwarnings. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Folds into the unreleased 0.16.6, which is merged to
release/0.16.xbut not yet tagged.The drift
claude_sonnet_5carried Sonnet 4.6's entire price row on this line:Uniformly 1.5× is the signature of a whole row copied from the previous model. It shipped from v0.9.0 through v0.16.5 — 18 releases — overstating every
cost_usdandsession_cost_usdfor the model by half, with nothing in the crate able to detect it.Verified against Anthropic's pricing page and models.dev (
2 / 10 / 0.2 / 2.5, no tiers) rather than copied from main.The test was part of the problem
test_new_generation_presetspinnedsonnet.cost.output_per_million == 15.0— one field of four — so it failed on this change and had to be corrected. But a one-field assertion is how the original error survived, and it would let a partial correction pass just as quietly. It now pins all four.Mutation-checked: leaving
cache_readstale at0.3while fixing the rest fails it.Scope note
The drift alarm that catches this class of error —
tests/price_audit.rs, which diffs every priced preset against models.dev — is 0.18.0-only. This line now has the corrected numbers but not the guard, so future drift here is again undetected. Back-porting the audit is a larger change and not attempted here.518 tests, clippy clean under
-Dwarnings.🤖 Generated with Claude Code