fix(caveman-stats): correct Opus output price ($75β$25) for 4.5+ era#466
Open
jmmarquez2025 wants to merge 1 commit into
Open
fix(caveman-stats): correct Opus output price ($75β$25) for 4.5+ era#466jmmarquez2025 wants to merge 1 commit into
jmmarquez2025 wants to merge 1 commit into
Conversation
priceForModel prefix-matched every claude-opus-4* id to $75/M output β the legacy Claude 3 Opus rate. Opus 4.5β4.8 is $25/M (rate card held since 4.5), so /caveman-stats overstated the savings figure ~3x on any current-Opus session. Split the price table into legacy (4.0/4.1 + dated ids β $75) and current (4.5β4.8 β $25) prefixes, most-specific-first so existing dated-id behavior is preserved. Also corrects Haiku 4.5 to $5/M (was $4). caveman-stats suite stays green (29/29). The 4 pre-existing opencode installer failures are unrelated to this change. Closes JuliusBrussee#465 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Fixes #465.
Problem
src/hooks/caveman-stats.jspriceForModel()prefix-matches everyclaude-opus-4*id to $75/M output β the legacy Claude 3 Opus rate. Anthropic's Opus rate card has been $5/M in, $25/M out since Opus 4.5 (4.8 shipped on the same card, 2026-05-28). So/caveman-statsoverstates the savings/cost figure ~3Γ for anyone running a current Opus model β increasingly the default.claude-haiku-4was also stale ($4 vs Haiku 4.5's $5/M).Fix
Split the table into legacy vs current Opus, most-specific prefixes first (the loop returns the first match), so retired 4.0/4.1 (incl. dated ids like
claude-opus-4-20250514) keep $75 while 4.5β4.8 resolve to $25:This keeps the existing dated-id test (
claude-opus-4-20250101 β 75) valid instead of regressing it β preferred over a flat constant flip, which is the alternative I floated in #465.Tests
tests/test_caveman_stats.jsupdated and green β 29/29. Added asserts pinning both eras (claude-opus-4-8 β 25,claude-opus-4-1-20250805 β 75).Source: https://platform.claude.com/docs/en/about-claude/pricing