Repository navigation
Show one meter for spend-only Claude accounts - #882
Conversation
A Claude account whose only limit is a monthly spend cap has no session or weekly lane. A positive cap now becomes the primary meter: the used share of the cap, scored over the calendar month it resets in (midnight UTC on the 1st, inferred when Claude reports no reset). Quota accounts and uncapped balances keep their lanes and cost unchanged. Upstream steipete#4480, fixes steipete#4381.
The cost bridge carries folded_into_primary so the card can drop the duplicate bar. Pace test uses Codex as the unsupported provider now that Claude opts in.
When the primary meter already shows the cap, the Extra usage block keeps the spend, limit and balance as a caption and omits its bar. Other cost blocks are unchanged.
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 1
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
# Conflicts: # CHANGELOG.md
Summary
Port of upstream steipete#4480 (2e19c92, v0.75.0; fixes upstream steipete#4381). Claude accounts with no session/weekly/model lanes but a positive monthly spend cap now show one "Monthly" meter instead of an empty card.
claude/spend_window.rs(new): projects the used share of the cap intoprimary; reset is the observedcost.resets_at, else midnight UTC on the 1st of next month; window = the calendar month ending at the reset.apply_spend_only_extra_usage) and web (build_usage_and_cost) paths apply the projection only for spend-only accounts; quota accounts unchanged.CostSnapshot.folded_into_primary(+ bridgefoldedIntoPrimary): the card shows the cap as a caption (spend / limit, balance) without a second bar.Deviations: Windows keeps
RateWindow::no_active_session()and projects inside the Claude module (upstream madeprimaryoptional); label is the existing "Monthly" key; the CLI/usagespend-cap parser is not ported.Commands
cargo test --manifest-path rust/Cargo.toml(4503 lib pass after merging main)cargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml(721 pass)cargo clippyboth manifests--all-targets -- -D warnings,cargo fmt --allpnpm test(1259 pass),pnpm exec tsc --noEmit -p .,pnpm run buildUI proof
Not run: the
CODEXBAR_SEED_USAGE_JSONseed hook is Codex-only, so there is no synthetic Claude source to render a spend-only card. The caption change is covered bycardCost.test.ts. Upstream rendering was captured on the Mac rig (Claude-SpendOnly pack: "Extra usage 75% left", "Spend limit $12.50/$50.00").Summary by CodeRabbit