Repository navigation
Report per-lane cost and run spend in --json and transcripts (#79), v1.3.0 - #132
Conversation
…1.3.0
- Every result now has a `cost`: dollars when priced with usage, 0.0 when
free or on a subscription, null when unknown. It used to be absent
unless priced, so a caller could not tell free from unknown.
- New `spend` object {actual, estimated_worst_case, budget, unpriced} in
--diff --json, --discuss --json, --synthesize --json and every
transcript. `actual` includes the --diff readers. A non-empty `unpriced`
means `actual` is a lower bound.
- --diff and --synthesize print the human spend line too.
- Plain --json stays a bare list so existing callers keep working. The
object form is a breaking change, filed as #131 for 2.0.
Closes #79
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015eWZfxrGjWj2QpwdgFwBjR
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (4)
🔇 Additional comments (4)
📝 SummarySummary by CodeRabbit
WalkthroughThe release adds per-result cost values and run-level spend reports to JSON, diff, synthesis, transcript, and text outputs. Transcripts can store spend data. The README documents output shapes, and the backlog records completion of ChangesSpend reporting
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant FinalRun
participant fill_costs
participant spend_report
participant save
participant JSONOutput
FinalRun->>fill_costs: Assign per-result cost values
FinalRun->>spend_report: Build run spend details
FinalRun->>save: Save results and spend report
FinalRun->>JSONOutput: Include results and spend report
Merge Risk: ⚪ Minimal · up to No confirmed spend-reporting issue blocks merging. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation Issue Resolution Add the required run-level Full details: Docstring CoverageExplanation Docstring coverage is 44.44% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 1 files. (3 skipped: 3 unsupported.)
✨ Finishing Touches 💡 1📝 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 |
Closes #79
What
cost. It is a dollar amount when the lane was priced and returned usage,0.0when the lane is free or on a subscription, andnullwhen the cost is unknown (an unpriced model, or no usage returned). Before, the field was missing unless the lane was priced, so a caller couldn't tell a free lane from an unknown one.spendobject,{actual, estimated_worst_case, budget, unpriced}, in--diff --json,--discuss --json,--synthesize --jsonand every transcript.actualincludes the--diffreaders. Ifunpricednames any lanes,actualis a lower bound, not the bill.--diffand--synthesizenow print the humanspend:line, which they used to drop.The one judgement call
Plain
--json, with no--diffor--discuss, prints a bare list, so a top-level key can't be added without changing the shape and breaking any caller that indexes it. That form keeps its shape. Each result'scostmakes the total a one-liner:jq 'map(.cost // 0) | add'. The object form is filed as #131 for a 2.0 release and added to BACKLOG.md.The version goes from 1.2.0 to 1.3.0, a minor bump because the change only adds fields.
Verification
costfor a paid, a free and an unpriced lane (0.3 / 0.0 / null);--diff --jsonspend that includes the readers;--diffspend line;--synthesize --json.ResourceWarnings.🤖 Generated with Claude Code
https://claude.ai/code/session_015eWZfxrGjWj2QpwdgFwBjR
Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/