feat(models): reflect the 2026-07-30 Terra and Luna price cut - #232
Conversation
|
Warning Review limit reached
Next review available in: 51 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. 📝 WalkthroughWalkthroughThe change updates GPT-5.6 Terra and Luna pricing, adds cache rates, preserves prior rates before 2026-07-30, and tests both sides of the date boundary. ChangesGPT-5.6 pricing
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/models.rs (1)
3063-3071: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winTest historical cache-write pricing.
Line 3066 passes zero cache-creation tokens. The test does not validate the dated
cache_write_per_1mvalues.src/analyzers/copilot_cli.rs:220-231passes cache-creation tokens into this date-aware pricing path. Add a nonzero cache-write assertion for both models.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/models.rs` around lines 3063 - 3071, Update the historical pricing test around calculate_cache_cost_for_service_tier_at to pass a nonzero cache-creation token count and assert the resulting cache-write cost for both models. Preserve the existing cache-read assertion and ensure the expectations exercise the date-specific cache_write_per_1m values selected by before_cut.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/models.rs`:
- Around line 3063-3071: Update the historical pricing test around
calculate_cache_cost_for_service_tier_at to pass a nonzero cache-creation token
count and assert the resulting cache-write cost for both models. Preserve the
existing cache-read assertion and ensure the expectations exercise the
date-specific cache_write_per_1m values selected by before_cut.
0f13811 to
7c8b28e
Compare
OpenAI cut GPT-5.6 Luna by 80% and Terra by 20% on 2026-07-30. Terra goes from $2.50/$15.00 to $2.00/$12.00 per 1M input/output tokens, Luna from $1.00/$6.00 to $0.20/$1.20. Sol is unchanged. The old rates move into `dated_pricing` with `valid_until = 2026-07-30` rather than being overwritten. Without that, every session recorded before the cut is re-costed at the new rates on the next run, and a Luna session that actually cost $7.00 per 1M combined tokens is reported at $1.40. The registry already models this, and `claude-sonnet-5` uses it the same way. Cached-token rates are derived, not quoted: OpenAI did not publish separate cached-input prices alongside the new rates. The derivation follows the rule this registry already applies to the GPT-5.6 family, cache writes at 1.25x the uncached input rate and cache reads at one tenth of it, which reproduces the existing Terra and Luna entries exactly. Two tests cover the boundary: usage on 2026-07-29 keeps the pre-cut price, and usage on 2026-07-30 already gets the new one, since `valid_until` is exclusive.
7c8b28e to
8a83710
Compare
Closes #227.
Terra goes from $2.50/$15.00 to $2.00/$12.00 per 1M input/output tokens, Luna from $1.00/$6.00 to $0.20/$1.20, effective 2026-07-30. Sol is unchanged. (CNBC, Axios)
The old rates move into
dated_pricingwithvalid_until = 2026-07-30instead of being overwritten. Overwriting re-costs everything recorded before the cut: a Luna session that actually cost $7.00 per 1M combined tokens gets reported at $1.40 on the next run.claude-sonnet-5already uses this mechanism the same way.Two tests cover the boundary. Usage on 2026-07-29 keeps the old price, usage on 2026-07-30 gets the new one, since
valid_untilis exclusive.Cached-token rates here are derived, not quoted. OpenAI did not publish cached-input prices alongside the new rates. I applied the rule this registry already uses for the GPT-5.6 family, cache writes at 1.25x the uncached input rate and reads at one tenth of it, which reproduces the existing Terra and Luna entries exactly. If you have official numbers, use those instead of my derivation.
I ran the suite in my fork, since
checks.ymldoes not runcargo test(#231). The runs below are on fork branches that add a temporarycargo testworkflow.src/models.rson those branches is byte-identical to this one; the only difference is that workflow file.gpt_5_6_terra_and_luna_keep_pre_cut_pricing_for_older_usage,left=2, right=2.5The third row is why this uses dated entries rather than editing the numbers in place.
Summary by CodeRabbit
New Features
Tests