Skip to content

fix(cursor-proxy): skip proxy setup when running on local cloud#3424

Closed
aulorbe wants to merge 2 commits into
mainfrom
fix/cursor-proxy-local-guard
Closed

fix(cursor-proxy): skip proxy setup when running on local cloud#3424
aulorbe wants to merge 2 commits into
mainfrom
fix/cursor-proxy-local-guard

Conversation

@aulorbe
Copy link
Copy Markdown
Collaborator

@aulorbe aulorbe commented May 20, 2026

Summary

  • Guard cursor proxy against local execution: setupCursorProxy and startCursorProxy modify /etc/hosts and install system-level services (Caddy, Node proxy scripts) assuming they run on a remote VM. When the local cloud runner is used (spawn local cursor), these commands execute directly on the host machine, breaking the user's real Cursor installation by redirecting api2.cursor.sh to 127.0.0.1 and overwriting CURSOR_API_KEY with an OpenRouter key.
  • Fix: Thread an isLocal flag from local/agents.ts through createCloudAgentscreateAgents → cursor agent config closures. Both proxy functions now short-circuit with a warning when isLocal is true.

Test plan

  • cursor-proxy.test.ts passes (proxy setup/start tests unaffected — they use a mock runner, not local)
  • Biome lint clean

Copy link
Copy Markdown
Collaborator Author

aulorbe commented May 20, 2026

@aulorbe aulorbe force-pushed the fix/cursor-proxy-local-guard branch from 475ef82 to 348d71a Compare May 20, 2026 23:35
@aulorbe aulorbe changed the base branch from main to graphite-base/3424 May 20, 2026 23:39
@aulorbe aulorbe force-pushed the fix/cursor-proxy-local-guard branch from 348d71a to 5f193ec Compare May 20, 2026 23:39
@aulorbe aulorbe changed the base branch from graphite-base/3424 to fix/do-test-flaky-assertion May 20, 2026 23:39
@aulorbe aulorbe marked this pull request as ready for review May 20, 2026 23:56
@aulorbe aulorbe requested a review from louisgv May 20, 2026 23:56
@louisgv louisgv changed the base branch from fix/do-test-flaky-assertion to graphite-base/3424 May 21, 2026 00:13
louisgv
louisgv previously approved these changes May 21, 2026
@louisgv louisgv force-pushed the graphite-base/3424 branch from cdd5fe8 to 8661ab2 Compare May 21, 2026 00:13
@louisgv louisgv force-pushed the fix/cursor-proxy-local-guard branch from 5f193ec to 4f96dbc Compare May 21, 2026 00:13
@graphite-app graphite-app Bot changed the base branch from graphite-base/3424 to main May 21, 2026 00:14
@graphite-app graphite-app Bot dismissed louisgv’s stale review May 21, 2026 00:14

The base branch was changed.

setupCursorProxy and startCursorProxy modify /etc/hosts and install
system services assuming they're on a remote VM. When the local cloud
runner is used (spawn local cursor), these run directly on the host,
breaking the user's real Cursor installation. Add an isLocal guard
that short-circuits both functions when running locally.

Also fix flaky digitalocean-token test assertion (toBe(2) → toBeGreaterThanOrEqual(2)).
@louisgv louisgv force-pushed the fix/cursor-proxy-local-guard branch from 4f96dbc to 7a5cf90 Compare May 21, 2026 00:14
- Detect OS/arch at runtime for cross-platform Caddy installation
- Install Caddy to ~/.local/bin (user-writable on all platforms)
- Fix /etc/hosts configuration to work on both macOS and Linux
- Replace setsid (Linux-only) with nohup (POSIX)
- Ensure ~/.local/bin is in PATH for Caddy commands
- Add comprehensive comments explaining platform-specific choices

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
@aulorbe aulorbe closed this May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants