Repository navigation
fix(dashboard): always show balances at $0 and hide disabled Extra Usage - #1557
Merged
Merged
Conversation
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: cadaaf62-af93-4fdb-892e-6ec70bb3fc6c) |
There was a problem hiding this comment.
No new issues found.
Reviewed changes Reviewed the full PR, including provider mapping, dashboard visibility, Priority classification, CLI export effects, regression tests, and documentation.
- Extra Usage visibility. Removes synthetic zero rows for disabled usage while retaining enabled zero-spend rows and positive Grok caps.
- Zero balances. Keeps reported zero Codex and Cursor balances visible; Codex's disabled-credit handling matches OpenAI's own finite-credit display logic. Newly visible zero balances follow the existing Used Up rule.
- Regression coverage. Tests cover enabled/disabled usage and reported zero balances across providers; documentation reflects the new behavior.
- Validation. All changed Swift files passed syntax parsing, and GitHub's Build and Test check passed. Full macOS tests were not rerun locally on this Linux runner.
gpt-6-astra | 𝕏
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

TL;DR
Balances now always show, even at $0. Extra Usage hides while the provider has it off and shows while it's on, even at $0 used or $0 left. This replaces #1555's "disabled Extra Usage reads $0 spent".
What was happening
$0 spent/0whenever nothing was reported, so a disabled Extra Usage showed as a zero row.used > 0 == false).Disabledrow when pay-as-you-go was off.What this changes
Each provider now decides enabled or disabled from its own API fields:
extra_usage.is_enabled$0 spent, or a $0 bar with a monthly limitcredits.has_credits(headerx-codex-credits-has-creditsas fallback)$0spendLimitUsage.individualLimit/pooledLimit(no flag, so a missing or $0 limit = off);usage-summaryonDemand.enabledpremium_interactions.overage_permitted0config.onDemandCap.val(no flag, proto3 omits 0, so missing or $0 cap = off)Disabledrow)planStatus.overageBalanceMicros(no flag)$0 leftwhen reportedpurchased.balance_usd(every plan can buy credits, no flag)$0 left/creditstotal_credits − total_usage$0 leftcredit-grantsread succeeded (hasCreditGrants,totalCents) plus Stripe balance$0 leftWidgetDescriptor.showingWhenUnreportedand its three callers.unreportedValuesstays, used only by time-range rows, exactly as fix(dashboard): always show time-range rows at 0 and disabled Extra Usage as no data #1555 made them.DashboardLine.isVisible.Where I looked the fields up (read):
codex-rs/tui/src/status/rate_limits.rs:121-126("has_credits: Whether credits tracking is enabled for the account"), andcredit_status_rowreturns no row when!has_credits(:401).crates/codegen/xai-grok-pager/src/app/effects/helpers.rs:1608-1610,pay_as_you_go = on_demand_val > 0.internal/cloud/cloud.go:100).Heads-up
emptyBalancerule). New entrants: ChatGPT credits when credits are on at 0, and Cursor Credits at$0 left, which now shows for every Cursor account with no credits. OpenRouter, Devin, and Ollama $0 balances already listed there. Claude/Cursor Extra Usage on at $0 is not a balance, so it doesn't enter Priority.$0 left), in its existing place after Requests. Robin, please confirm you want that default.overageBalanceMicrosis either "$0" or "no extra usage". I keep it hidden; a reported"0"shows$0 left.has_credits: falseno longer exports acredits: 0resource; Grok with no cap no longer has a pay-as-you-go line.Tests
On the Mac mini (macOS 15.7.7),
nice -n 10,script/test_quiet.sh --filter, one run at a time:ZeroBalanceAndExtraUsageTestsandCodexUsageClientAndMapperTests(Claude, Cursor, Copilot, Grok, ChatGPT off still shown; Claude/ChatGPT on at $0 hidden; Cursor Credits $0 hidden). The OpenRouter, Ollama, and Devin zero-balance asserts pass on main too; they guard the rule.Screenshots
Rendered offscreen on the Mac mini from the same fixtures, before (main) and after.
Claude, Extra Usage off: hidden (before left, after right)
Claude, Extra Usage on at $0: shown (before left, after right)
ChatGPT, credits off: hidden (unchanged) (before left, after right)
ChatGPT, credits on at $0: shown (before left, after right)
Ollama, purchased credits at $0: shown (unchanged) (before left, after right)
Devin, extra-usage balance at $0: shown (unchanged) (before left, after right)
OpenRouter, Balance at $0: shown (unchanged) (before left, after right)
Grok, pay-as-you-go off: Disabled row hidden (before left, after right)
Cursor, on-demand off and no credits: Extra Usage hidden, Credits $0 left shown (before left, after right)
Note
Medium Risk
Touches many provider mappers and dashboard visibility rules, which changes what users and CLI exports see for credits and Extra Usage without altering auth or billing APIs.
Overview
Replaces the prior behavior where disabled Extra Usage rows still appeared as $0 spent (via
showingWhenUnreported). Each provider now omits or emits Extra Usage from its mapper using that API’s own on/off signals—Claudeis_enabled, ChatGPThas_credits, Copilotoverage_permitted, Grok only whenonDemandCap > 0, and similar—so enabled-at-zero still shows (bar or $0 spent) while disabled is hidden (including Grok’s old Disabled badge).Balances (ChatGPT credits, Cursor Credits, OpenRouter, etc.) stay visible at $0 left by dropping the dashboard filter that hid zero ChatGPT credits and adjusting Codex/Cursor credit parsing.
WidgetDescriptor.showingWhenUnreportedis removed for Extra Usage; time ranges still default to zero when unreported.Docs, CHANGELOG, and tests (
ZeroBalanceAndExtraUsageTests, updated Codex tests) reflect the new rules.Reviewed by Cursor Bugbot for commit 48f6986. Bugbot is set up for automated code reviews on this repo. Configure here.