fix(cursor-proxy): fix double-wrapped Result hiding setup failures#3428
Merged
Conversation
The error handling in setupCursorProxy and startCursorProxy used asyncTryCatchIf(isOperationalError, () => wrapSshCall(...)) which double-wrapped the Result: wrapSshCall returns Err() on failure (doesn't throw), so asyncTryCatchIf always saw a successful return and wrapped it in Ok(Err(...)). This meant result.ok was always true, causing misleading output like "Cursor proxy started" even when every step failed. Fix: call wrapSshCall directly and check its returned Result. Also adds macOS DNS cache flush after /etc/hosts modification and early-return on deploy/hosts failure with accurate warning messages.
Collaborator
Author
AhmedTMM
approved these changes
May 21, 2026
…s used (#3429) * fix(cli): inject SPAWN_CLI_DIR in dev script so local source is always used Without SPAWN_CLI_DIR, `bun run dev` downloads the spawn script from the published CDN release, ignoring any local source changes. This is especially confusing when developing on a branch with fixes that haven't been published yet. Set SPAWN_CLI_DIR to the repo root (via git rev-parse) in the dev script so the local checkout is always used during development. * docs(cursor): add model picker and provider notes for local spawn (#3431) Add a section to sh/local/README.md noting that the "Custom model" setup option must be selected to get the OpenRouter model picker when spawning Cursor locally, and that only Cursor IDE-supported providers work (linking to Cursor's supported providers docs).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Fixes misleading proxy setup output where every step reports success even when it fails. For example, a completely broken setup would print:
…and similarly "Caddy available" after Caddy install fails, "Hosts spoofing configured" after
/etc/hosts: Permission denied, etc.Root cause
setupCursorProxyandstartCursorProxyusedasyncTryCatchIf(isOperationalError, () => wrapSshCall(...)), which double-wraps theResult.wrapSshCallalready catches errors and returnsErr()(it doesn't throw), soasyncTryCatchIfalways sees a successful return and wraps it inOk(Err(...)). Checkingresult.okon the outer wrapper is alwaystrue— the error branch is unreachable.Fix
wrapSshCalldirectly and check its returnedResult(removeasyncTryCatchIfwrapper).dscacheutil -flushcache+killall -HUP mDNSResponder) after/etc/hostsmodification to prevent stale DNS from bypassing the proxy.Stacked on
cursor-proxy/model-selection←cursor-proxy/macos-compat.Test plan
bun test src/__tests__/cursor-proxy.test.ts— all 13 tests passbunx @biomejs/biome check src/shared/cursor-proxy.ts— zero errorsSPAWN_CLI_DIR=. bun run devlocally, verify failure messages are accurate when a step fails