fix(vscode): Display CLI cost cents as dollars - #256
Conversation
Read costCents instead of the nonexistent cost field in usage summaries\nand dashboard aggregations. Keep dollar-valued summary outputs and\nexisting model allocation behavior.\n\nAdd executable summary and webview regression tests for non-zero costs,\nscoped totals, model shares, and missing or zero values.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe extension now reads CLI ChangesCost reporting
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The extension now reads CLI cost cents and displays dollar totals in usage summaries and dashboard breakdowns, with coverage for non-zero, scoped, allocated, missing, and zero-cost data. No concrete current-head merge risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 3 files. (2 skipped: 2 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. I count bright cents beneath the moon, Comment |
Why
The VS Code extension reads
stats.cost, but the CLI emits integer cents instats.costCents. Missing-field fallbacks therefore show$0.00in the dashboard and status bar popup even when the CLI reports non-zero costs. For example,costCents: 118should display as$1.18.Closes #255.
What changed
costCentsto dollars in both summary functions and all three dashboard aggregations (hero, By Tool, By Model).npm testand exclude test sources from the extension package.Validation
npm --prefix vscode-splitrail test— TypeScript compilation and all four tests pass.origin/mainreproduce three failures: summary costs, dashboard totals, and model allocation all incorrectly return zero.git diff --check— passed.cargo build --quiet— passed.cargo test --quiet— 453 tests passed.cargo clippy --quiet -- -D warnings— passed.cargo doc --quiet— passed.cargo fmt --all --quiet— passed; worktree remains clean.The dashboard checks execute its real rendering script but do not launch a VS Code extension host. No live VS Code screenshot or extension-host end-to-end validation is claimed.
Summary by CodeRabbit