[Bug]: Cursor usage limits appear once per linked environment for the same Cursor account #45237
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
Not sure
Steps to reproduce#
- On two machines, sign in to the same Cursor account in T3 Code (each machine gets its own Cursor SDK API key via browser sign-in, or uses a
CURSOR_API_KEYwhereGET https://api.cursor.com/v1/meomitsuserEmail). - Link both machines as environments in T3 Code.
- Open Usage → Limits with both environments selected (All environments).
Expected behavior#
One Cursor usage bar for the shared Cursor account (matching how Codex and Claude collapse across linked environments), with the pooled percentage and ↻ reset forecast counting the subscription once.
Actual behavior#
Actual behavior#
Each linked environment renders its own Cursor bar side by side with the same percentage and reset time (e.g. two Cursor 85% · 4d 21h bars). Because T3 Code treats them as two separate accounts, the ↻ refill delta on the left is also halved (e.g. +8% in 4d 21h instead of +15%).
Impact#
Cosmetic issue
Version or commit#
T3 Code 0.1.14-nightly.20261128.5413
Environment#
- Local: macOS (ARM64), T3 Code Nightly
0.1.14-nightly.20261128.5413 - Linked environment: macOS (ARM64), T3 Code Nightly
0.1.14-nightly.20261128.5413 - Provider: Cursor (same Cursor account signed in on both machines via browser sign-in)
Logs or stack traces#
N/A
Screenshots, recordings, or supporting files#
N/A
Root cause#
collectLimitAccounts in packages/shared/src/usageLimits.ts deduplicates native providers across environments using provider.auth.email or usageLimits.credentialFingerprint, falling back to ${environmentId}:${provider.instanceId} when neither is present:
packages/provider-cursor/src/server/status.ts(cursorSdkAuth) only setsauth.emailifGET https://api.cursor.com/v1/mereturns the optionaluserEmailfield. When/v1/meomitsuserEmail,auth.emailisundefined.packages/provider-cursor/src/server/usageLimits.ts(readCursorUsageLimits) exchanges the API key for an access token (exchangeCursorApiKey) and callsGetCurrentPeriodUsage, but never attaches acredentialFingerprintto the returnedUsageLimits.- Meanwhile,
packages/provider-cursor/src/server/accountUsage.ts(readSession) already derives a stable per-account hash (sha256(jwt.sub)) from that exact same exchanged access token — and confirms both machines resolve to the sameaccountKeyinusage-cursor-account-cache-v2.jsondespite having different API keys.
Suggested fix#
In packages/provider-cursor/src/server/usageLimits.ts (readCursorUsageLimits), decode sub from the exchanged JWT access token (the same way accountUsage.ts does) and set credentialFingerprint (e.g. account:<sha256(sub)>) on the returned UsageLimits.
Workaround#
Filter Usage → Limits to a single environment instead of All environments.
Related#
tombell(GitHub profile, opens in a new tab) added labelsbug
tombell(GitHub profile, opens in a new tab) added labelsneeds-triage
rvyyv-n(GitHub profile, opens in a new tab) linked this to #45253
Sign in to join this conversation.