fix(cursor): show Enterprise spend against the personal spend limit in Usage → Limits #41535
Closedflytam(GitHub profile, opens in a new tab)wants to merge 4 commits into
main fromrefs/pull/41535/headopened View on GitHubflytam(GitHub profile, opens in a new tab) linked this to fix #28477
tanstack-source added labelsbug
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
juliusmarminge added labelstakeover:in-progress
- @@ -37,3 +37,6 @@3737 label: msg("Other Models"),3838 description: msg("Usage allowance for third-party models such as Claude, GPT, and Gemini."),3939 },40+ spendLimit: {41+ label: msg("Spend"),42+ description: msg("Spending this billing cycle against your Cursor spend limit."),
Pushedee9cacb
- @@ -1307,3 +1307,5 @@13071307 "23eed587f1bef1a6": "Grok, Composer und Auto nutzen dieses Kontingent.",13081308 "d2becdc27390c92c": "Andere Modelle",13091309 "3abbefc7732635ff": "Nutzungskontingent für Modelle von Drittanbietern wie Claude, GPT und Gemini.",1310+ "c7566c908e14be09": "Spend",1311+ "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.",@@ -1307,3 +1307,5 @@13071307 "23eed587f1bef1a6": "Grok, Composer och Auto använder den här kvoten.",13081308 "d2becdc27390c92c": "Andra modeller",13091309 "3abbefc7732635ff": "Användningskvot för tredjepartsmodeller som Claude, GPT och Gemini.",1310+ "c7566c908e14be09": "Spend",1311+ "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.",@@ -1307,3 +1307,5 @@13071307 "23eed587f1bef1a6": "Grok, Composer e Auto usam esta cota.",13081308 "d2becdc27390c92c": "Outros modelos",13091309 "3abbefc7732635ff": "Cota de uso para modelos de terceiros, como Claude, GPT e Gemini.",1310+ "c7566c908e14be09": "Spend",1311+ "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.",@@ -1307,3 +1307,5 @@13071307 "23eed587f1bef1a6": "Grok, Composer и Auto расходуют этот лимит.",13081308 "d2becdc27390c92c": "Другие модели",13091309 "3abbefc7732635ff": "Лимит использования сторонних моделей, таких как Claude, GPT и Gemini.",1310+ "c7566c908e14be09": "Spend",1311+ "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.",@@ -1307,3 +1307,5 @@13071307 "23eed587f1bef1a6": "Grok, Composer och Auto använder den här kvoten.",13081308 "d2becdc27390c92c": "Andra modeller",13091309 "3abbefc7732635ff": "Användningskvot för tredjepartsmodeller som Claude, GPT och Gemini.",1310+ "c7566c908e14be09": "Spend",1311+ "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.",@@ -1307,3 +1307,5 @@13071307 "23eed587f1bef1a6": "Grok、Composer 和 Auto 使用此额度。",13081308 "d2becdc27390c92c": "其他模型",13091309 "3abbefc7732635ff": "Claude、GPT 和 Gemini 等第三方模型的用量额度。",1310+ "c7566c908e14be09": "Spend",1311+ "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.",
juliusmarminge added labelstakeover:needs-julius
juliusmarminge removed labelstakeover:in-progress
github-actions[bot](GitHub profile, opens in a new tab) added labelsneeds-rebase
flytam(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
No actionable comments were generated in the recent review.
Walkthrough
Cursor usage limits now support a Spend window based on reported personal spend limits. The provider requests pooled usage and returns dashboard guidance when it cannot produce a window. Shared handling labels the Spend window and selects it when exhausted.
Changes: Cursor usage limits
packages/provider-cursor/src/server/usageLimits.ts,packages/provider-cursor/src/server/usageLimits.test.ts,docs/user/usage.mdpackages/shared/src/usageLimits.ts,packages/shared/src/usageLimits.test.ts,packages/shared/src/usageLimitsCopy.ts,apps/mobile/src/i18n/translations/*,apps/web/src/i18n/translations/*Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Medium
Merge Risk:
Minimal · up to
ee9caCursor Enterprise accounts can now show a personal Spend bar in Usage → Limits, and accounts with no personal limit get a dashboard link. The Spend labels appear to be translated in all locales. No blocking risk remains. The one gap is that the author did not check the rendered Limits page.
Pre-merge checks:
4
#28477requires that Cursor Enterprise accounts appear in Usage → Limits. Expected outcome: plan bars, or a visible notice with a link to Cursor's usage dashboard when Cursor reports no p…#28477or support its implementation:- provider-cursor usageLimits.ts: pooled-usage request, Spend mapping, plan-bar suppression, unsupported message and dashboard l…
Full details: Title check
Explanation
The title names the main change: Enterprise Cursor accounts now show personal spend against the spend limit in Usage → Limits. It matches the changeset, which adds a Spend bar from the personal spend pair, requests pooled usage, and adds a dashboard fallback. It uses the conventional commit form the template suggests.
Full details: Description check
Explanation
The description follows the template sections: Problem, Change, Scope, and Verification. It explains the root cause (the usage request lacked includePooledUsage) and lists the changes. It links issues
#28477and#28485and gives detailed verification with a live Enterprise probe and test counts. It states that the rendered Limits page was not checked and that screenshots are missing, which the template requires for UI-facing changes. The Problem section cites the bug in a clear way. Its agent-model line matches the template's closing instruction.Full details: Linked Issues check
Explanation
Linked issue
#28477requires that Cursor Enterprise accounts appear in Usage → Limits. Expected outcome: plan bars, or a visible notice with a link to Cursor's usage dashboard when Cursor reports no plan allowance.Code evidence at head (whole-PR merge base 3b08d97 to head ee9cacb):
includePooledUsage: true. This makes Cursor return the billing cycle andspendLimitUsagedata (per the PR description; the request change is in the summarized diff).overallLimit/overallUsed, elseindividualLimit/individualUsed) produces aspendLimitwindow computed from cents. String and numeric encodings are accepted.unsupportedwith a reason, a message directing the user to Cursor's dashboard, andexternalUsagepointing to the dashboard URL. This matches the issue's notice-and-link outcome.collectExternalUsageLinksadds a link row for authenticated providers withusageLimits.externalUsage, independent of the notice path. This supports the link appearing for the unsupported result.CURSOR_USAGE_WINDOWSincludes thespendLimitentry labeled 'Spend'.Unresolved uncertainty: the truncated read of packages/shared/src/usageLimits.ts did not show
limitsNotice. I could not confirm how anunsupportedresult with a message is classified incollectLimitAccounts. The link row is covered bycollectExternalUsageLinks. The rendered Limits page was not run, as the PR states. The live 68.757% value is author-reported and was not re-run in this review.The Spend bar is a valid alternative to plan bars for an account with a reported personal limit. The issue allows either outcome.
Full details: Out of Scope Changes check
Explanation
All summarized changes connect to
#28477or support its implementation:spendLimitexhaustion selection and the 'Spend' entry inCURSOR_USAGE_WINDOWS. Required for the new bar to be selected and labeled.No change was found that is unrelated to the Cursor limits path. The assessment uses the summarized changes. It did not read every diff hunk.
Finishing Touches
Generate unit tests (beta)
2d9bf099-a3e4-44c3-8dba-3e6f653f4145Reviewing files that changed from the base of the PR and between 93c97aba424471ceb35c66e3f0c154082079f56a and ee9cacb4e57c3d3c403ba6095b8d3d2aad3bf40b.
apps/mobile/src/i18n/translations/de.jsonapps/mobile/src/i18n/translations/es.jsonapps/mobile/src/i18n/translations/fr.jsonapps/mobile/src/i18n/translations/ja.jsonapps/mobile/src/i18n/translations/ko.jsonapps/mobile/src/i18n/translations/pt-BR.jsonapps/mobile/src/i18n/translations/ru.jsonapps/mobile/src/i18n/translations/sv.jsonapps/mobile/src/i18n/translations/zh.jsonapps/web/src/i18n/translations/de.jsonapps/web/src/i18n/translations/es.jsonapps/web/src/i18n/translations/fr.jsonapps/web/src/i18n/translations/ja.jsonapps/web/src/i18n/translations/ko.jsonapps/web/src/i18n/translations/pt-BR.jsonapps/web/src/i18n/translations/ru.jsonapps/web/src/i18n/translations/sv.jsonapps/web/src/i18n/translations/zh.jsonpackages/provider-cursor/src/server/usageLimits.test.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.