fix(cost): derive local costs from token pricing - #72
Conversation
Walkthrough将所有本地 session 解析器中对应用/vendor 上报的 cost/credits 字段的读取全部移除,改为在解析后通过新的 ChangesToken 派生本地成本重构
估计代码审查工作量🎯 4 (Complex) | ⏱️ ~60 minutes 可能相关的 PR
诗
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
/juya review |
There was a problem hiding this comment.
1 issue found across 34 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
|
/juya review |
|
OpenCodeReview failed before posting review comments. Check bot logs for this pull request and retry after fixing the service configuration. |
|
/juya review |
|
OpenCodeReview failed before posting review comments. Check bot logs for this pull request and retry after fixing the service configuration. |
|
/juya review |
Summary
UnifiedMessage.costthrough Tokscale pricing.Verification
cargo test -p tokscale-corecargo test -p tokscale-clicargo run -p tokscale-cli -- --no-spinner --json --client crushcargo run -p tokscale-cli -- --no-spinner --json --client opencodeSummary by cubic
Local report costs now derive only from token pricing. Parsers ignore app/vendor spend, rows without positive tokens are dropped, and cost-only clients (Crush, Warp) are fully disabled and removed from scanning.
Refactors
UnifiedMessage.costfrom tokens viacrate::finalize_token_priced_messages; strip embedded costs in parsers; normalize token buckets; skip zero-token rows; clean totals (including -0.0) in reports/TUI; offline totals are 0.0 without pricing.crush/warpadapters and session parsers, drop their local scan paths, mark them as not locally parsed, update the scanner to ignore them, remove Warp cache checks and leftover scan/submit paths, and trim related CLI/tests.Migration
Written for commit 9ea9f30. Summary will update on new commits.
Summary by CodeRabbit
发布说明
Bug Fixes
totalCost现在精确为0.0)。Chores