Where does the bug appear (feature/product)?
Cursor SDK
Describe the Bug
I run local agents with @cursor/sdk inside a long-lived Node server. A brief network drop reset every HTTP/2 session while an agent was starting a shell command, and my whole process exited. The error came from LocalShellStreamExecutor.execute → shouldEnforceShellInvariantBlocks → checkRepoBlocked → getTeamReposOrEmptyIfNotInTeam: ConnectError “[unknown] [aborted] read ECONNRESET”. It escaped as an unhandled rejection instead of failing that tool call or the run, so Node’s default handling killed every other agent in the process. The lookup appears to run before every shell command, so any transient network error during it is fatal.
Steps to Reproduce
- Node 22 with @cursor/sdk 1.0.31: create a local agent in a git repo and send a prompt that makes it run many shell commands one at a time (e.g. “run ls 20 times, one command per tool call”).
- While it runs, make outbound HTTPS reset: sudo iptables -I OUTPUT -p tcp --dport 443 -j REJECT --reject-with tcp-reset (undo with -D).
- The next shell tool call’s blocklist lookup rejects with ConnectError ECONNRESET and the process exits on an unhandled rejection, rather than the run reporting an error.
I hit this naturally; the iptables step is how I’d expect to force it. Frames: execute (esm/357.js:1:888513) → shouldEnforceShellInvariantBlocks (357.js:1:792084) → checkRepoBlocked (357.js:1:514996) → unary (esm/401.js:1:7655).
Expected Behavior
A failed blocklist lookup should fail only that shell tool call (or apply a fail-open/fail-closed policy) and surface through the run’s result. It should never escape as an unhandled rejection that terminates the host process.
Version Information
@cursor/sdk 1.0.31, Node v22.22.1, Linux (kernel 7.0), local runtime, model claude-opus-5-5