Skip to content

Commit 601cba7

Browse files
fix(cursor): keep a unified plan's pool so it pools with split-plan accounts
Drop the matching total instead of the auto pool. The Usage view pools windows by id and hides totals once any account reports both pools, so a unified account reduced to its total vanished next to a split-plan account. Describe the auto pool without assuming a second one. AI-assisted; verified with the tests and tools listed above.
1 parent 98b19c5 commit 601cba7

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎packages/provider-cursor/src/server/usageLimits.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ describe("Cursor usage limits", () => {
8282
{ planUsage: { totalPercentUsed: 1.77, autoPercentUsed: 1.77 } },
8383
checkedAt,
8484
).windows;
85-
expect(windows).toHaveLength(1);
85+
expect(windows.map((window) => window.id)).toEqual(["autoPercentUsed"]);
8686
expect(
8787
cursorUsageResponseToLimits(
8888
{ planUsage: { totalPercentUsed: 100, apiPercentUsed: 100 } },

‎packages/provider-cursor/src/server/usageLimits.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ export function cursorUsageResponseToLimits(
5959
}
6060
const total = windows.find((window) => window.id === "totalPercentUsed");
6161
const pools = windows.filter((window) => window !== total);
62-
// Unified plans report their one allowance as both the total and the auto pool. Never drop
63-
// the API pool: exhaustedUsageWindow reads it to fall back from Claude, GPT, and Gemini.
62+
// Unified plans report their one allowance as both the total and the auto pool. Keep the pool:
63+
// it pools with split-plan accounts, and exhaustedUsageWindow reads the pools.
6464
const visibleWindows =
6565
total &&
6666
pools.length === 1 &&
6767
pools[0]?.id === "autoPercentUsed" &&
6868
pools[0].usedPercent === total.usedPercent
69-
? [total]
69+
? pools
7070
: windows;
7171
return visibleWindows.length > 0
7272
? makeUsageLimits({ checkedAt, windows: visibleWindows })

‎packages/shared/src/usageLimits.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export const CURSOR_USAGE_WINDOWS = [
124124
{
125125
id: "autoPercentUsed",
126126
label: "Cursor Models",
127-
description: "Grok and Composer use this first. Auto can use either pool.",
127+
description: "Grok, Composer, and Auto use this allowance.",
128128
},
129129
{
130130
id: "apiPercentUsed",

0 commit comments

Comments
 (0)