From 0c1b5a04f01a12a54dfb49d31624af7cd347a898 Mon Sep 17 00:00:00 2001 From: flytam Date: Tue, 24 Nov 2026 00:20:02 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix(cursor):=20show=20Enterprise=20spend=20?= =?UTF-8?q?against=20the=20personal=20spend=20limit=20in=20Usage=20?= =?UTF-8?q?=E2=86=92=20Limits?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cursor only reports a spend limit for team and enterprise accounts when the usage request asks for pooled usage. Without it the response carries no plan percentages at all, so the account renders no limits and disappears from the Limits view. Ask for pooled usage, map the personal spend pair (overall, else individual) from `spendLimitUsage` into a Spend bar, and keep the dashboard link as the fallback when Cursor reports no personal limit. Based on #28485, with live Enterprise verification and the billing-cycle length on the Spend bar so it reports pace like the plan bars do. --- docs/user/usage.md | 4 +- .../src/server/usageLimits.test.ts | 180 +++++++++++++++++- .../provider-cursor/src/server/usageLimits.ts | 77 ++++++-- packages/shared/src/usageLimits.test.ts | 1 + packages/shared/src/usageLimits.ts | 7 + packages/shared/src/usageLimitsCopy.ts | 4 + 6 files changed, 253 insertions(+), 20 deletions(-) diff --git a/docs/user/usage.md b/docs/user/usage.md index 43f4c94a19328..afabba3ee7f56 100644 --- a/docs/user/usage.md +++ b/docs/user/usage.md @@ -166,7 +166,9 @@ refresh provider status. Cursor reports its monthly allowance, including separate Auto and API usage, for `CURSOR_AUTH_TOKEN` when it is set, otherwise for the account you signed in with in T3 or set as `CURSOR_API_KEY`. Sign-in and API keys report limits only with Cursor's default API endpoint. If you configure a custom -Cursor endpoint, use an explicit `CURSOR_AUTH_TOKEN` for limits. +Cursor endpoint, use an explicit `CURSOR_AUTH_TOKEN` for limits. Accounts without a monthly +allowance, such as Enterprise, show a **Spend** bar for this billing cycle against your personal +spend limit. If Cursor reports no personal limit, Usage links to Cursor's usage dashboard instead. Grok reports the remaining subscription allowance and reset time for its current billing period after signing in with `grok login`. Explicit `XAI_API_KEY` connections and custom authentication diff --git a/packages/provider-cursor/src/server/usageLimits.test.ts b/packages/provider-cursor/src/server/usageLimits.test.ts index e969106812e6e..670754812447c 100644 --- a/packages/provider-cursor/src/server/usageLimits.test.ts +++ b/packages/provider-cursor/src/server/usageLimits.test.ts @@ -7,7 +7,7 @@ import { cursorUsageResponseToLimits, readCursorUsageLimits } from "./usageLimit describe("Cursor usage limits", () => { const checkedAt = "2026-09-16T00:00:00.000Z"; - it("uses the advertised percentages and billing-cycle reset", () => { + it("uses the advertised percentages and reset, or Spend when no allowance is included", () => { const limits = cursorUsageResponseToLimits( { billingCycleEnd: "1789876386000", @@ -40,6 +40,100 @@ describe("Cursor usage limits", () => { }, ]), ); + const withSpendLimit = cursorUsageResponseToLimits( + { + billingCycleEnd: "1789876386000", + planUsage: { totalPercentUsed: 72.4, autoPercentUsed: 69.5, apiPercentUsed: 100 }, + spendLimitUsage: { individualLimit: 5000, individualUsed: 100 }, + }, + checkedAt, + ); + expect(withSpendLimit.windows).toEqual(limits.windows); + const zeroPercents = { totalPercentUsed: 0, autoPercentUsed: 0, apiPercentUsed: 0 }; + const zeroPlanWindows = [ + { id: "apiPercentUsed", kind: "monthly", label: "Other Models", usedPercent: 0 }, + { id: "autoPercentUsed", kind: "monthly", label: "Cursor Models", usedPercent: 0 }, + { id: "totalPercentUsed", kind: "monthly", label: "Overall", usedPercent: 0 }, + ]; + const windowIds = (response: Parameters[0]) => + cursorUsageResponseToLimits(response, checkedAt).windows.map((window) => window.id); + // Usage already counted against a pooled plan keeps the plan bars. + expect( + windowIds({ + planUsage: { totalPercentUsed: 6, autoPercentUsed: 6, apiPercentUsed: 0 }, + spendLimitUsage: { pooledLimit: "3000000", overallLimit: 50000, overallUsed: 3211 }, + }), + ).toEqual(["apiPercentUsed", "autoPercentUsed", "totalPercentUsed"]); + // Fresh-cycle Pro: an included allowance, or no pool marker, keeps the plan bars. + for (const response of [ + { + planUsage: { ...zeroPercents, limit: "2000" }, + spendLimitUsage: { individualLimit: 5000, individualUsed: 0, pooledLimit: "3000000" }, + }, + { planUsage: zeroPercents, spendLimitUsage: { individualLimit: 5000 } }, + ]) { + expect(cursorUsageResponseToLimits(response, checkedAt).windows).toEqual(zeroPlanWindows); + } + expect( + windowIds({ + planUsage: { ...zeroPercents, limit: "0" }, + spendLimitUsage: { pooledLimit: "3000000", overallLimit: 50000, overallUsed: 3211 }, + }), + ).toEqual(["spendLimit"]); + // Without includePooledUsage, Cursor reports start = end = now instead of the cycle. + expect( + cursorUsageResponseToLimits( + { + billingCycleStart: "1793491200000", + billingCycleEnd: "1793491200000", + spendLimitUsage: { individualLimit: "2000", individualUsed: "500" }, + }, + checkedAt, + ).windows, + ).toEqual([{ id: "spendLimit", kind: "monthly", label: "Spend", usedPercent: 25 }]); + // Limit and used come from the same pair; protobuf JSON omits a zero used. + for (const [spendLimitUsage, usedPercent] of [ + [{ overallLimit: 50000, individualUsed: 3211 }, 0], + [{ overallLimit: 0, individualLimit: "2000", individualUsed: "500" }, 25], + ] as const) { + expect( + cursorUsageResponseToLimits({ spendLimitUsage }, checkedAt).windows.map( + (window) => window.usedPercent, + ), + ).toEqual([usedPercent]); + } + }); + + it("maps a live Enterprise response to the personal spend limit", () => { + // Captured from a live Enterprise account on a token-based contract, 2026-11-23. + // The pooled team budget arrives as a string, the personal pair as numbers. + const enterpriseResponse = { + billingCycleStart: "1793491200000", + billingCycleEnd: "1796083200000", + planUsage: { totalPercentUsed: 0, autoPercentUsed: 0, apiPercentUsed: 0 }, + spendLimitUsage: { + totalSpend: 679881371, + pooledLimit: "1009395000", + pooledUsed: 679881371, + pooledRemaining: "329513629", + limitType: "team", + overallLimit: 100000, + overallUsed: 68757, + overallRemaining: 31243, + }, + }; + const limits = cursorUsageResponseToLimits(enterpriseResponse, checkedAt); + // $687.57 of a $1,000 personal limit; Cursor reports the same 69% for this response. + expect(limits.windows).toEqual([ + { + id: "spendLimit", + kind: "monthly", + label: "Spend", + usedPercent: 68.757, + resetsAt: "2026-12-01T00:00:00.000Z", + windowDurationMins: 43_200, + }, + ]); }); it("reports the billing-cycle length so pace can be computed", () => { @@ -54,7 +148,7 @@ describe("Cursor usage limits", () => { }); it("omits the cycle length when the start is missing or invalid", () => { - for (const billingCycleStart of [undefined, "", "0", "not-a-number", "1796637847072"]) { + for (const billingCycleStart of [undefined, "", "0", "not-a-number"]) { expect( cursorUsageResponseToLimits( { @@ -91,9 +185,33 @@ describe("Cursor usage limits", () => { }); it("does not invent unused allowance for absent buckets", () => { - expect(cursorUsageResponseToLimits({ planUsage: {} }, checkedAt).unavailable?.reason).toBe( - "unsupported", + const linkOnly = { + checkedAt, + windows: [], + unavailable: { + reason: "unsupported", + message: + "Cursor doesn't report a personal spend limit for this account. Open Cursor's dashboard with the same account to see its usage.", + }, + externalUsage: { label: "Cursor usage", url: "https://cursor.com/dashboard?tab=usage" }, + }; + expect(cursorUsageResponseToLimits({ planUsage: {} }, checkedAt)).toEqual(linkOnly); + // Real Enterprise (token-based contract) response: no planUsage at all. + expect(cursorUsageResponseToLimits({ billingCycleEnd: "1793495876373" }, checkedAt)).toEqual( + linkOnly, ); + // Enterprise seat with only the team pool: zeroed percentages and no personal limit. + expect( + cursorUsageResponseToLimits( + { + billingCycleStart: "1793491200000", + billingCycleEnd: "1796083200000", + planUsage: { totalPercentUsed: 0, autoPercentUsed: 0, apiPercentUsed: 0 }, + spendLimitUsage: { pooledLimit: "3000000" }, + }, + checkedAt, + ), + ).toEqual(linkOnly); expect( cursorUsageResponseToLimits({ planUsage: { totalPercentUsed: 0 } }, checkedAt).windows, ).toEqual([{ id: "totalPercentUsed", kind: "monthly", label: "Overall", usedPercent: 0 }]); @@ -102,6 +220,60 @@ describe("Cursor usage limits", () => { ).toEqual([{ id: "totalPercentUsed", kind: "monthly", label: "Overall", usedPercent: 100 }]); }); + it.effect( + "requests pooled usage and shows Enterprise spend against the personal spend limit", + () => + Effect.gen(function* () { + const limits = yield* readCursorUsageLimits( + { apiEndpoint: "" }, + { CURSOR_AUTH_TOKEN: "token" }, + ).pipe( + Effect.provideService( + HttpClient.HttpClient, + HttpClient.make((request) => { + expect( + request.body._tag === "Uint8Array" && new TextDecoder().decode(request.body.body), + ).toBe('{"includePooledUsage":true}'); + return Effect.succeed( + HttpClientResponse.fromWeb( + request, + Response.json({ + billingCycleStart: "1793491200000", + billingCycleEnd: "1796083200000", + displayThreshold: 50, + planUsage: { totalPercentUsed: 0, autoPercentUsed: 0, apiPercentUsed: 0 }, + spendLimitUsage: { + limitType: "team", + overallLimit: 50000, + overallUsed: 3211, + overallRemaining: 46789, + pooledLimit: "3000000", + pooledUsed: 0, + pooledRemaining: "3000000", + }, + displayMessage: "You've used 6% of your included usage", + }), + ), + ); + }), + ), + ); + expect(limits).toEqual({ + checkedAt: expect.any(String), + windows: [ + { + id: "spendLimit", + kind: "monthly", + label: "Spend", + usedPercent: 6.422, + resetsAt: "2026-12-01T00:00:00.000Z", + windowDurationMins: 43_200, + }, + ], + }); + }), + ); + it.effect("requires explicit credentials and accepts an auth token", () => Effect.gen(function* () { for (const token of [undefined, "explicit-token"]) { diff --git a/packages/provider-cursor/src/server/usageLimits.ts b/packages/provider-cursor/src/server/usageLimits.ts index 48ab708554206..5222a9a95f0c4 100644 --- a/packages/provider-cursor/src/server/usageLimits.ts +++ b/packages/provider-cursor/src/server/usageLimits.ts @@ -15,37 +15,69 @@ import { } from "@t3tools/provider-core/server/usageLimits"; import { DEFAULT_CURSOR_API_ENDPOINT, exchangeCursorApiKey } from "./apiKey.ts"; +const NO_LIMITS_MESSAGE = + "Cursor doesn't report a personal spend limit for this account. Open Cursor's dashboard with the same account to see its usage."; +const CursorInt64 = Schema.Union([Schema.String, Schema.Number]); const CursorUsageResponse = Schema.Struct({ - billingCycleStart: Schema.optional(Schema.Union([Schema.String, Schema.Number])), - billingCycleEnd: Schema.optional(Schema.Union([Schema.String, Schema.Number])), + billingCycleStart: Schema.optional(CursorInt64), + billingCycleEnd: Schema.optional(CursorInt64), planUsage: Schema.optional( Schema.Struct({ + limit: Schema.optional(CursorInt64), totalPercentUsed: Schema.optional(Schema.Number), autoPercentUsed: Schema.optional(Schema.Number), apiPercentUsed: Schema.optional(Schema.Number), }), ), + spendLimitUsage: Schema.optional( + Schema.Struct({ + overallLimit: Schema.optional(CursorInt64), + overallUsed: Schema.optional(CursorInt64), + individualLimit: Schema.optional(CursorInt64), + individualUsed: Schema.optional(CursorInt64), + pooledLimit: Schema.optional(CursorInt64), + }), + ), }); -/** Cursor's dashboard percentages include bonus usage; spend / limit does not. */ +function spendPair( + limit: typeof CursorInt64.Type | undefined, + used: typeof CursorInt64.Type | undefined, +) { + const cents = Number(limit); + return Number.isFinite(cents) && cents > 0 + ? { limit: cents, used: Number(used ?? 0) } + : undefined; +} + +/** Plan bars use Cursor's own percentages; the Spend bar is computed from cents. */ export function cursorUsageResponseToLimits( response: typeof CursorUsageResponse.Type, checkedAt: string, ) { - const reset = DateTime.make(Number(response.billingCycleEnd)); + const end = Number(response.billingCycleEnd); + const cycleStart = Number(response.billingCycleStart); + const reset = DateTime.make(end); + // Without includePooledUsage, Cursor reports start = end = now instead of the cycle. const resetsAt = - Number(response.billingCycleEnd) > 0 && Option.isSome(reset) + end > 0 && !(cycleStart >= end) && Option.isSome(reset) ? DateTime.formatIso(reset.value) : undefined; - const cycleStart = Number(response.billingCycleStart); + const { planUsage, spendLimitUsage: spend } = response; + // Enterprise sends a team pool and zeroed percentages without an included allowance. + const usageBased = + spend?.pooledLimit !== undefined && + !(Number(planUsage?.limit) > 0) && + !planUsage?.totalPercentUsed && + !planUsage?.autoPercentUsed && + !planUsage?.apiPercentUsed; const windowDurationMins = - resetsAt && cycleStart > 0 - ? Math.round((Number(response.billingCycleEnd) - cycleStart) / 60_000) - : 0; + resetsAt && cycleStart > 0 ? Math.round((end - cycleStart) / 60_000) : 0; const windows: ServerProviderUsageWindow[] = []; - if (response.planUsage) { + if (planUsage && !usageBased) { for (const { id, label } of CURSOR_USAGE_WINDOWS) { - const usedPercent = response.planUsage[id]; + if (id === "spendLimit") continue; + const usedPercent = planUsage[id]; if (usedPercent === undefined || !Number.isFinite(usedPercent)) continue; windows.push({ id, @@ -57,9 +89,24 @@ export function cursorUsageResponseToLimits( }); } } - return windows.length > 0 - ? makeUsageLimits({ checkedAt, windows }) - : makeUnavailableUsageLimits({ checkedAt, reason: "unsupported" }); + const personal = + spendPair(spend?.overallLimit, spend?.overallUsed) ?? + spendPair(spend?.individualLimit, spend?.individualUsed); + if (windows.length === 0 && personal && Number.isFinite(personal.used)) { + windows.push({ + id: "spendLimit", + kind: "monthly", + label: "Spend", + usedPercent: clampPercent((personal.used / personal.limit) * 100), + ...(resetsAt ? { resetsAt } : {}), + ...(windowDurationMins > 0 ? { windowDurationMins } : {}), + }); + } + if (windows.length > 0) return makeUsageLimits({ checkedAt, windows }); + return { + ...makeUnavailableUsageLimits({ checkedAt, reason: "unsupported", message: NO_LIMITS_MESSAGE }), + externalUsage: { label: "Cursor usage", url: "https://cursor.com/dashboard?tab=usage" }, + }; } export const readCursorUsageLimits = Effect.fn("readCursorUsageLimits")(function* ( @@ -94,7 +141,7 @@ export const readCursorUsageLimits = Effect.fn("readCursorUsageLimits")(function "connect-protocol-version": "1", "x-cursor-client-type": "cli", }), - HttpClientRequest.bodyJsonUnsafe({}), + HttpClientRequest.bodyJsonUnsafe({ includePooledUsage: true }), ), ); const body = yield* HttpClientResponse.schemaBodyJson(CursorUsageResponse)( diff --git a/packages/shared/src/usageLimits.test.ts b/packages/shared/src/usageLimits.test.ts index 0019c74e1d5cd..ac6e23bcec569 100644 --- a/packages/shared/src/usageLimits.test.ts +++ b/packages/shared/src/usageLimits.test.ts @@ -130,6 +130,7 @@ describe("new thread model fallback", () => { ["cursor", ["autoPercentUsed"], "claude-opus-5-5", false, undefined, undefined], ["cursor", ["autoPercentUsed"], "composer-2.5", false, undefined, undefined], ["cursor", ["autoPercentUsed", "apiPercentUsed"], "composer-2.5", true, undefined, undefined], + ["cursor", ["spendLimit"], "composer-2.5", true, undefined, undefined], ["antigravity", ["gemini-weekly"], "claude-opus-5-5", false, undefined, undefined], ["antigravity", ["3p-weekly"], "claude-opus-5-5", true, undefined, undefined], ["antigravity", ["gemini-weekly"], "antigravity-default", true, undefined, undefined], diff --git a/packages/shared/src/usageLimits.ts b/packages/shared/src/usageLimits.ts index 711f3637d0a9f..d25ebb4cce928 100644 --- a/packages/shared/src/usageLimits.ts +++ b/packages/shared/src/usageLimits.ts @@ -44,6 +44,8 @@ export function exhaustedUsageWindow( if (model === undefined) return exhausted[0]; switch (provider?.driver) { case "cursor": { + const spend = exhausted.find((window) => window.id === "spendLimit"); + if (spend) return spend; const api = exhausted.find((window) => window.id === "apiPercentUsed"); const auto = exhausted.find((window) => window.id === "autoPercentUsed"); return /^(auto|default|grok|composer)/.test(model) ? auto && api : api; @@ -144,6 +146,11 @@ export const CURSOR_USAGE_WINDOWS = [ label: "Other Models", description: "Usage allowance for third-party models such as Claude, GPT, and Gemini.", }, + { + id: "spendLimit", + label: "Spend", + description: "Spending this billing cycle against your Cursor spend limit.", + }, ] as const; export function cursorUsageWindowDetails(id: string, pool: LimitPool) { diff --git a/packages/shared/src/usageLimitsCopy.ts b/packages/shared/src/usageLimitsCopy.ts index 85f78e0f11f28..bfb6847738cce 100644 --- a/packages/shared/src/usageLimitsCopy.ts +++ b/packages/shared/src/usageLimitsCopy.ts @@ -37,6 +37,10 @@ const CURSOR_USAGE_WINDOW_COPY: Readonly< label: msg("Other Models"), description: msg("Usage allowance for third-party models such as Claude, GPT, and Gemini."), }, + spendLimit: { + label: msg("Spend"), + description: msg("Spending this billing cycle against your Cursor spend limit."), + }, }; /** @public */ From 93c97aba424471ceb35c66e3f0c154082079f56a Mon Sep 17 00:00:00 2001 From: flytam Date: Tue, 24 Nov 2026 00:32:41 +0800 Subject: [PATCH 2/3] fix(i18n): pass the provider name as a variable in the Spend description The i18n guide keeps provider names out of translatable strings: wrap the sentence around them and pass them as variables, the way the neighbouring external-usage copy already does. Add the new Spend strings to the web and mobile catalogs so the i18n check stays in sync with the source. --- apps/mobile/src/i18n/translations/de.json | 2 ++ apps/mobile/src/i18n/translations/en.json | 2 ++ apps/mobile/src/i18n/translations/es.json | 2 ++ apps/mobile/src/i18n/translations/fr.json | 2 ++ apps/mobile/src/i18n/translations/ja.json | 2 ++ apps/mobile/src/i18n/translations/ko.json | 2 ++ apps/mobile/src/i18n/translations/pt-BR.json | 2 ++ apps/mobile/src/i18n/translations/ru.json | 2 ++ apps/mobile/src/i18n/translations/sv.json | 2 ++ apps/mobile/src/i18n/translations/zh.json | 2 ++ apps/web/src/i18n/translations/de.json | 2 ++ apps/web/src/i18n/translations/en.json | 2 ++ apps/web/src/i18n/translations/es.json | 2 ++ apps/web/src/i18n/translations/fr.json | 2 ++ apps/web/src/i18n/translations/ja.json | 2 ++ apps/web/src/i18n/translations/ko.json | 2 ++ apps/web/src/i18n/translations/pt-BR.json | 2 ++ apps/web/src/i18n/translations/ru.json | 2 ++ apps/web/src/i18n/translations/sv.json | 2 ++ apps/web/src/i18n/translations/zh.json | 2 ++ packages/shared/src/usageLimitsCopy.ts | 4 +++- 21 files changed, 43 insertions(+), 1 deletion(-) diff --git a/apps/mobile/src/i18n/translations/de.json b/apps/mobile/src/i18n/translations/de.json index 1116dd8895c6e..377edecd8ef67 100644 --- a/apps/mobile/src/i18n/translations/de.json +++ b/apps/mobile/src/i18n/translations/de.json @@ -1307,6 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer und Auto nutzen dieses Kontingent.", "d2becdc27390c92c": "Andere Modelle", "3abbefc7732635ff": "Nutzungskontingent für Modelle von Drittanbietern wie Claude, GPT und Gemini.", + "c7566c908e14be09": "Spend", + "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", "7d72af75b2812d60": "{provider} auf {environment}", "bb34eaf6ddc55a72": "Dieses Konto hat keine Abonnementlimits.", "42a2622893a6bced": "Limits konnten nicht gelesen werden.", diff --git a/apps/mobile/src/i18n/translations/en.json b/apps/mobile/src/i18n/translations/en.json index d9c7d08df765b..6793b9f6c0cbe 100644 --- a/apps/mobile/src/i18n/translations/en.json +++ b/apps/mobile/src/i18n/translations/en.json @@ -1307,6 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer, and Auto use this allowance.", "d2becdc27390c92c": "Other Models", "3abbefc7732635ff": "Usage allowance for third-party models such as Claude, GPT, and Gemini.", + "c7566c908e14be09": "Spend", + "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", "7d72af75b2812d60": "{provider} on {environment}", "bb34eaf6ddc55a72": "This account has no subscription limits.", "42a2622893a6bced": "Could not read limits.", diff --git a/apps/mobile/src/i18n/translations/es.json b/apps/mobile/src/i18n/translations/es.json index 8ceac2b26a722..0416045873bc3 100644 --- a/apps/mobile/src/i18n/translations/es.json +++ b/apps/mobile/src/i18n/translations/es.json @@ -1307,6 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer y Auto usan esta asignación.", "d2becdc27390c92c": "Otros modelos", "3abbefc7732635ff": "Asignación de uso para modelos de terceros como Claude, GPT y Gemini.", + "c7566c908e14be09": "Spend", + "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", "7d72af75b2812d60": "{provider} en {environment}", "bb34eaf6ddc55a72": "Esta cuenta no tiene límites de suscripción.", "42a2622893a6bced": "No se pudieron leer los límites.", diff --git a/apps/mobile/src/i18n/translations/fr.json b/apps/mobile/src/i18n/translations/fr.json index a6904b69d7f73..6b028f894915e 100644 --- a/apps/mobile/src/i18n/translations/fr.json +++ b/apps/mobile/src/i18n/translations/fr.json @@ -1307,6 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer et Auto utilisent ce quota.", "d2becdc27390c92c": "Autres modèles", "3abbefc7732635ff": "Quota d’utilisation des modèles tiers comme Claude, GPT et Gemini.", + "c7566c908e14be09": "Spend", + "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", "7d72af75b2812d60": "{provider} sur {environment}", "bb34eaf6ddc55a72": "Ce compte n’a pas de limites d’abonnement.", "42a2622893a6bced": "Impossible de lire les limites.", diff --git a/apps/mobile/src/i18n/translations/ja.json b/apps/mobile/src/i18n/translations/ja.json index 3ce3515fae73b..12c2d13cf3fa5 100644 --- a/apps/mobile/src/i18n/translations/ja.json +++ b/apps/mobile/src/i18n/translations/ja.json @@ -1307,6 +1307,8 @@ "23eed587f1bef1a6": "Grok、Composer、Auto はこの使用枠を使います。", "d2becdc27390c92c": "その他のモデル", "3abbefc7732635ff": "Claude、GPT、Gemini などのサードパーティモデル用の使用枠です。", + "c7566c908e14be09": "Spend", + "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", "7d72af75b2812d60": "{environment} の {provider}", "bb34eaf6ddc55a72": "このアカウントにはサブスクリプションの上限がありません。", "42a2622893a6bced": "上限を読み取れませんでした。", diff --git a/apps/mobile/src/i18n/translations/ko.json b/apps/mobile/src/i18n/translations/ko.json index 484ab67231b2e..984c15a1a2283 100644 --- a/apps/mobile/src/i18n/translations/ko.json +++ b/apps/mobile/src/i18n/translations/ko.json @@ -1307,6 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer, Auto가 이 사용량을 사용합니다.", "d2becdc27390c92c": "기타 모델", "3abbefc7732635ff": "Claude, GPT, Gemini 등 타사 모델의 사용 한도입니다.", + "c7566c908e14be09": "Spend", + "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", "7d72af75b2812d60": "{environment}의 {provider}", "bb34eaf6ddc55a72": "이 계정에는 구독 한도가 없습니다.", "42a2622893a6bced": "한도를 읽을 수 없습니다.", diff --git a/apps/mobile/src/i18n/translations/pt-BR.json b/apps/mobile/src/i18n/translations/pt-BR.json index 4959be9c365b1..b14f92ade16ac 100644 --- a/apps/mobile/src/i18n/translations/pt-BR.json +++ b/apps/mobile/src/i18n/translations/pt-BR.json @@ -1307,6 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer e Auto usam esta cota.", "d2becdc27390c92c": "Outros modelos", "3abbefc7732635ff": "Cota de uso para modelos de terceiros, como Claude, GPT e Gemini.", + "c7566c908e14be09": "Spend", + "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", "7d72af75b2812d60": "{provider} em {environment}", "bb34eaf6ddc55a72": "Esta conta não tem limites de assinatura.", "42a2622893a6bced": "Não foi possível ler os limites.", diff --git a/apps/mobile/src/i18n/translations/ru.json b/apps/mobile/src/i18n/translations/ru.json index 7987d3d16485a..b093cb9e19e3c 100644 --- a/apps/mobile/src/i18n/translations/ru.json +++ b/apps/mobile/src/i18n/translations/ru.json @@ -1307,6 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer и Auto расходуют этот лимит.", "d2becdc27390c92c": "Другие модели", "3abbefc7732635ff": "Лимит использования сторонних моделей, таких как Claude, GPT и Gemini.", + "c7566c908e14be09": "Spend", + "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", "7d72af75b2812d60": "{provider} на {environment}", "bb34eaf6ddc55a72": "У этого аккаунта нет лимитов подписки.", "42a2622893a6bced": "Не удалось прочитать лимиты.", diff --git a/apps/mobile/src/i18n/translations/sv.json b/apps/mobile/src/i18n/translations/sv.json index 38f2f3c80172c..4f3a9fe3e260b 100644 --- a/apps/mobile/src/i18n/translations/sv.json +++ b/apps/mobile/src/i18n/translations/sv.json @@ -1307,6 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer och Auto använder den här kvoten.", "d2becdc27390c92c": "Andra modeller", "3abbefc7732635ff": "Användningskvot för tredjepartsmodeller som Claude, GPT och Gemini.", + "c7566c908e14be09": "Spend", + "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", "7d72af75b2812d60": "{provider} på {environment}", "bb34eaf6ddc55a72": "Det här kontot har inga prenumerationsgränser.", "42a2622893a6bced": "Kunde inte läsa gränser.", diff --git a/apps/mobile/src/i18n/translations/zh.json b/apps/mobile/src/i18n/translations/zh.json index e673d0e56ba1b..eaefe3ad3ec4e 100644 --- a/apps/mobile/src/i18n/translations/zh.json +++ b/apps/mobile/src/i18n/translations/zh.json @@ -1307,6 +1307,8 @@ "23eed587f1bef1a6": "Grok、Composer 和 Auto 使用此额度。", "d2becdc27390c92c": "其他模型", "3abbefc7732635ff": "Claude、GPT 和 Gemini 等第三方模型的用量额度。", + "c7566c908e14be09": "Spend", + "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", "7d72af75b2812d60": "{environment} 上的 {provider}", "bb34eaf6ddc55a72": "此账户没有订阅限制。", "42a2622893a6bced": "无法读取限额。", diff --git a/apps/web/src/i18n/translations/de.json b/apps/web/src/i18n/translations/de.json index 7900e73186091..0ce4f23ad7e9e 100644 --- a/apps/web/src/i18n/translations/de.json +++ b/apps/web/src/i18n/translations/de.json @@ -1307,6 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer und Auto nutzen dieses Kontingent.", "d2becdc27390c92c": "Andere Modelle", "3abbefc7732635ff": "Nutzungskontingent für Modelle von Drittanbietern wie Claude, GPT und Gemini.", + "c7566c908e14be09": "Spend", + "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", "7d72af75b2812d60": "{provider} auf {environment}", "bb34eaf6ddc55a72": "Dieses Konto hat keine Abonnementlimits.", "42a2622893a6bced": "Limits konnten nicht gelesen werden.", diff --git a/apps/web/src/i18n/translations/en.json b/apps/web/src/i18n/translations/en.json index 5bdd7c383d319..e08ef4c240b47 100644 --- a/apps/web/src/i18n/translations/en.json +++ b/apps/web/src/i18n/translations/en.json @@ -1307,6 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer, and Auto use this allowance.", "d2becdc27390c92c": "Other Models", "3abbefc7732635ff": "Usage allowance for third-party models such as Claude, GPT, and Gemini.", + "c7566c908e14be09": "Spend", + "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", "7d72af75b2812d60": "{provider} on {environment}", "bb34eaf6ddc55a72": "This account has no subscription limits.", "42a2622893a6bced": "Could not read limits.", diff --git a/apps/web/src/i18n/translations/es.json b/apps/web/src/i18n/translations/es.json index 91dbb2b07f50f..b8c8f17d0327d 100644 --- a/apps/web/src/i18n/translations/es.json +++ b/apps/web/src/i18n/translations/es.json @@ -1307,6 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer y Auto usan esta asignación.", "d2becdc27390c92c": "Otros modelos", "3abbefc7732635ff": "Asignación de uso para modelos de terceros como Claude, GPT y Gemini.", + "c7566c908e14be09": "Spend", + "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", "7d72af75b2812d60": "{provider} en {environment}", "bb34eaf6ddc55a72": "Esta cuenta no tiene límites de suscripción.", "42a2622893a6bced": "No se pudieron leer los límites.", diff --git a/apps/web/src/i18n/translations/fr.json b/apps/web/src/i18n/translations/fr.json index f5cf7e62a4744..738b4da60bcd4 100644 --- a/apps/web/src/i18n/translations/fr.json +++ b/apps/web/src/i18n/translations/fr.json @@ -1307,6 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer et Auto utilisent ce quota.", "d2becdc27390c92c": "Autres modèles", "3abbefc7732635ff": "Quota d’utilisation des modèles tiers comme Claude, GPT et Gemini.", + "c7566c908e14be09": "Spend", + "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", "7d72af75b2812d60": "{provider} sur {environment}", "bb34eaf6ddc55a72": "Ce compte n’a pas de limites d’abonnement.", "42a2622893a6bced": "Impossible de lire les limites.", diff --git a/apps/web/src/i18n/translations/ja.json b/apps/web/src/i18n/translations/ja.json index 7e3be343b068b..5d062762ed8a5 100644 --- a/apps/web/src/i18n/translations/ja.json +++ b/apps/web/src/i18n/translations/ja.json @@ -1307,6 +1307,8 @@ "23eed587f1bef1a6": "Grok、Composer、Auto はこの使用枠を使います。", "d2becdc27390c92c": "その他のモデル", "3abbefc7732635ff": "Claude、GPT、Gemini などのサードパーティモデル用の使用枠です。", + "c7566c908e14be09": "Spend", + "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", "7d72af75b2812d60": "{environment} の {provider}", "bb34eaf6ddc55a72": "このアカウントにはサブスクリプションの上限がありません。", "42a2622893a6bced": "上限を読み取れませんでした。", diff --git a/apps/web/src/i18n/translations/ko.json b/apps/web/src/i18n/translations/ko.json index ef69858aead11..50815422d3fa1 100644 --- a/apps/web/src/i18n/translations/ko.json +++ b/apps/web/src/i18n/translations/ko.json @@ -1307,6 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer, Auto가 이 사용량을 사용합니다.", "d2becdc27390c92c": "기타 모델", "3abbefc7732635ff": "Claude, GPT, Gemini 등 타사 모델의 사용 한도입니다.", + "c7566c908e14be09": "Spend", + "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", "7d72af75b2812d60": "{environment}의 {provider}", "bb34eaf6ddc55a72": "이 계정에는 구독 한도가 없습니다.", "42a2622893a6bced": "한도를 읽을 수 없습니다.", diff --git a/apps/web/src/i18n/translations/pt-BR.json b/apps/web/src/i18n/translations/pt-BR.json index 5b2f82a27a416..52797508b2b66 100644 --- a/apps/web/src/i18n/translations/pt-BR.json +++ b/apps/web/src/i18n/translations/pt-BR.json @@ -1307,6 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer e Auto usam esta cota.", "d2becdc27390c92c": "Outros modelos", "3abbefc7732635ff": "Cota de uso para modelos de terceiros, como Claude, GPT e Gemini.", + "c7566c908e14be09": "Spend", + "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", "7d72af75b2812d60": "{provider} em {environment}", "bb34eaf6ddc55a72": "Esta conta não tem limites de assinatura.", "42a2622893a6bced": "Não foi possível ler os limites.", diff --git a/apps/web/src/i18n/translations/ru.json b/apps/web/src/i18n/translations/ru.json index 2891cb8165d7c..21e6f1782fc33 100644 --- a/apps/web/src/i18n/translations/ru.json +++ b/apps/web/src/i18n/translations/ru.json @@ -1307,6 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer и Auto расходуют этот лимит.", "d2becdc27390c92c": "Другие модели", "3abbefc7732635ff": "Лимит использования сторонних моделей, таких как Claude, GPT и Gemini.", + "c7566c908e14be09": "Spend", + "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", "7d72af75b2812d60": "{provider} на {environment}", "bb34eaf6ddc55a72": "У этого аккаунта нет лимитов подписки.", "42a2622893a6bced": "Не удалось прочитать лимиты.", diff --git a/apps/web/src/i18n/translations/sv.json b/apps/web/src/i18n/translations/sv.json index c792d6fb4a981..ff91818909179 100644 --- a/apps/web/src/i18n/translations/sv.json +++ b/apps/web/src/i18n/translations/sv.json @@ -1307,6 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer och Auto använder den här kvoten.", "d2becdc27390c92c": "Andra modeller", "3abbefc7732635ff": "Användningskvot för tredjepartsmodeller som Claude, GPT och Gemini.", + "c7566c908e14be09": "Spend", + "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", "7d72af75b2812d60": "{provider} på {environment}", "bb34eaf6ddc55a72": "Det här kontot har inga prenumerationsgränser.", "42a2622893a6bced": "Kunde inte läsa gränser.", diff --git a/apps/web/src/i18n/translations/zh.json b/apps/web/src/i18n/translations/zh.json index cd80e9a35102a..b07d59da7b492 100644 --- a/apps/web/src/i18n/translations/zh.json +++ b/apps/web/src/i18n/translations/zh.json @@ -1307,6 +1307,8 @@ "23eed587f1bef1a6": "Grok、Composer 和 Auto 使用此额度。", "d2becdc27390c92c": "其他模型", "3abbefc7732635ff": "Claude、GPT 和 Gemini 等第三方模型的用量额度。", + "c7566c908e14be09": "Spend", + "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", "7d72af75b2812d60": "{environment} 上的 {provider}", "bb34eaf6ddc55a72": "此账户没有订阅限制。", "42a2622893a6bced": "无法读取限额。", diff --git a/packages/shared/src/usageLimitsCopy.ts b/packages/shared/src/usageLimitsCopy.ts index bfb6847738cce..539db722cd880 100644 --- a/packages/shared/src/usageLimitsCopy.ts +++ b/packages/shared/src/usageLimitsCopy.ts @@ -39,7 +39,9 @@ const CURSOR_USAGE_WINDOW_COPY: Readonly< }, spendLimit: { label: msg("Spend"), - description: msg("Spending this billing cycle against your Cursor spend limit."), + description: msg("Spending this billing cycle against your {provider} spend limit.", { + provider: "Cursor", + }), }, }; From ee9cacb4e57c3d3c403ba6095b8d3d2aad3bf40b Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Mon, 23 Nov 2026 16:36:13 +0000 Subject: [PATCH 3/3] fix(cursor): translate the Spend window and trim its tests Translate the Spend label and description in every web and mobile catalog, and fold the live Enterprise response into the request test instead of keeping a separate fixture test. Co-Authored-By: Claude Opus 5.5 --- apps/mobile/src/i18n/translations/de.json | 4 +- apps/mobile/src/i18n/translations/es.json | 4 +- apps/mobile/src/i18n/translations/fr.json | 4 +- apps/mobile/src/i18n/translations/ja.json | 4 +- apps/mobile/src/i18n/translations/ko.json | 4 +- apps/mobile/src/i18n/translations/pt-BR.json | 4 +- apps/mobile/src/i18n/translations/ru.json | 4 +- apps/mobile/src/i18n/translations/sv.json | 4 +- apps/mobile/src/i18n/translations/zh.json | 4 +- apps/web/src/i18n/translations/de.json | 4 +- apps/web/src/i18n/translations/es.json | 4 +- apps/web/src/i18n/translations/fr.json | 4 +- apps/web/src/i18n/translations/ja.json | 4 +- apps/web/src/i18n/translations/ko.json | 4 +- apps/web/src/i18n/translations/pt-BR.json | 4 +- apps/web/src/i18n/translations/ru.json | 4 +- apps/web/src/i18n/translations/sv.json | 4 +- apps/web/src/i18n/translations/zh.json | 4 +- .../src/server/usageLimits.test.ts | 130 +++++------------- 19 files changed, 69 insertions(+), 133 deletions(-) diff --git a/apps/mobile/src/i18n/translations/de.json b/apps/mobile/src/i18n/translations/de.json index 377edecd8ef67..6635c19f7caca 100644 --- a/apps/mobile/src/i18n/translations/de.json +++ b/apps/mobile/src/i18n/translations/de.json @@ -1307,8 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer und Auto nutzen dieses Kontingent.", "d2becdc27390c92c": "Andere Modelle", "3abbefc7732635ff": "Nutzungskontingent für Modelle von Drittanbietern wie Claude, GPT und Gemini.", - "c7566c908e14be09": "Spend", - "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", + "c7566c908e14be09": "Ausgaben", + "ae693772acb75c75": "Ausgaben in diesem Abrechnungszeitraum im Verhältnis zu deinem {provider}-Ausgabenlimit.", "7d72af75b2812d60": "{provider} auf {environment}", "bb34eaf6ddc55a72": "Dieses Konto hat keine Abonnementlimits.", "42a2622893a6bced": "Limits konnten nicht gelesen werden.", diff --git a/apps/mobile/src/i18n/translations/es.json b/apps/mobile/src/i18n/translations/es.json index 0416045873bc3..6b832e022879b 100644 --- a/apps/mobile/src/i18n/translations/es.json +++ b/apps/mobile/src/i18n/translations/es.json @@ -1307,8 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer y Auto usan esta asignación.", "d2becdc27390c92c": "Otros modelos", "3abbefc7732635ff": "Asignación de uso para modelos de terceros como Claude, GPT y Gemini.", - "c7566c908e14be09": "Spend", - "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", + "c7566c908e14be09": "Gasto", + "ae693772acb75c75": "Gasto en este ciclo de facturación frente a tu límite de gasto de {provider}.", "7d72af75b2812d60": "{provider} en {environment}", "bb34eaf6ddc55a72": "Esta cuenta no tiene límites de suscripción.", "42a2622893a6bced": "No se pudieron leer los límites.", diff --git a/apps/mobile/src/i18n/translations/fr.json b/apps/mobile/src/i18n/translations/fr.json index 6b028f894915e..b4e0deef90823 100644 --- a/apps/mobile/src/i18n/translations/fr.json +++ b/apps/mobile/src/i18n/translations/fr.json @@ -1307,8 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer et Auto utilisent ce quota.", "d2becdc27390c92c": "Autres modèles", "3abbefc7732635ff": "Quota d’utilisation des modèles tiers comme Claude, GPT et Gemini.", - "c7566c908e14be09": "Spend", - "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", + "c7566c908e14be09": "Dépenses", + "ae693772acb75c75": "Dépenses de ce cycle de facturation par rapport à votre limite de dépenses {provider}.", "7d72af75b2812d60": "{provider} sur {environment}", "bb34eaf6ddc55a72": "Ce compte n’a pas de limites d’abonnement.", "42a2622893a6bced": "Impossible de lire les limites.", diff --git a/apps/mobile/src/i18n/translations/ja.json b/apps/mobile/src/i18n/translations/ja.json index 12c2d13cf3fa5..9b724e71a2a5e 100644 --- a/apps/mobile/src/i18n/translations/ja.json +++ b/apps/mobile/src/i18n/translations/ja.json @@ -1307,8 +1307,8 @@ "23eed587f1bef1a6": "Grok、Composer、Auto はこの使用枠を使います。", "d2becdc27390c92c": "その他のモデル", "3abbefc7732635ff": "Claude、GPT、Gemini などのサードパーティモデル用の使用枠です。", - "c7566c908e14be09": "Spend", - "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", + "c7566c908e14be09": "支出", + "ae693772acb75c75": "今回の請求期間の支出と {provider} の支出上限の比較です。", "7d72af75b2812d60": "{environment} の {provider}", "bb34eaf6ddc55a72": "このアカウントにはサブスクリプションの上限がありません。", "42a2622893a6bced": "上限を読み取れませんでした。", diff --git a/apps/mobile/src/i18n/translations/ko.json b/apps/mobile/src/i18n/translations/ko.json index 984c15a1a2283..323ae84149b98 100644 --- a/apps/mobile/src/i18n/translations/ko.json +++ b/apps/mobile/src/i18n/translations/ko.json @@ -1307,8 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer, Auto가 이 사용량을 사용합니다.", "d2becdc27390c92c": "기타 모델", "3abbefc7732635ff": "Claude, GPT, Gemini 등 타사 모델의 사용 한도입니다.", - "c7566c908e14be09": "Spend", - "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", + "c7566c908e14be09": "지출", + "ae693772acb75c75": "이번 결제 주기의 지출을 {provider} 지출 한도와 비교합니다.", "7d72af75b2812d60": "{environment}의 {provider}", "bb34eaf6ddc55a72": "이 계정에는 구독 한도가 없습니다.", "42a2622893a6bced": "한도를 읽을 수 없습니다.", diff --git a/apps/mobile/src/i18n/translations/pt-BR.json b/apps/mobile/src/i18n/translations/pt-BR.json index b14f92ade16ac..81c7326dea1be 100644 --- a/apps/mobile/src/i18n/translations/pt-BR.json +++ b/apps/mobile/src/i18n/translations/pt-BR.json @@ -1307,8 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer e Auto usam esta cota.", "d2becdc27390c92c": "Outros modelos", "3abbefc7732635ff": "Cota de uso para modelos de terceiros, como Claude, GPT e Gemini.", - "c7566c908e14be09": "Spend", - "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", + "c7566c908e14be09": "Gastos", + "ae693772acb75c75": "Gastos neste ciclo de cobrança em relação ao seu limite de gastos do {provider}.", "7d72af75b2812d60": "{provider} em {environment}", "bb34eaf6ddc55a72": "Esta conta não tem limites de assinatura.", "42a2622893a6bced": "Não foi possível ler os limites.", diff --git a/apps/mobile/src/i18n/translations/ru.json b/apps/mobile/src/i18n/translations/ru.json index b093cb9e19e3c..6a8be2edf114a 100644 --- a/apps/mobile/src/i18n/translations/ru.json +++ b/apps/mobile/src/i18n/translations/ru.json @@ -1307,8 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer и Auto расходуют этот лимит.", "d2becdc27390c92c": "Другие модели", "3abbefc7732635ff": "Лимит использования сторонних моделей, таких как Claude, GPT и Gemini.", - "c7566c908e14be09": "Spend", - "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", + "c7566c908e14be09": "Расходы", + "ae693772acb75c75": "Расходы за этот расчётный период относительно вашего лимита расходов в {provider}.", "7d72af75b2812d60": "{provider} на {environment}", "bb34eaf6ddc55a72": "У этого аккаунта нет лимитов подписки.", "42a2622893a6bced": "Не удалось прочитать лимиты.", diff --git a/apps/mobile/src/i18n/translations/sv.json b/apps/mobile/src/i18n/translations/sv.json index 4f3a9fe3e260b..92a37e719c3a9 100644 --- a/apps/mobile/src/i18n/translations/sv.json +++ b/apps/mobile/src/i18n/translations/sv.json @@ -1307,8 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer och Auto använder den här kvoten.", "d2becdc27390c92c": "Andra modeller", "3abbefc7732635ff": "Användningskvot för tredjepartsmodeller som Claude, GPT och Gemini.", - "c7566c908e14be09": "Spend", - "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", + "c7566c908e14be09": "Utgifter", + "ae693772acb75c75": "Utgifter under den här faktureringsperioden mot din utgiftsgräns i {provider}.", "7d72af75b2812d60": "{provider} på {environment}", "bb34eaf6ddc55a72": "Det här kontot har inga prenumerationsgränser.", "42a2622893a6bced": "Kunde inte läsa gränser.", diff --git a/apps/mobile/src/i18n/translations/zh.json b/apps/mobile/src/i18n/translations/zh.json index eaefe3ad3ec4e..133b5f9f09ad9 100644 --- a/apps/mobile/src/i18n/translations/zh.json +++ b/apps/mobile/src/i18n/translations/zh.json @@ -1307,8 +1307,8 @@ "23eed587f1bef1a6": "Grok、Composer 和 Auto 使用此额度。", "d2becdc27390c92c": "其他模型", "3abbefc7732635ff": "Claude、GPT 和 Gemini 等第三方模型的用量额度。", - "c7566c908e14be09": "Spend", - "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", + "c7566c908e14be09": "支出", + "ae693772acb75c75": "本计费周期内的支出与你的 {provider} 支出上限对比。", "7d72af75b2812d60": "{environment} 上的 {provider}", "bb34eaf6ddc55a72": "此账户没有订阅限制。", "42a2622893a6bced": "无法读取限额。", diff --git a/apps/web/src/i18n/translations/de.json b/apps/web/src/i18n/translations/de.json index 0ce4f23ad7e9e..ffadbdd2d2b19 100644 --- a/apps/web/src/i18n/translations/de.json +++ b/apps/web/src/i18n/translations/de.json @@ -1307,8 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer und Auto nutzen dieses Kontingent.", "d2becdc27390c92c": "Andere Modelle", "3abbefc7732635ff": "Nutzungskontingent für Modelle von Drittanbietern wie Claude, GPT und Gemini.", - "c7566c908e14be09": "Spend", - "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", + "c7566c908e14be09": "Ausgaben", + "ae693772acb75c75": "Ausgaben in diesem Abrechnungszeitraum im Verhältnis zu deinem {provider}-Ausgabenlimit.", "7d72af75b2812d60": "{provider} auf {environment}", "bb34eaf6ddc55a72": "Dieses Konto hat keine Abonnementlimits.", "42a2622893a6bced": "Limits konnten nicht gelesen werden.", diff --git a/apps/web/src/i18n/translations/es.json b/apps/web/src/i18n/translations/es.json index b8c8f17d0327d..598ff3f606b26 100644 --- a/apps/web/src/i18n/translations/es.json +++ b/apps/web/src/i18n/translations/es.json @@ -1307,8 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer y Auto usan esta asignación.", "d2becdc27390c92c": "Otros modelos", "3abbefc7732635ff": "Asignación de uso para modelos de terceros como Claude, GPT y Gemini.", - "c7566c908e14be09": "Spend", - "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", + "c7566c908e14be09": "Gasto", + "ae693772acb75c75": "Gasto en este ciclo de facturación frente a tu límite de gasto de {provider}.", "7d72af75b2812d60": "{provider} en {environment}", "bb34eaf6ddc55a72": "Esta cuenta no tiene límites de suscripción.", "42a2622893a6bced": "No se pudieron leer los límites.", diff --git a/apps/web/src/i18n/translations/fr.json b/apps/web/src/i18n/translations/fr.json index 738b4da60bcd4..da889e783adeb 100644 --- a/apps/web/src/i18n/translations/fr.json +++ b/apps/web/src/i18n/translations/fr.json @@ -1307,8 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer et Auto utilisent ce quota.", "d2becdc27390c92c": "Autres modèles", "3abbefc7732635ff": "Quota d’utilisation des modèles tiers comme Claude, GPT et Gemini.", - "c7566c908e14be09": "Spend", - "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", + "c7566c908e14be09": "Dépenses", + "ae693772acb75c75": "Dépenses de ce cycle de facturation par rapport à votre limite de dépenses {provider}.", "7d72af75b2812d60": "{provider} sur {environment}", "bb34eaf6ddc55a72": "Ce compte n’a pas de limites d’abonnement.", "42a2622893a6bced": "Impossible de lire les limites.", diff --git a/apps/web/src/i18n/translations/ja.json b/apps/web/src/i18n/translations/ja.json index 5d062762ed8a5..6ea6d972b7eb8 100644 --- a/apps/web/src/i18n/translations/ja.json +++ b/apps/web/src/i18n/translations/ja.json @@ -1307,8 +1307,8 @@ "23eed587f1bef1a6": "Grok、Composer、Auto はこの使用枠を使います。", "d2becdc27390c92c": "その他のモデル", "3abbefc7732635ff": "Claude、GPT、Gemini などのサードパーティモデル用の使用枠です。", - "c7566c908e14be09": "Spend", - "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", + "c7566c908e14be09": "支出", + "ae693772acb75c75": "今回の請求期間の支出と {provider} の支出上限の比較です。", "7d72af75b2812d60": "{environment} の {provider}", "bb34eaf6ddc55a72": "このアカウントにはサブスクリプションの上限がありません。", "42a2622893a6bced": "上限を読み取れませんでした。", diff --git a/apps/web/src/i18n/translations/ko.json b/apps/web/src/i18n/translations/ko.json index 50815422d3fa1..b8df058e81a85 100644 --- a/apps/web/src/i18n/translations/ko.json +++ b/apps/web/src/i18n/translations/ko.json @@ -1307,8 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer, Auto가 이 사용량을 사용합니다.", "d2becdc27390c92c": "기타 모델", "3abbefc7732635ff": "Claude, GPT, Gemini 등 타사 모델의 사용 한도입니다.", - "c7566c908e14be09": "Spend", - "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", + "c7566c908e14be09": "지출", + "ae693772acb75c75": "이번 결제 주기의 지출을 {provider} 지출 한도와 비교합니다.", "7d72af75b2812d60": "{environment}의 {provider}", "bb34eaf6ddc55a72": "이 계정에는 구독 한도가 없습니다.", "42a2622893a6bced": "한도를 읽을 수 없습니다.", diff --git a/apps/web/src/i18n/translations/pt-BR.json b/apps/web/src/i18n/translations/pt-BR.json index 52797508b2b66..b353737b36bc6 100644 --- a/apps/web/src/i18n/translations/pt-BR.json +++ b/apps/web/src/i18n/translations/pt-BR.json @@ -1307,8 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer e Auto usam esta cota.", "d2becdc27390c92c": "Outros modelos", "3abbefc7732635ff": "Cota de uso para modelos de terceiros, como Claude, GPT e Gemini.", - "c7566c908e14be09": "Spend", - "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", + "c7566c908e14be09": "Gastos", + "ae693772acb75c75": "Gastos neste ciclo de cobrança em relação ao seu limite de gastos do {provider}.", "7d72af75b2812d60": "{provider} em {environment}", "bb34eaf6ddc55a72": "Esta conta não tem limites de assinatura.", "42a2622893a6bced": "Não foi possível ler os limites.", diff --git a/apps/web/src/i18n/translations/ru.json b/apps/web/src/i18n/translations/ru.json index 21e6f1782fc33..42d06d6458b6f 100644 --- a/apps/web/src/i18n/translations/ru.json +++ b/apps/web/src/i18n/translations/ru.json @@ -1307,8 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer и Auto расходуют этот лимит.", "d2becdc27390c92c": "Другие модели", "3abbefc7732635ff": "Лимит использования сторонних моделей, таких как Claude, GPT и Gemini.", - "c7566c908e14be09": "Spend", - "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", + "c7566c908e14be09": "Расходы", + "ae693772acb75c75": "Расходы за этот расчётный период относительно вашего лимита расходов в {provider}.", "7d72af75b2812d60": "{provider} на {environment}", "bb34eaf6ddc55a72": "У этого аккаунта нет лимитов подписки.", "42a2622893a6bced": "Не удалось прочитать лимиты.", diff --git a/apps/web/src/i18n/translations/sv.json b/apps/web/src/i18n/translations/sv.json index ff91818909179..6c8a50de89dad 100644 --- a/apps/web/src/i18n/translations/sv.json +++ b/apps/web/src/i18n/translations/sv.json @@ -1307,8 +1307,8 @@ "23eed587f1bef1a6": "Grok, Composer och Auto använder den här kvoten.", "d2becdc27390c92c": "Andra modeller", "3abbefc7732635ff": "Användningskvot för tredjepartsmodeller som Claude, GPT och Gemini.", - "c7566c908e14be09": "Spend", - "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", + "c7566c908e14be09": "Utgifter", + "ae693772acb75c75": "Utgifter under den här faktureringsperioden mot din utgiftsgräns i {provider}.", "7d72af75b2812d60": "{provider} på {environment}", "bb34eaf6ddc55a72": "Det här kontot har inga prenumerationsgränser.", "42a2622893a6bced": "Kunde inte läsa gränser.", diff --git a/apps/web/src/i18n/translations/zh.json b/apps/web/src/i18n/translations/zh.json index b07d59da7b492..b76eedd3ddeda 100644 --- a/apps/web/src/i18n/translations/zh.json +++ b/apps/web/src/i18n/translations/zh.json @@ -1307,8 +1307,8 @@ "23eed587f1bef1a6": "Grok、Composer 和 Auto 使用此额度。", "d2becdc27390c92c": "其他模型", "3abbefc7732635ff": "Claude、GPT 和 Gemini 等第三方模型的用量额度。", - "c7566c908e14be09": "Spend", - "ae693772acb75c75": "Spending this billing cycle against your {provider} spend limit.", + "c7566c908e14be09": "支出", + "ae693772acb75c75": "本计费周期内的支出与你的 {provider} 支出上限对比。", "7d72af75b2812d60": "{environment} 上的 {provider}", "bb34eaf6ddc55a72": "此账户没有订阅限制。", "42a2622893a6bced": "无法读取限额。", diff --git a/packages/provider-cursor/src/server/usageLimits.test.ts b/packages/provider-cursor/src/server/usageLimits.test.ts index 670754812447c..3e2d15b7c3d91 100644 --- a/packages/provider-cursor/src/server/usageLimits.test.ts +++ b/packages/provider-cursor/src/server/usageLimits.test.ts @@ -7,7 +7,7 @@ import { cursorUsageResponseToLimits, readCursorUsageLimits } from "./usageLimit describe("Cursor usage limits", () => { const checkedAt = "2026-09-16T00:00:00.000Z"; - it("uses the advertised percentages and reset, or Spend when no allowance is included", () => { + it("uses the advertised percentages and billing-cycle reset", () => { const limits = cursorUsageResponseToLimits( { billingCycleEnd: "1789876386000", @@ -40,100 +40,41 @@ describe("Cursor usage limits", () => { }, ]), ); - const withSpendLimit = cursorUsageResponseToLimits( - { - billingCycleEnd: "1789876386000", - planUsage: { totalPercentUsed: 72.4, autoPercentUsed: 69.5, apiPercentUsed: 100 }, - spendLimitUsage: { individualLimit: 5000, individualUsed: 100 }, - }, - checkedAt, - ); - expect(withSpendLimit.windows).toEqual(limits.windows); + }); + + it("shows Spend against the personal limit only when no allowance is included", () => { const zeroPercents = { totalPercentUsed: 0, autoPercentUsed: 0, apiPercentUsed: 0 }; - const zeroPlanWindows = [ - { id: "apiPercentUsed", kind: "monthly", label: "Other Models", usedPercent: 0 }, - { id: "autoPercentUsed", kind: "monthly", label: "Cursor Models", usedPercent: 0 }, - { id: "totalPercentUsed", kind: "monthly", label: "Overall", usedPercent: 0 }, - ]; const windowIds = (response: Parameters[0]) => cursorUsageResponseToLimits(response, checkedAt).windows.map((window) => window.id); - // Usage already counted against a pooled plan keeps the plan bars. + const planIds = ["apiPercentUsed", "autoPercentUsed", "totalPercentUsed"]; + const pool = { pooledLimit: "3000000", overallLimit: 50000, overallUsed: 3211 }; + // Usage already counted against the plan, an included allowance, or no team pool keep the plan bars. expect( - windowIds({ - planUsage: { totalPercentUsed: 6, autoPercentUsed: 6, apiPercentUsed: 0 }, - spendLimitUsage: { pooledLimit: "3000000", overallLimit: 50000, overallUsed: 3211 }, - }), - ).toEqual(["apiPercentUsed", "autoPercentUsed", "totalPercentUsed"]); - // Fresh-cycle Pro: an included allowance, or no pool marker, keeps the plan bars. - for (const response of [ - { - planUsage: { ...zeroPercents, limit: "2000" }, - spendLimitUsage: { individualLimit: 5000, individualUsed: 0, pooledLimit: "3000000" }, - }, - { planUsage: zeroPercents, spendLimitUsage: { individualLimit: 5000 } }, - ]) { - expect(cursorUsageResponseToLimits(response, checkedAt).windows).toEqual(zeroPlanWindows); - } + windowIds({ planUsage: { ...zeroPercents, autoPercentUsed: 6 }, spendLimitUsage: pool }), + ).toEqual(planIds); expect( - windowIds({ - planUsage: { ...zeroPercents, limit: "0" }, - spendLimitUsage: { pooledLimit: "3000000", overallLimit: 50000, overallUsed: 3211 }, - }), - ).toEqual(["spendLimit"]); - // Without includePooledUsage, Cursor reports start = end = now instead of the cycle. + windowIds({ planUsage: { ...zeroPercents, limit: "2000" }, spendLimitUsage: pool }), + ).toEqual(planIds); + expect( + windowIds({ planUsage: zeroPercents, spendLimitUsage: { individualLimit: 5000 } }), + ).toEqual(planIds); + // A start equal to the end is not a billing cycle; a missing used means zero. expect( cursorUsageResponseToLimits( { billingCycleStart: "1793491200000", billingCycleEnd: "1793491200000", - spendLimitUsage: { individualLimit: "2000", individualUsed: "500" }, + spendLimitUsage: { overallLimit: 0, individualLimit: "2000", individualUsed: "500" }, }, checkedAt, ).windows, ).toEqual([{ id: "spendLimit", kind: "monthly", label: "Spend", usedPercent: 25 }]); - // Limit and used come from the same pair; protobuf JSON omits a zero used. - for (const [spendLimitUsage, usedPercent] of [ - [{ overallLimit: 50000, individualUsed: 3211 }, 0], - [{ overallLimit: 0, individualLimit: "2000", individualUsed: "500" }, 25], - ] as const) { - expect( - cursorUsageResponseToLimits({ spendLimitUsage }, checkedAt).windows.map( - (window) => window.usedPercent, - ), - ).toEqual([usedPercent]); - } - }); - - it("maps a live Enterprise response to the personal spend limit", () => { - // Captured from a live Enterprise account on a token-based contract, 2026-11-23. - // The pooled team budget arrives as a string, the personal pair as numbers. - const enterpriseResponse = { - billingCycleStart: "1793491200000", - billingCycleEnd: "1796083200000", - planUsage: { totalPercentUsed: 0, autoPercentUsed: 0, apiPercentUsed: 0 }, - spendLimitUsage: { - totalSpend: 679881371, - pooledLimit: "1009395000", - pooledUsed: 679881371, - pooledRemaining: "329513629", - limitType: "team", - overallLimit: 100000, - overallUsed: 68757, - overallRemaining: 31243, - }, - }; - const limits = cursorUsageResponseToLimits(enterpriseResponse, checkedAt); - // $687.57 of a $1,000 personal limit; Cursor reports the same 69% for this response. - expect(limits.windows).toEqual([ - { - id: "spendLimit", - kind: "monthly", - label: "Spend", - usedPercent: 68.757, - resetsAt: "2026-12-01T00:00:00.000Z", - windowDurationMins: 43_200, - }, - ]); + expect( + cursorUsageResponseToLimits( + { spendLimitUsage: { overallLimit: 50000, individualUsed: 3211 } }, + checkedAt, + ).windows[0]?.usedPercent, + ).toBe(0); }); it("reports the billing-cycle length so pace can be computed", () => { @@ -196,16 +137,10 @@ describe("Cursor usage limits", () => { externalUsage: { label: "Cursor usage", url: "https://cursor.com/dashboard?tab=usage" }, }; expect(cursorUsageResponseToLimits({ planUsage: {} }, checkedAt)).toEqual(linkOnly); - // Real Enterprise (token-based contract) response: no planUsage at all. - expect(cursorUsageResponseToLimits({ billingCycleEnd: "1793495876373" }, checkedAt)).toEqual( - linkOnly, - ); - // Enterprise seat with only the team pool: zeroed percentages and no personal limit. + // Enterprise seat with only the team pool and no personal limit. expect( cursorUsageResponseToLimits( { - billingCycleStart: "1793491200000", - billingCycleEnd: "1796083200000", planUsage: { totalPercentUsed: 0, autoPercentUsed: 0, apiPercentUsed: 0 }, spendLimitUsage: { pooledLimit: "3000000" }, }, @@ -237,21 +172,22 @@ describe("Cursor usage limits", () => { return Effect.succeed( HttpClientResponse.fromWeb( request, + // Captured from a live Enterprise account (token-based contract), 2026-11-23: + // the team pool arrives as int64 strings, the personal pair as numbers. Response.json({ billingCycleStart: "1793491200000", billingCycleEnd: "1796083200000", - displayThreshold: 50, planUsage: { totalPercentUsed: 0, autoPercentUsed: 0, apiPercentUsed: 0 }, spendLimitUsage: { + totalSpend: 679881371, + pooledLimit: "1009395000", + pooledUsed: 679881371, + pooledRemaining: "329513629", limitType: "team", - overallLimit: 50000, - overallUsed: 3211, - overallRemaining: 46789, - pooledLimit: "3000000", - pooledUsed: 0, - pooledRemaining: "3000000", + overallLimit: 100000, + overallUsed: 68757, + overallRemaining: 31243, }, - displayMessage: "You've used 6% of your included usage", }), ), ); @@ -265,7 +201,7 @@ describe("Cursor usage limits", () => { id: "spendLimit", kind: "monthly", label: "Spend", - usedPercent: 6.422, + usedPercent: 68.757, resetsAt: "2026-12-01T00:00:00.000Z", windowDurationMins: 43_200, },