Repository navigation
Conversation
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
API/"Other models" can be more consumed than included Cursor models, so highest-used was the wrong summary. Co-authored-by: Cursor <[email protected]>
Type-aware oxlint rejected non-exhaustive Cursor failureKind switches, so those branches are plain ifs. Co-authored-by: Cursor <[email protected]>
Compact chip favored Cursor Models and hid higher Other models usage; render both bars so API spend is visible at a glance.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (22)
🚧 Files skipped from review as they are similar to previous changes (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThis change adds Cursor CLI authentication through Merge Risk: ⚪ Minimal · up to The compact Cursor display now matches its tooltip, and no merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 78.95% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 76 functions across 55 files. (1 skipped: 1 unsupported.)
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.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/renderer/src/components/status-bar/UsageRosterPanel.tsx (1)
57-59: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCentralize
isCursorUsageBucketwith the existingStatusBar.tsxclassifier to prevent the two allowlists from diverging. As per coding guidelines: “Extend or generalize it instead of building a parallel version.”Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1dbda1fc-2766-402c-bdc1-1f63db5c11dd
📒 Files selected for processing (46)
src/main/codex-accounts/service-reset-credit-test-fixtures.tssrc/main/rate-limits/cursor-auth.test.tssrc/main/rate-limits/cursor-auth.tssrc/main/rate-limits/cursor-fetcher.test.tssrc/main/rate-limits/cursor-fetcher.tssrc/main/rate-limits/rate-limit-service-test-harness.tssrc/main/rate-limits/service-account-target-selection.test.tssrc/main/rate-limits/service-antigravity-usage.test.tssrc/main/rate-limits/service-inactive-account-previews.test.tssrc/main/rate-limits/service-live-claude-usage.test.tssrc/main/rate-limits/service-minimax-usage.test.tssrc/main/rate-limits/service-refresh-orchestration.test.tssrc/main/rate-limits/service-window-activation.test.tssrc/main/rate-limits/service.tssrc/main/runtime/rpc/methods/client-ui-schemas.tssrc/main/runtime/rpc/methods/client-ui.test.tssrc/renderer/src/components/settings/AppearanceWindowSidebarSection.tsxsrc/renderer/src/components/settings/appearance-status-bar-cursor-toggle-search.tssrc/renderer/src/components/settings/appearance-status-bar-ports-toggle-search.tssrc/renderer/src/components/settings/appearance-status-bar-search.test.tssrc/renderer/src/components/settings/appearance-status-bar-search.tssrc/renderer/src/components/stats/GrokUsagePane.test.tsxsrc/renderer/src/components/status-bar/StatusBar.tsxsrc/renderer/src/components/status-bar/UsageRosterPanel.test.tsxsrc/renderer/src/components/status-bar/UsageRosterPanel.tsxsrc/renderer/src/components/status-bar/provider-segment-monthly-window.test.tsxsrc/renderer/src/components/status-bar/status-bar-agent-gating.test.tssrc/renderer/src/components/status-bar/status-bar-agent-gating.tssrc/renderer/src/components/status-bar/status-bar-provider-visibility.test.tssrc/renderer/src/components/status-bar/status-bar-provider-visibility.tssrc/renderer/src/components/status-bar/tooltip.test.tssrc/renderer/src/components/status-bar/tooltip.tsxsrc/renderer/src/components/status-bar/usage-error-copy.test.tssrc/renderer/src/components/status-bar/usage-error-copy.tssrc/renderer/src/components/status-bar/usage-provider-settings-target.test.tssrc/renderer/src/components/status-bar/usage-provider-settings-target.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/store/slices/rate-limits.tssrc/renderer/src/store/slices/ui-hydration-workspace-preferences.test.tssrc/renderer/src/store/slices/ui.tssrc/renderer/src/web/preload-api/web-rate-limits-api.tssrc/shared/persisted-ui-state-types.tssrc/shared/rate-limit-types.test.tssrc/shared/rate-limit-types.tssrc/shared/status-bar-defaults.tssrc/shared/ui-chrome-types.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Aborted refresh left `cursor-agent status` running up to 10s and blocked queued refreshes. Share Cursor bucket labels so producer and status-bar filters cannot diverge. Co-authored-by: Cursor <[email protected]>
CodeRabbit pre-merge check requires ≥80% JSDoc on functions touched by the diff. Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/renderer/src/components/status-bar/UsageRosterPanel.tsx (1)
165-170: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winUpdate the compact-mode tooltip.
This branch renders every Cursor bucket, but
UsageRosterPanel.compactTooltipstill says “only the tightest window.” Change the tooltip text to match the compact Cursor layout.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 7271ffc2-f5c8-4eef-850e-a08b22cb78f6
📒 Files selected for processing (9)
src/main/rate-limits/cursor-auth.test.tssrc/main/rate-limits/cursor-auth.tssrc/main/rate-limits/cursor-fetcher.tssrc/main/rate-limits/service-refresh-orchestration.test.tssrc/main/rate-limits/service.tssrc/renderer/src/components/status-bar/StatusBar.tsxsrc/renderer/src/components/status-bar/UsageRosterPanel.tsxsrc/shared/cursor-usage-buckets.tssrc/shared/rate-limit-types.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- src/renderer/src/components/status-bar/StatusBar.tsx
- src/shared/rate-limit-types.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
|
@coderabbitai review |
|
Upstream split three monoliths this branch had edited into modules;
re-applied the Cursor wiring onto the new files:
- rate-limits/service.ts -> service/{state,types,configuration,
result-policy,polling,full-cycle-preparation,full-cycle-application}
- status-bar/StatusBar.tsx -> use-status-bar-controller,
StatusBarProviderSegment, StatusBarVisibilityMenu
- store/slices/ui.ts -> ui/ui-slice-hydration-actions (defaults table)
Also: keep minimaxApiKeyConfigured alongside cursorAuthConfigured,
wait for Grok to settle in the slow-Cursor-auth test (cycle now spans
prepare/apply awaits), and catalog the cursorKeyword i18n string.
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Upstream added createEmptyRateLimitState(); add the Cursor fields to the factory and take its call sites in the store, web preload, and test fixtures. Follow the MiniMax fetcher move to rate-limits/minimax/ and keep the Cursor usage-error strings beside the new MiniMax expiry copy.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 1c5c388a-09c1-4658-9dc8-04078ac66a3d
📒 Files selected for processing (55)
src/main/codex-accounts/service-reset-credit-test-fixtures.tssrc/main/rate-limits/cursor-auth.test.tssrc/main/rate-limits/cursor-auth.tssrc/main/rate-limits/cursor-fetcher.test.tssrc/main/rate-limits/cursor-fetcher.tssrc/main/rate-limits/rate-limit-service-test-harness.tssrc/main/rate-limits/service-account-target-selection.test.tssrc/main/rate-limits/service-antigravity-usage.test.tssrc/main/rate-limits/service-inactive-account-previews.test.tssrc/main/rate-limits/service-live-claude-usage.test.tssrc/main/rate-limits/service-minimax-usage.test.tssrc/main/rate-limits/service-refresh-orchestration.test.tssrc/main/rate-limits/service-window-activation.test.tssrc/main/rate-limits/service/service-configuration.tssrc/main/rate-limits/service/service-full-cycle-application.tssrc/main/rate-limits/service/service-full-cycle-preparation.tssrc/main/rate-limits/service/service-polling.tssrc/main/rate-limits/service/service-result-policy.tssrc/main/rate-limits/service/service-state.tssrc/main/rate-limits/service/service-types.tssrc/main/runtime/rpc/methods/client-ui-schemas.tssrc/main/runtime/rpc/methods/client-ui.test.tssrc/renderer/src/components/settings/AppearanceWindowSidebarSection.tsxsrc/renderer/src/components/settings/appearance-status-bar-cursor-toggle-search.tssrc/renderer/src/components/settings/appearance-status-bar-ports-toggle-search.tssrc/renderer/src/components/settings/appearance-status-bar-search.test.tssrc/renderer/src/components/settings/appearance-status-bar-search.tssrc/renderer/src/components/stats/GrokUsagePane.test.tsxsrc/renderer/src/components/status-bar/StatusBarProviderSegment.tsxsrc/renderer/src/components/status-bar/StatusBarVisibilityMenu.tsxsrc/renderer/src/components/status-bar/UsageRosterPanel.test.tsxsrc/renderer/src/components/status-bar/UsageRosterPanel.tsxsrc/renderer/src/components/status-bar/provider-segment-monthly-window.test.tsxsrc/renderer/src/components/status-bar/status-bar-agent-gating.test.tssrc/renderer/src/components/status-bar/status-bar-agent-gating.tssrc/renderer/src/components/status-bar/status-bar-provider-visibility.test.tssrc/renderer/src/components/status-bar/status-bar-provider-visibility.tssrc/renderer/src/components/status-bar/tooltip.test.tssrc/renderer/src/components/status-bar/tooltip.tsxsrc/renderer/src/components/status-bar/usage-error-copy.test.tssrc/renderer/src/components/status-bar/usage-error-copy.tssrc/renderer/src/components/status-bar/usage-provider-settings-target.test.tssrc/renderer/src/components/status-bar/usage-provider-settings-target.tssrc/renderer/src/components/status-bar/use-status-bar-controller.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/store/slices/rate-limits.tssrc/renderer/src/store/slices/ui-hydration-workspace-preferences.test.tssrc/renderer/src/store/slices/ui/ui-slice-hydration-actions.tssrc/renderer/src/web/preload-api/web-rate-limits-api.tssrc/shared/cursor-usage-buckets.tssrc/shared/persisted-ui-state-types.tssrc/shared/rate-limit-types.test.tssrc/shared/rate-limit-types.tssrc/shared/status-bar-defaults.tssrc/shared/ui-chrome-types.ts
🚧 Files skipped from review as they are similar to previous changes (43)
- src/main/rate-limits/rate-limit-service-test-harness.ts
- src/main/rate-limits/cursor-fetcher.test.ts
- src/main/rate-limits/service-window-activation.test.ts
- src/shared/cursor-usage-buckets.ts
- src/main/runtime/rpc/methods/client-ui-schemas.ts
- src/renderer/src/components/status-bar/usage-provider-settings-target.test.ts
- src/renderer/src/components/stats/GrokUsagePane.test.tsx
- src/main/rate-limits/service-account-target-selection.test.ts
- src/main/rate-limits/service-live-claude-usage.test.ts
- src/main/rate-limits/service-minimax-usage.test.ts
- src/renderer/src/store/slices/rate-limits.ts
- src/renderer/src/components/status-bar/tooltip.test.ts
- src/shared/status-bar-defaults.ts
- src/renderer/src/components/settings/appearance-status-bar-ports-toggle-search.ts
- src/renderer/src/components/settings/AppearanceWindowSidebarSection.tsx
- src/renderer/src/components/status-bar/usage-provider-settings-target.ts
- src/shared/ui-chrome-types.ts
- src/shared/rate-limit-types.test.ts
- src/renderer/src/web/preload-api/web-rate-limits-api.ts
- src/renderer/src/components/status-bar/status-bar-agent-gating.test.ts
- src/main/rate-limits/service-inactive-account-previews.test.ts
- src/renderer/src/components/status-bar/tooltip.tsx
- src/shared/persisted-ui-state-types.ts
- src/main/codex-accounts/service-reset-credit-test-fixtures.ts
- src/main/rate-limits/service-antigravity-usage.test.ts
- src/renderer/src/components/status-bar/status-bar-agent-gating.ts
- src/renderer/src/components/settings/appearance-status-bar-search.test.ts
- src/main/runtime/rpc/methods/client-ui.test.ts
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/components/settings/appearance-status-bar-cursor-toggle-search.ts
- src/renderer/src/components/settings/appearance-status-bar-search.ts
- src/renderer/src/components/status-bar/UsageRosterPanel.test.tsx
- src/renderer/src/components/status-bar/status-bar-provider-visibility.ts
- src/renderer/src/components/status-bar/provider-segment-monthly-window.test.tsx
- src/shared/rate-limit-types.ts
- src/main/rate-limits/cursor-auth.test.ts
- src/main/rate-limits/cursor-auth.ts
- src/renderer/src/components/status-bar/usage-error-copy.test.ts
- src/renderer/src/components/status-bar/UsageRosterPanel.tsx
- src/renderer/src/components/status-bar/status-bar-provider-visibility.test.ts
- src/renderer/src/store/slices/ui-hydration-workspace-preferences.test.ts
- src/main/rate-limits/cursor-fetcher.ts
- src/main/rate-limits/service-refresh-orchestration.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Drop the Cursor IDE state.vscdb token fallback. The status-bar chip is CLI-gated (hidden unless cursor-agent is on PATH), so an IDE-only token could configure auth for a chip the user can never see. The CLI path also never worked: `cursor-agent status --format json` only reports `hasAccessToken`, never the token, so it always resolved to `missing` and the IDE db was the only source that ever produced a chip. Read the CLI's own session file instead, resolving the path the way the CLI does: ~/.cursor/auth.json (darwin), %APPDATA%\Cursor\auth.json (win32), $XDG_CONFIG_HOME/cursor/auth.json (Linux). No process spawn, so the abort-signal plumbing on the auth read is gone; a token-less file maps to `missing` (signed out) and filesystem errors are sanitized so the auth path never reaches the renderer. Copy now points at `cursor-agent login`. Also list 'cursor' in the mobile ProviderRateLimitsSchema enum for parity with the other status-bar providers.
Check `signal.aborted` before assigning the flag so a cycle whose result is discarded cannot flip the durable Cursor auth signal. Addresses CodeRabbit review on service-full-cycle-preparation.ts.
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Heads up — I've opened #22633, which brings Cursor usage tracking together from this PR and the other open attempts (#8669, #11780, #13837, #16815, #18119, #20469, #21833). You're credited as a co-author on the commit; your work is in there. The one thing I changed structurally: none of the open PRs read the macOS Keychain, and that's where Could you try it on your account and tell me if the numbers are right? There's an installable build here: macOS is signed and notarized, so it installs through Orca's updater. Windows is unsigned — grab What I'd love checked, since I couldn't: the live numbers on a working paid plan. The only Cursor account on this machine has an expired token, so I verified the credential discovery and every error path end-to-end, but never saw real percentages render. If the pools (Cursor Models / Other Models / On-demand) and the plan total match what cursor.com/dashboard shows you, that's the confirmation I'm missing. If they don't, tell me what you see versus the dashboard and I'll fix it. Also useful if you're on a plan shape I couldn't test: unlimited/Ultra, on-demand enabled, teams, or the older request-quota billing. |
|
Update: new build, please use this one instead — The build I linked earlier has been deleted, because review found three bugs in it that would have hit you directly:
Same ask as before, and the same one thing I still can't verify myself: do the numbers match your cursor.com dashboard? Install instructions are unchanged — macOS through Orca's updater, Windows via |
ELI5
The status bar can now show how much of your Cursor monthly plan you have used, the same way it already shows Grok. It reads the login that
cursor-agent loginsaved on this machine. No extra Orca Cursor login, and no Stats or Accounts pane.What Changed
cursor+cursorAuthConfigured).cursor-agent's ownauth.json(~/.cursor/auth.jsonon macOS,%APPDATA%\Cursor\auth.jsonon Windows,$XDG_CONFIG_HOME/cursor/auth.jsonon Linux). No process spawn and no Cursor IDEstate.vscdbread.GetCurrentPeriodUsageand mapplanUsage.totalPercentUsedonto the existing monthly window; optional Auto/API percents become named buckets.Out of scope on purpose: Stats usage pane, Accounts pane, token refresh/rotation, SSH/WSL remote token reads.
Why
Cursor is a first-class agent in Orca but had no live quota chip, so you had to leave the app to check cursor.com/dashboard/spending. This follows the Grok path: local session, monthly %, existing status-bar machinery.
Linked Issue
Related to #15516 (status-bar portion only; this PR does not add the Accounts pane that ticket also asks for).
Overlaps existing open PRs #13837 and #8669. This one is narrower: status bar only,
cursor-agentauth only, compact chip shows Cursor Models.Visual Proof
Detailed view:
Compact view:
Testing
Local checks:
pnpm lintpassedpnpm typecheckpassedpnpm buildpassedpnpm testwas started after rebase; it hung on unrelated renderer timeouts (dashboard, editor, terminal). Cursor files above were green. CI on this PR should be the source of truth for the full suite.Manual: macOS, Cursor signed in via
cursor-agent login. Compact chip showed Cursor Models instead of Other models.Not tested here: Windows, Linux, SSH remotes (expected: degrade to not available; tokens are local-host only, same as Grok).
AI Disclosure
Implemented with Cursor (Grok 4.6).
Review
AI review report
auth.jsonpath mirrors cursor-agent's own resolution viapath.join: Darwin~/.cursor/, Windows%APPDATA%\Cursor\(fallback~/AppData/Roaming), Linux$XDG_CONFIG_HOME/cursor/or~/.config/cursor/. Unix-seconds billing timestamps reuse the Claude seconds/ms split.cursor-agentsession. No SSH or WSL token probe. If Cursor is only signed in on a remote host, the chip stays unavailable. Folder workspaces are unaffected (this is host-local usage, not worktree-scoped).'cursor'checks. Other providers unchanged. Not added toINDIVIDUALLY_REFRESHABLE_PROVIDERS(no Stats refresh button).fetchAllpoller; the Cursor auth-file read is folded into the Cursor promise so it never stalls Claude/Codex/Grok.cursor-agent loginagain; Orca does not refresh/rotate Cursor credentials. Dashboard POST usesAuthorization: Beareronly.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Made with Cursor