Walkthrough
Cursor authentication now exposes stored browser-login status. The driver passes that login to usage-limit retrieval, which exchanges valid credentials for an access token and requests usage. Tests cover browser-login and configured API-key paths, including expired credentials and request failures.
Changes: Cursor browser-login usage limits
Layer / File(s) Summary Stored-login state
packages/provider-cursor/src/server/auth.tsAuthentication exposes stored credentials as valid or expired. When no configured API key exists, readApiKeyreturns a key only from a valid stored login.Browser-login usage requests
packages/provider-cursor/src/server/usageLimits.ts,packages/provider-cursor/src/server/usageLimits.test.tsUsage retrieval accepts a stored login, validates its backend URL, exchanges its API key for an access token, and requests usage. Tests cover expired logins, rejected exchanges, and request failures. Driver authentication and refresh
packages/provider-cursor/src/server/driver.ts,packages/provider-cursor/src/server/driver.test.tsThe driver selects credentials by authentication mode and passes stored-login state to usage retrieval. Tests cover refresh behavior, expired credentials, and configured API-key mode. Priority: External image Normal
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Bug fix
Sequence Diagram(s)
mermaid1 sequenceDiagram 2 participant CursorDriver 3 participant CursorAuth 4 participant readCursorUsageLimits 5 participant CursorBackend 6 CursorDriver->>CursorAuth: Read stored login 7 CursorAuth-->>CursorDriver: Valid or expired login 8 CursorDriver->>readCursorUsageLimits: Pass stored login 9 readCursorUsageLimits->>CursorBackend: Exchange API key for access token 10 CursorBackend-->>readCursorUsageLimits: Return access token 11 readCursorUsageLimits->>CursorBackend: Request usage with access token 12 CursorBackend-->>readCursorUsageLimits: Return usage response Possibly related issues
- pingdotgg/t3code#19008: Reports missing Cursor Limits data for stored browser or CLI logins; this change exchanges a stored browser-login key before requesting usage.
Possibly related PRs
- pingdotgg/t3code#24443: Changes the same driver authentication path to avoid passing browser credentials as
CURSOR_API_KEY; this PR instead passes the stored login for credential exchange. - pingdotgg/t3code#26262: Changes the provider status return shape used by
checkProvider, which this PR also updates.
Suggested labels:
size:MSuggested reviewers:
juliusmarminge,t3dotgg,macroscopeapp
Merge Risk: External image Low · up to f424f
A rejected usage request can leave an old limits reading visible. This is a bounded issue, but the rejection should clear the reading before merge if feasible.
Pre-merge checks: Passed 4
Check name Status Explanation Description check Passed The description includes all required sections. It clearly explains the problem, the implementation, scope approval, focused verification, limitations, and agent details. Title check Passed The title clearly summarizes the main change: restoring usage limits for Cursor accounts authenticated through browser sign-in. Linked Issues check Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
🧪 Generate unit tests (beta)
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.