mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-04-28 03:49:31 +00:00
fix(cursor): use real API key instead of dummy spawn-proxy value (#3169)
Cursor CLI validates CURSOR_API_KEY before connecting to the configured endpoint. The dummy value "spawn-proxy" fails validation immediately, causing an infinite restart loop. Use the actual OPENROUTER_API_KEY as CURSOR_API_KEY so it passes Cursor's key format check. Fixes #3166 Agent: ux-engineer Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
8e9af23c63
commit
7292ddef0e
3 changed files with 11 additions and 2 deletions
|
|
@ -299,7 +299,8 @@
|
|||
"install": "curl https://cursor.com/install -fsS | bash",
|
||||
"launch": "agent",
|
||||
"env": {
|
||||
"OPENROUTER_API_KEY": "${OPENROUTER_API_KEY}"
|
||||
"OPENROUTER_API_KEY": "${OPENROUTER_API_KEY}",
|
||||
"CURSOR_API_KEY": "${OPENROUTER_API_KEY}"
|
||||
},
|
||||
"config_files": {
|
||||
"~/.cursor/cli-config.json": {
|
||||
|
|
|
|||
|
|
@ -222,6 +222,14 @@ describe("createCloudAgents", () => {
|
|||
}
|
||||
});
|
||||
|
||||
it("cursor agent uses real API key as CURSOR_API_KEY (not a dummy value)", () => {
|
||||
const envVars = result.agents.cursor.envVars("sk-or-v1-real-key");
|
||||
const cursorKeyVar = envVars.find((v: string) => v.startsWith("CURSOR_API_KEY="));
|
||||
expect(cursorKeyVar).toBeDefined();
|
||||
// Must use the actual API key, not a dummy like "spawn-proxy"
|
||||
expect(cursorKeyVar).toBe("CURSOR_API_KEY=sk-or-v1-real-key");
|
||||
});
|
||||
|
||||
it("all agents have launchCmd returning non-empty string", () => {
|
||||
for (const agent of Object.values(result.agents)) {
|
||||
const cmd = agent.launchCmd();
|
||||
|
|
|
|||
|
|
@ -1093,7 +1093,7 @@ function createAgents(runner: CloudRunner): Record<string, AgentConfig> {
|
|||
),
|
||||
envVars: (apiKey) => [
|
||||
`OPENROUTER_API_KEY=${apiKey}`,
|
||||
"CURSOR_API_KEY=spawn-proxy",
|
||||
`CURSOR_API_KEY=${apiKey}`,
|
||||
],
|
||||
configure: () => setupCursorProxy(runner),
|
||||
preLaunch: () => startCursorProxy(runner),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue