Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(cursor): deduplicate usage limits across linked environments #45253

Openrvyyv-n(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/45253/headopened View on GitHub

rvyyv-n(GitHub profile, opens in a new tab)commented

Problem

In Usage → Limits, two linked environments show separate meters for the same Cursor account when Cursor omits the account email. Each environment can have a different API key even though the exchanged tokens refer to the same account.

Change

The limits probe now uses a SHA-256 hash of the account subject from the exchanged Cursor access token. The existing limits aggregator can use that fingerprint when the email is absent. The limits and history readers share the subject decoder. An opaque token still returns any available usage windows.

Scope

Fixes #45237. The change is limited to the Cursor provider and its regression tests.

Verification

I reproduced the report with mocked Cursor responses and the shared limits aggregator. Three linked environments reported two accounts, with different API keys for the two environments sharing an account. The old code produced three account entries and the patched code produced two. An opaque token still returned the expected usage window.

The changed-file gate passed formatting, lint, Knip, type checking, and 30 tests. The reproduction used mocked provider responses.

GPT-6.2 Sol via Codex in T3 Code.

    1. Pusheded0608f

    2. The automated pipeline stopped on this pull request and will not merge it:

      the fix is written and reviewed, but proving it needs something no worker has:

      • Permanent blocker: A real Cursor account whose /v1/me response omits userEmail, with two independently issued SDK API keys for that same account, is needed. The single available key returns userEmail, and no account login is supplied to obtain the required credentials. Shared-account deduplication and pooled refill forecasting on both commits remain unverified.
      • Different-account separation was not exercised because a second Cursor account is not available.

      It stays open for a person to finish or close.

    3. juliusmarminge added labelstakeover:blocked

    4. juliusmarminge removed labelstakeover:in-progress

    5. The automated pipeline stopped on this pull request and will not merge it:

      the fix is written and reviewed, but proving it needs something no worker has:

      • Permanent blocker: A real Cursor account whose /v1/me response omits userEmail, with two independently issued SDK API keys for that same account, is needed. The single available key returns userEmail, and no account login is supplied to obtain the required credentials. Shared-account deduplication and pooled refill forecasting on both commits remain unverified.

      • Different-account separation was not exercised because a second Cursor account is not available.

      It stays open for a person to finish or close.

      Thanks for checking this. Would confirmation from the original reporter that the PR build shows one Cursor bar and the correct refill forecast be enough for a manual review? The mocked regression covered separate accounts too. If you need that case verified live as well, let me know.

    6. @tombell, could you try this PR build with the same two linked Cursor environments from #45237? Does Usage → Limits now show one Cursor bar, and does the refill forecast reflect one subscription? A short confirmation or redacted screenshot is enough.

    7. @tombell, could you try this PR build with the same two linked Cursor environments from #45237? Does Usage → Limits now show one Cursor bar, and does the refill forecast reflect one subscription? A short confirmation or redacted screenshot is enough.

      I had my agent spin this PR up to test with my two environments using the same Cursor account.

      Screenshot 2026-11-29 at 15 27 36

      It's now showing as a single bar, instead of the split per environment.

    8. @juliusmarminge Tombell tested the PR build with the two linked environments from #45237 and confirmed that Usage → Limits now shows a single Cursor bar with one reset countdown. We verified that separate accounts stay separate using mocked responses. Is that enough to proceed with manual review? Tombell’s confirmation and screenshot

    9. With the Grok Build changes to Cursor, I don't think this is needed anymore, as I am getting a single usage bar for both environments.

      Screenshot 2026-12-03 at 00 50 09
    10. @tombell Thanks for checking! Were both environments still using their original sign-ins when you tested Grok Build? The current code still relies on Cursor returning an account email to combine those bars. If you already know whether Cursor still omits the email in your setup, that would help us decide whether to close this.

Sign in to join this conversation.