ITADN

cost-tracker: Sonnet rate is stale for Sonnet 5's introductory pricing (expires 2026-08-31)

#2724OpenAmirF194 创建于 10 天前
A
AmirF194commented
`RATE_TABLE.sonnet` in `scripts/hooks/cost-tracker.js` is `{ in: 3.00, out: 15.0, cacheWrite: 3.75, cacheRead: 0.30 }`. That is the post-2026-09-01 standard Sonnet rate. Claude Sonnet 5 is currently on introductory pricing, $2/$10 per million input/output tokens ($2.50 5m cache write, $0.20 cache read), through August 31, 2026: https://platform.claude.com/docs/en/docs/about-claude/pricing#claude-sonnet-5-introductory-pricing. `getRates()` has one `sonnet` bucket for every Sonnet model, so any Sonnet 5 session priced today overcounts by 50%. Repro (Docker, `node:20-slim`, table and function copied verbatim from HEAD `59a99d66`): ```js const rates = getRates('claude-sonnet-5-20260514'); // { in: 3, out: 15, cacheWrite: 3.75, cacheRead: 0.3 } // 1M in / 1M out -> $18.00 reported, $12.00 actual at the published introductory rate (50% over) ``` Same root cause as #2574, a hard-coded table with no per-model-version disambiguation, different symptom: #2574 is Opus stale by 3x and Fable falling through to Sonnet; this is Sonnet 5 priced at its own post-window rate three weeks early. Neither my fix in #2596 nor the open #2621/#2691/#2692 touch it. #2691 actually pins the current $3/$15 as correct with a new test ("prices Sonnet at $3/$15 and marks it as a real match"), which is right starting 2026-09-01 but wrong until then. The fix needs a calendar check the other rows don't (this is a fixed-window promo, not a version distinction), and #2691 is about to restructure this same table, so I'm filing separately rather than folding it into #2596. Happy to send a follow-up PR once #2596/#2691 settle, or sooner if you'd rather have it now.
0 条评论