From 9892355edefa9eebcb69103b1fb07e4c54919078 Mon Sep 17 00:00:00 2001 From: A <258483684+la14-1@users.noreply.github.com> Date: Sun, 29 Mar 2026 21:05:26 -0700 Subject: [PATCH] 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 Co-authored-by: Claude Opus 4.6 (1M context) --- packages/cli/src/shared/agent-setup.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/cli/src/shared/agent-setup.ts b/packages/cli/src/shared/agent-setup.ts index fff4406b..1d0f86a6 100644 --- a/packages/cli/src/shared/agent-setup.ts +++ b/packages/cli/src/shared/agent-setup.ts @@ -1128,6 +1128,7 @@ function createAgents(runner: CloudRunner): Record { ), envVars: (apiKey) => [ `OPENROUTER_API_KEY=${apiKey}`, + "CURSOR_API_KEY=spawn-proxy", ], configure: () => setupCursorProxy(runner), preLaunch: () => startCursorProxy(runner),