Repository navigation
feat(ui): show model usage price metrics - #389
Conversation
|
Warning Review limit reached
Next review available in: 38 minutes Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. 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. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe agent now reports full model specifications in completion events. Pricing calculations use centralized effective rates, including fast-tier cache rates. The usage modal attributes costs by model, displays effective pricing, and omits cost metrics for zero-priced models. ChangesModel and Usage Reporting
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: 🟡 Moderate · up to The usage view can underreport mixed-session prices when a zero-priced model is present, while unresolved model parsing can omit attribution and provider-qualified models can appear under the same label. These bounded correctness and display issues should be fixed or explicitly accepted before merge. Sequence Diagram(s)sequenceDiagram
participant UsageModal
participant ModelPricing
participant TokenUsage
UsageModal->>ModelPricing: resolve pricing for each model
ModelPricing-->>UsageModal: return effective rates
UsageModal->>TokenUsage: calculate attributed cost and savings
TokenUsage-->>UsageModal: return usage metrics
UsageModal-->>UsageModal: render pricing lines and usage rows
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Criterion
Details
| Benchmark suite | Current: cf1d987 | Previous: 691fed3 | Ratio |
|---|---|---|---|
fib/jit_mlua_hook |
6676050 ns/iter (± 93564) |
6701811 ns/iter (± 35999) |
1.00 |
fib/jit_watchdog |
2283757 ns/iter (± 4831) |
2224119 ns/iter (± 7964) |
1.03 |
fib/jit_none |
2275518 ns/iter (± 5992) |
2224757 ns/iter (± 35783) |
1.02 |
fib/interp_mlua_hook |
8101782 ns/iter (± 85662) |
8044330 ns/iter (± 279594) |
1.01 |
fib/interp_watchdog |
4300616 ns/iter (± 128693) |
4276374 ns/iter (± 47848) |
1.01 |
fib/interp_none |
4281445 ns/iter (± 25713) |
4307278 ns/iter (± 13919) |
0.99 |
buffer_rw/jit_mlua_hook |
582242 ns/iter (± 1650) |
583948 ns/iter (± 1500) |
1.00 |
buffer_rw/jit_watchdog |
191360 ns/iter (± 365) |
191598 ns/iter (± 379) |
1.00 |
buffer_rw/jit_none |
191348 ns/iter (± 5857) |
191424 ns/iter (± 574) |
1.00 |
buffer_rw/interp_mlua_hook |
1037466 ns/iter (± 11334) |
1074818 ns/iter (± 8303) |
0.97 |
buffer_rw/interp_watchdog |
583569 ns/iter (± 1098) |
584134 ns/iter (± 14691) |
1.00 |
buffer_rw/interp_none |
582813 ns/iter (± 13743) |
584099 ns/iter (± 1057) |
1.00 |
splash_render_120x40 |
81172 ns/iter (± 356) |
64280 ns/iter (± 6088) |
1.26 |
splash_render_200x60 |
112086 ns/iter (± 4277) |
192819 ns/iter (± 8009) |
0.58 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Criterion'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.
| Benchmark suite | Current: 2f5dbe1 | Previous: 45121b8 | Ratio |
|---|---|---|---|
buffer_rw/jit_mlua_hook |
882685 ns/iter (± 48192) |
430010 ns/iter (± 4387) |
2.05 |
This comment was automatically generated by workflow using github-action-benchmark.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
You have reached your Codex usage limits for security reviews. Please try again later. |
A single zero-priced model in the session made attributed_costs return None for the whole fold, hiding the estimate even when another model in the same session had a real cost. Skip zero-priced models instead, and report no estimate only when no priced model contributed at all.
|
Applied the zero-priced-model finding in d68fbd7: |
assert_eq! on f64 trips clippy::float_cmp, which is denied by just lint, so the effective-pricing test failed the Lint job on all three platforms.
|
@coderabbitai review |
|
Summary
/usageResearch
Validation
cargo fmt --allcargo check --allcargo clippy --all --tests -- -D warningscargo nextest run --workspace(5,234 passed, 4 skipped)