feat: fix --breakdown broken flag#1083
Conversation
|
This PR was auto-closed. Only contributors approved with Maintainers review auto-closed issues and reopen worthwhile ones. Issues that do not meet the quality bar in CONTRIBUTING.md may not be reopened or receive a reply. If a maintainer replies See CONTRIBUTING.md. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR extends the usage-report data model to include per-model cost breakdowns. Codex row generation builds sorted ChangesPer-Model Cost Breakdowns
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ 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 |
Summary
--breakdownflag was silently ignored in the multi-agent ("all") table — it only showed per-agent rows (Claude, Kilo, etc.) but never per-model cost/token breakdownsRoot cause
When the Rust CLI replaced the TypeScript implementation, AllRow was introduced without a model_breakdowns field. summary_rows() discarded UsageSummary.model_breakdowns during conversion, and print_table() never checked shared.breakdown.
Test plan
ccusage --breakdownshows per-model rows with tokens and cost under each agentccusage(no flag) output is unchangedccusage --breakdown --jsonincludes modelBreakdowns array per rowSummary by cubic
Fixes the
--breakdownflag inccusageso per-model token and cost breakdowns appear under each agent and in the aggregated “all” row. Also includes these breakdowns in--jsonoutput and adds Codex per-model breakdowns.model_breakdownstoAllRow, aggregated across agents, sorted by cost, and rendered when--breakdownis set.modelBreakdownsin--jsonoutput for each row.CodexGroup.modelsand usescalculate_codex_model_cost.Written for commit 0e5c4e7. Summary will update on new commits. Review in cubic
Summary by CodeRabbit