Skip to content

fix(cursor): restore Enterprise included and on-demand usage - #986

Merged
robinebers merged 2 commits into
robinebers:mainfrom
iicdii:fix/cursor-enterprise-usage
Jul 13, 2026
Merged

fix(cursor): restore Enterprise included and on-demand usage#986
robinebers merged 2 commits into
robinebers:mainfrom
iicdii:fix/cursor-enterprise-usage

Conversation

@iicdii

@iicdii iicdii commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Fixes #829

TL;DR

Restore Cursor Enterprise usage in the default OpenUsage card and show the account's included-request allowance and on-demand spend together.

What was happening

  • Since the native v0.7 rewrite, the strict Enterprise/team fallback returned only the optional Requests line.
  • cursor.requests is disabled by default, so the enabled Total/Auto/API widgets all rendered No data even when /api/usage had a valid request allowance.
  • That early return also skipped Cursor's on-demand summary and usage-history rows.
  • Live Enterprise validation found a shape not covered by fix(cursor): fall back to /api/usage-summary for enterprise/team accounts #846: /api/usage carries the included request allowance, while /api/usage-summary carries structured percentages and the user-scoped individualUsage.onDemand. The same response may have neither teamUsage.pooled nor individualUsage.overall.

What this changes

  • Fetch and combine /api/usage and /api/usage-summary on the existing strict Enterprise/team fallback path.
  • Feed the included request allowance into the default Total Usage row and preserve the optional Requests copy for existing custom layouts.
  • Prefer user-scoped on-demand usage; fall back to the team bucket only when the individual bucket is unusable.
  • Preserve Auto/API percentages, exact billing-cycle bounds, pooled/overall response variants, and usage-history rows.
  • Derive /v1/limits progress units from the live metric format, so Cursor totalUsage is correctly exported as percent, requests, or usd depending on the plan.
  • Add credential-free diagnostics for structurally unusable optional payloads.

Heads-up

  • All committed fixtures use synthetic values. No account identifiers, tokens, or organization dashboard data are included.
  • The narrow live screenshot below was added at the account owner's request and contains only the rendered Cursor card.
  • No widget IDs or default-layout membership changed; this is a data-path fix, not a layout change.
  • This PR incorporates the older pooled/overall shape from fix(cursor): fall back to /api/usage-summary for enterprise/team accounts #846 and adds live validation for the request-allowance + individual-on-demand shape.

Live validation

  • macOS 26 CI builds the app and runs the full Swift test suite against the functional source commit.
  • A current-head packaging run repeated the full suite, archived the development app with symlinks preserved, and produced the exact side-by-side bundle used below.
  • A CI-built development app was launched against a live Cursor Enterprise session. One fresh snapshot populated the existing Total Usage, Auto Usage, API Usage, On-Demand, Usage Trend, and 30-day history fields.
  • The same live snapshot was checked through /v1/limits/cursor: Total Usage exported a request-count unit, Auto/API exported percent units, On-Demand exported USD, and the billing-cycle boundary matched the dashboard.
  • The development build remains installed side-by-side with the signed release app, so the signed release bundle was not overwritten.

Tests

  • Combined request + individual on-demand mapper fixture
  • Request-only fallback compatibility
  • Pooled/overall and team on-demand fallbacks
  • Zero-reported-spend vs. positive limit - remaining regression
  • Provider integration, CSV history preservation, default-widget resolution, and exact endpoint contract
  • Dynamic /v1/limits unit regression
  • Swift 6.2 parser pass locally; full build/test pass in macOS 26 CI

Screenshot

The default Total Usage row adopts request units for request-based Enterprise accounts; Extra Usage is the on-demand USD cap/spend.

Cursor Enterprise included-request and on-demand usage

@robinebers robinebers added needs-approved-issue External PR needs an open issue with status:approved needs-screenshots Visual change needs before and after screenshots labels Jul 13, 2026 — with Cursor

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! OpenUsage reviews external PRs only when they implement an issue a maintainer has already approved with the approved label. Please open an issue, wait for approval, then reopen this (or open a focused PR) linking it with Fixes #<issue>. Happy to take a look once it's linked to an approved issue.

This PR also changes user-visible behavior, but the description has no screenshots. Visual changes need before/after screenshots in the description so we can review them. Please add them and reopen (or push an update). If this isn't a visual change, note that in the Screenshots section.

Please close this PR for now and reopen once both are addressed.

Powered by Cursor Automations

Open in Web View Automation 

Sent by Cursor Automation: OpenUsage PR Gatekeeper

@iicdii
iicdii force-pushed the fix/cursor-enterprise-usage branch from 9b6cb0a to dd00c6c Compare July 13, 2026 07:26
@robinebers robinebers removed needs-approved-issue External PR needs an open issue with status:approved needs-screenshots Visual change needs before and after screenshots labels Jul 13, 2026
@robinebers robinebers added the gate-passed Passed the automated PR gatekeeper checks (gatekeeper skips it on later runs) label Jul 13, 2026 — with Cursor

@robinebers robinebers left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — thank you!

@robinebers
robinebers merged commit 09ef91c into robinebers:main Jul 13, 2026
1 check passed
cbrown350 pushed a commit to cbrown350/openusage that referenced this pull request Jul 25, 2026
…sage

fix(cursor): restore Enterprise included and on-demand usage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci docs gate-passed Passed the automated PR gatekeeper checks (gatekeeper skips it on later runs) provider tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enterprise/team accounts fail: usage-summary endpoint not used as fallback

2 participants