fix(ci): unpin upstream LiteLLM prices that are failing every open PR - #150
Conversation
The GPT-5.6 family costs are owned upstream by LiteLLM and change without notice, so hardcoded rates make this integration test fail on price moves rather than on regressions we control. Assert the invariant instead: every model in the family resolves to a non-zero price, and the day total equals the sum of the per-model breakdown. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Two items surfaced while reviewing the open PRs: - Straude already ingests Gemini, Qwen, Kimi, Copilot and the rest of ccusage's sources, because the collector runs unscoped `ccusage daily` and nothing downstream filters on agent name. PRs #77 and #22 hand-wrote parsers for capability we already have. What's missing is prettification, model colours, and copy that tells users. - `calculate_user_streak` is SECURITY DEFINER with EXECUTE granted to anon, so any caller can read any user's streak by id, private profiles included. Long-standing, not from an open PR. Also corrects the ccusage CHANGELOG entry, which claimed the GPT-5.6 fixture pins a $1.917 total; it now asserts the pricing invariant instead. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThe GPT-5.6 pricing test now checks model coverage, positive resolved pricing, and cost consistency without fixed dollar values. The changelog records this behavior. The roadmap adds multi-agent CLI support and a security item about streak RPC grants. ChangesGPT-5.6 pricing validation
Multi-agent CLI roadmap
Streak RPC security roadmap
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
docs/ROADMAP.md (1)
40-40: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDefine the remaining documentation deliverable.
packages/cli/README.md, Lines 15-20, already lists Kimi, Qwen, Copilot CLI, and Gemini CLI. State whether this item adds landing-page copy, a dedicated supported-agents section, or an explicit support guarantee. Link to the existing README section. This gives future work a clear, non-duplicative acceptance target.As per coding guidelines,
docs/ROADMAP.mdmust include feature requests, ideas, and improvements with sufficient context for future pickup.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/ROADMAP.md` at line 40, Clarify the roadmap item about supported-agent messaging by specifying the exact documentation deliverable, such as landing-page copy or a linked supported-agents section. Reference the existing supported-agents section in packages/cli/README.md and define a non-duplicative acceptance target rather than leaving the scope as general README and landing-page copy.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@docs/ROADMAP.md`:
- Line 40: Clarify the roadmap item about supported-agent messaging by
specifying the exact documentation deliverable, such as landing-page copy or a
linked supported-agents section. Reference the existing supported-agents section
in packages/cli/README.md and define a non-duplicative acceptance target rather
than leaving the scope as general README and landing-page copy.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: b9a7675a-4924-4d96-a7b7-718a1d92cc44
📒 Files selected for processing (3)
docs/CHANGELOG.mddocs/ROADMAP.mdpackages/cli/__tests__/ccusage-pricing.integration.test.ts
Why this is urgent
CI is red on every open PR — #143, #145, #146 and #149 — for one shared reason that none of them caused:
packages/cli/__tests__/ccusage-pricing.integration.test.tspins hardcoded dollar amounts for the GPT-5.6 family. Those rates are owned by LiteLLM upstream and are fetched live by the bundled ccusage binary. LiteLLM movedgpt-5.6-terrafrom$0.355to$0.284, and the whole repo'sTest (cli)job went red on the next run. 202 of 203 CLI tests pass; this one assertion is the blocker.#149 is the clearest proof it isn't the PRs: it changes
.gitignoreand deletes committed artifacts, touches no CLI code at all, and still fails.What changed
The test now asserts the invariant we actually own instead of the number upstream owns:
What it no longer does is fail when a vendor reprices a model overnight.
docs/CHANGELOG.mdhad the old$1.917figure written into the ccusage entry as a durable claim; corrected to describe the invariant.Also in here
docs/ROADMAP.mdpicks up two findings from reviewing the open PRs:ccusage daily --json,CcusageAgentisstring, and/api/usage/submithas no agent allowlist. feat: add Gemini CLI usage tracking via gemistat #77 and feat: add Gemini, Qwen Code, and Mistral Vibe providers #22 both hand-wrote parsers for capability that already ships. What's missing isprettifyModelcases, model colours, and copy telling users.calculate_user_streakisSECURITY DEFINERwithEXECUTEgranted toanon, so anyone can read any user's streak by id, private profiles included. Long-standing, from20260430172022, not from an open PR.Validation
bun test __tests__/ccusage-pricing.integration.test.tsinpackages/cli— 1 pass, 13 assertions, against the real bundled binary and live pricing.Worth merging before the others so their CI can go green.
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Documentation