[Bug]: Cursor API-key auth is treated as logged out
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 23k
- Forks
- 5.9k
- Avg merge
- 11h 14m
- Merged PRs (30d)
- 357
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
Cursor CLI documents API keys as a first-class auth method: https://cursor.com/docs/cli/reference/authentication
- Install Cursor CLI. Do not run
agent login. - Export a valid
CURSOR_API_KEY(or pass--api-key). See the same auth doc and https://cursor.com/docs/cli/reference/parameters - Confirm the CLI itself works:
cursor-agent modelslists models. - Confirm
cursor-agent about --format jsonreturns"userEmail": null(no saved login). - Enable the Cursor provider in T3 Code on that same machine / environment.
Expected behavior
T3 treats the official API-key session as authenticated, discovers models, and can start a Cursor thread. Same shape as Grok's XAI_API_KEY path.
Actual behavior
- Provider status is unauthenticated:
Cursor Agent is not authenticated. Run \agent login` and try again.` - After that check is satisfied, ACP model discovery fails. T3 always sends ACP
authenticatewithcursor_login, and the CLI tries to open a browser even thoughCURSOR_API_KEYis already enough forsession/newandcursor/list_available_models.
T3's Cursor probe only looks at agent about userEmail (apps/server/src/provider/Layers/CursorProvider.ts) and hardcodes authMethodId: "cursor_login" (apps/server/src/provider/acp/CursorAcpSupport.ts). It never reads CURSOR_API_KEY.
Impact
Major degradation or frequent failure
Headless / CI / API-key-only hosts cannot use Cursor in T3 even when the CLI is healthy.
Version or commit
main @ d23b181da
Environment
macOS, Cursor CLI 2026.08.11, T3 Code server driving cursor-agent
Logs or stack traces
cursor-agent about --format json
{
"cliVersion": "2026.08.11-e8db854",
"userEmail": null,
"subscriptionTier": null
}
ACP authenticate / cursor_login:
{"error":{"code":-32602,"message":"Invalid params","data":{"message":"Failed to open browser for login. Please visit: https://cursor.com/loginDeepControl?..."}}}
session/new and cursor/list_available_models succeed with the same CURSOR_API_KEY if authenticate is skipped.
Workaround
Run agent login so about has an email. That is the interactive path, not the documented API-key path.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with apps/server/src/provider/Layers/CursorProvider.ts and apps/server/src/provider/acp/CursorAcpSupport.ts, then reproduce the API-key-only flow with CURSOR_API_KEY and cursor-agent about --format json. Trace the provider authentication check and ACP authenticate request. Done means T3 recognizes the documented API-key session, discovers models, and can start a Cursor thread without opening a browser.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, authentication, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100