Repository navigation
Conversation
A model with no known price contributes zero cost. Table output warns on stderr, but JSON output gave no signal, so scripts could not tell a free model from an unknown one. Totals now carry `unpricedModels` (sorted, deduplicated, key omitted when empty) from the shared totals builder, the unified report's own totals, and the codex adapter's totals. Model breakdowns carry `missingPricing: true` only when set, and focused codex reports mark the affected entries of each period's `models` map. Priced reports and their snapshots are unchanged. `--no-cost` keeps both fields because they describe availability, not amounts. Detection follows the cost mode, so display mode and stored costs report nothing, and the docs say so. Blocks and `session --id` have no totals object and stay as is.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughChangesThe JSON output now identifies usage from models without pricing. Totals include sorted, deduplicated Unpriced model reporting
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature · Severity of issue fixed: Medium Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant ReportAdapter
participant CoreOutput
participant JSONReport
ReportAdapter->>CoreOutput: provide model breakdowns
CoreOutput->>CoreOutput: collect missing pricing models
CoreOutput->>JSONReport: attach unpricedModels and missingPricing
Merge Risk: ⚪ Minimal · up to The new pricing-availability metadata is propagated through supported reports and preserved with no-cost output. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 Clippy (1.98.0)Clippy execution failed 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 |
|
Pullfrog could not complete the automated PR review. The PR was left open for maintainer review. |
There was a problem hiding this comment.
Important
Stray work-log.yaml must go before merge; the JSON feature itself looks correct.
Reviewed changes
- Added
totals.unpricedModels(sorted, deduplicated, omitted when empty) via sharedunpriced_models/attach_unpriced_modelshelpers inccusage-core::output, wired into shared, unified, and codex totals. - Changed
ModelBreakdown.missing_pricingfromskip_serializingtoskip_serializing_iffalse, somodelBreakdowns[].missingPricing: trueappears only when set and priced snapshots stay byte-identical. - Marked focused
codexper-periodmodelsentries withmissingPricingand attached totals fromcodex_missing_pricing_models; unified--by-agent/--sectionspaths carry the flag through nested breakdowns. - Documented cost-mode semantics,
--no-costretention, andblocks/session --idnon-coverage injson-output.md, with unit coverage for sorting, dedup, zero-rate vs unknown, mode suppression, andstrip_cost_jsonretention.
Muse Spark Contributor (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
All reported issues were addressed
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
Thank you for the careful implementation and test coverage. I also verified the focused Rust tests, Clippy, and formatting locally.\n\nI’m closing this because it adds a new public JSON contract rather than fixing existing report behavior. The parent issue was already triaged as an excluded feature request, and maintaining the placement, naming, and compatibility of these fields would expand the project’s supported surface. The existing table warning remains the supported signal for missing pricing.\n\nThis is a scope decision, not a quality issue with the contribution. |
|
We revisited the earlier scope decision and carried your implementation forward on current main in #1750. You are credited as a co-author on the commit. Thank you for the solid implementation and test coverage. |

Fixes #1736.
A model with no known price contributes zero cost. Table output warns on stderr, but JSON output gave no signal, so scripts could not tell a free model from an unknown one.
What changes in JSON
totals.unpricedModels: sorted, deduplicated model names. The key is omitted when empty, so priced reports and every existingtotalssnapshot are byte-identical. Scripts use.totals.unpricedModels // [].modelBreakdowns[].missingPricing: true, present only when set.ModelBreakdown.missing_pricingalready existed and wasskip_serializing; it is nowskip_serializing_iffalse.codexreports setmissingPricingon the affected entries of each period'smodelsmap, and their totals carryunpricedModelsfrom the existingcodex_missing_pricing_models.--no-costkeeps both fields. They describe pricing availability, not amounts. Tested.Where it is computed
One helper pair in
ccusage-core::output(unpriced_models,attach_unpriced_models) used by the sharedtotals_json, by the unified report's owntotals_jsoninccusage-adapter-all, and by the codex adapter's totals. The stderr warning path now reusesunpriced_modelsinstead of its own filter. Covered: daily, weekly, monthly, and session reports for every agent, including--instances,--sections(totals follow the invoked section), and--by-agent(nested agent breakdowns carry the flag).What it deliberately does not claim
Detection follows the cost mode. Display mode, and auto mode for entries with stored costs, look nothing up and report nothing; a model can appear in
unpricedModelsand still show positive cost when some entries carried stored costs. The docs say an absent key means "no unpriced usage detected under this mode".blocksandsession --idhave nototalsobject and are unchanged; happy to follow up if you want them.Open design questions from the issue: placement inside
totalsvs top-level, andunpricedModelsvsmissingPricingModels. Either is a small change.Tests: core totals (sorted, deduplicated, absent when priced), breakdown serialization,
strip_cost_jsonkeeps the fields, cost-mode suppression (auto with stored cost, display, calculate), zero-rate pricing vs unknown model through real lookup, unified report with nested agents and--sections, codex unknown vs priced vs zero-rate under Standard and Fast policies. Docs section injson-output.md.Validation:
cargo test --workspace(all green, no snapshot changes),cargo clippy --workspace --all-targets -D warnings,cargo fmt --check, release binary end to end on real pi, claude, codex, and unified data.Summary by cubic
Fixes #1736 by reporting models with missing pricing in JSON output, so scripts can distinguish free models from unpriced ones.
totals.unpricedModelslists sorted, deduplicated model names; the key is omitted when empty, so priced reports and snapshots stay byte-identical.missingPricing: true, including--by-agentnested breakdowns and focusedcodexreports' per-periodmodelsmaps.--no-costkeeps both fields because they describe pricing availability.daily,weekly,monthly, andsessionfor every agent, including--instancesand--sections; with--sections, totals follow the invoked section.blocksandsession --idare unchanged, andjson-output.mddocuments the fields withjqexamples.Written for commit 77cd542. Summary will update on new commits.
Summary by CodeRabbit
totals.unpricedModels.missingPricing: true; priced models omit this field.--no-cost.0when pricing is unavailable.