fix(cursor): set CURSOR_API_KEY to skip browser login (#3104)

Cursor CLI requires authentication before making API calls. Without
CURSOR_API_KEY set, it falls back to browser-based OAuth which fails
because the proxy spoofs api2.cursor.sh to localhost, breaking the
OAuth callback. Setting a dummy CURSOR_API_KEY makes Cursor use the
/auth/exchange_user_api_key endpoint instead, which the proxy already
handles with a fake JWT.

Co-authored-by: spawn-bot <spawn-bot@openrouter.ai>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
A 2026-03-29 21:05:26 -07:00 committed by GitHub
parent b73761897a
commit 9892355ede
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1128,6 +1128,7 @@ function createAgents(runner: CloudRunner): Record<string, AgentConfig> {
),
envVars: (apiKey) => [
`OPENROUTER_API_KEY=${apiKey}`,
"CURSOR_API_KEY=spawn-proxy",
],
configure: () => setupCursorProxy(runner),
preLaunch: () => startCursorProxy(runner),