Where does the bug appear (feature/product)?
Cursor SDK
Describe the Bug
Local @cursor/sdk 1.0.37 agent streams end with Connection stalled / connection_stalled after exactly 30 seconds with no inbound frames. Two runs of the same agent produced a steady thinking stream, then stopped. The gaps from the last thinking event to the error were 30.009s and 30.016s. An earlier 31.8s gap with no public events, before the first thinking token of the second run, did not stall. Client heartbeats every 5 seconds do not reset the SDK 30,000ms inbound-activity watchdog; server heartbeats do. enableAgentRetries is false. No API keys, prompts, or private reasoning are included.
Steps to Reproduce
- Node 24.16.0, @cursor/sdk 1.0.37, local runtime, sandbox enabled, enableAgentRetries=false. Agent.resume keeps the original agent and workspace and uses a copied JsonlLocalAgentStore with custom tools only.
- Model: Grok 4.7 High, 256k context, fast=false. API host: api2.cursor.sh.
- Request abbb805d-32fd-4828-9729-d2d660903ba2, run run-cfb29809-781a-4e18-9abb-500ab4760087: 719 thinking events and 26 tool calls fully returned. Last thinking 2026-10-12T07:30:40.596Z. Error 2026-10-12T07:31:10.605Z.
- Request 780006f8-d517-4443-8a28-de52b8129228, run run-04774591-1d75-4a04-b288-ebbd4ae0d7ba: 250 thinking events over about 206 seconds, zero tool calls. Last thinking 2026-10-12T14:20:57.930Z. Error 2026-10-12T14:21:27.946Z.
Agent ID: agent-5eb7a0e5-1d66-417f-8485-ef41c05e4bb6. The installed SDK already contains the 29-second HTTP/2 idle close and 59-second ping changes from the 1.0.34 notes.
Expected Behavior
A stream that is still receiving server heartbeat frames should continue when public content events pause. The second run already survived a 31.8s public-event gap before the first thinking token. If inbound frames truly stop, the error should say whether the close came from the client 30s watchdog or from a server reset.
Operating System
MacOS
Version Information
macOS, Node 24.16.0, @cursor/sdk 1.0.37, local runtime. API key name on this forum account: Codex Cursor executor.
For AI issues: which model did you use?
grok-4.7, context 256k, reasoning high, fast=false
For AI issues: add Request ID with privacy disabled
abbb805d-32fd-4828-9729-d2d660903ba2
780006f8-d517-4443-8a28-de52b8129228
Additional Information
Please trace both request IDs and answer:
- After the last thinking event on each request, did the server keep sending heartbeat frames? When was the last frame sent, and was the close a client watchdog cancel or a server reset?
- Was the model upstream still generating, stalled, or already closed at 07:31:10.605Z and 14:21:27.946Z?
- Which Http2Config applied: FORCE_BIDI_ENABLED, FORCE_BIDI_DISABLED, or UNSPECIFIED?
- Is there a supported fix other than enabling broad agent retries? enableAgentRetries also retries other connection failures, so it is still off.
The same agent, model, and task are retained. The production run has not been retried.
Does this stop you from using Cursor
Sometimes - I can sometimes use Cursor