fix(server): treat Cursor API keys as authenticated - #7245
Conversation
Cursor CLI documents CURSOR_API_KEY as a first-class login. T3 only looked at agent about userEmail and always sent ACP cursor_login, which opens a browser. Accept the key on the about probe and skip that authenticate call when it is set. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The Cursor API-key fix belongs in the provider probe, not the install copy. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
Updates the Cursor provider integration so API-key-only Cursor CLI setups (CURSOR_API_KEY) are treated as authenticated, preventing T3 Code from incorrectly reporting “logged out” and from triggering ACP authenticate (which can try to open a browser). This aligns T3 Code’s behavior with Cursor CLI’s documented auth flow and addresses #7244.
Changes:
- Treat
CURSOR_API_KEYas an authenticated state for the Cursor provider “about” probe. - Skip ACP
authenticatefor Cursor whenCURSOR_API_KEYis present to avoid interactive login attempts. - Update install docs/README and add unit tests around the new API-key auth behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents Cursor auth as agent login or CURSOR_API_KEY. |
| docs/user/install.md | Updates provider install/auth guidance and links Cursor auth docs. |
| apps/server/src/provider/Layers/CursorProvider.ts | Adds CURSOR_API_KEY detection, upgrades auth state when key is present, and passes skipAuthenticate into ACP runtime(s). |
| apps/server/src/provider/Layers/CursorProvider.test.ts | Updates expected messages and adds tests for the API-key auth upgrade behavior. |
| apps/server/src/provider/acp/CursorAcpSupport.ts | Propagates skipAuthenticate into Cursor ACP runtime construction. |
| apps/server/src/provider/acp/AcpSessionRuntime.ts | Adds optional skipAuthenticate flag to conditionally omit ACP authenticate. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e4b7212. Configure here.
ApprovabilityVerdict: Needs human review This PR modifies authentication behavior by enabling API key-based authentication and skipping the authenticate step when CURSOR_API_KEY is set. Authentication flow changes are sensitive and warrant human review regardless of implementation simplicity. You can customize Macroscope's approvability policy. Learn more. |
Unknown or unverifiable agent about output should stay a probe problem even when CURSOR_API_KEY is set. Co-authored-by: Cursor <cursoragent@cursor.com>

Fixes #7244.
Cursor CLI documents
CURSOR_API_KEYas a first-class login (auth docs). T3 only trustedagent aboutuserEmailand always sent ACPcursor_login, so a key-only install looked logged out and then tried to open a browser.The about probe now marks the provider ready when
CURSOR_API_KEYis set, and ACP skipsauthenticatein that case.Cursor Grok 4.6 / Cursor
Note
Treat
CURSOR_API_KEYenvironment variable as authenticated in Cursor providerapplyCursorApiKeyAuthin CursorProvider.ts that converts an unauthenticatedCursorAboutResultto anapiKeyauthenticated state whenCURSOR_API_KEYis set.skipAuthenticateoption toAcpSessionRuntimeso Cursor ACP sessions skip theauthenticateRPC whenCURSOR_API_KEYis present.set CURSOR_API_KEYas an alternative toagent login.CURSOR_API_KEYis set, even if the agentaboutprobe reports unauthenticated.Macroscope summarized 813a936.
Note
Medium Risk
Touches authentication and ACP session setup for Cursor; behavior changes when
CURSOR_API_KEYis set, but scope is limited to the Cursor provider path with unit tests covering edge cases.Overview
Cursor
CURSOR_API_KEYis now treated as valid auth whenagent aboutreports logged out, so key-only setups no longer show the provider as unauthenticated or trigger browser login via ACP.applyCursorApiKeyAuthruns after the about probe and only upgrades unauthenticated results when a non-emptyCURSOR_API_KEYis in the environment; existing interactive logins win if both are present, and unknown/unverifiable about states are unchanged. Unauthenticated help text now mentionsagent loginor settingCURSOR_API_KEY.ACP initialization gains optional
skipAuthenticate, set when an API key is present for Cursor probe and session runtimes socursor_loginauthenticate is not sent (avoiding unwanted browser flows).Reviewed by Cursor Bugbot for commit 813a936. Bugbot is set up for automated code reviews on this repo. Configure here.