Skip to content

Export a public reconnect/retry signal for TypeScript SDK embedders - #58

Open
rajarshidattapy wants to merge 3 commits into
cursor:mainfrom
rajarshidattapy:feat/sdk-reconnect-retry-signal
Open

rajarshidattapy wants to merge 3 commits into
cursor:mainfrom
rajarshidattapy:feat/sdk-reconnect-retry-signal

Conversation

@rajarshidattapy

@rajarshidattapy rajarshidattapy commented Aug 29, 2026

Copy link
Copy Markdown

Summary

  • Headless @cursor/sdk embedders keep local.enableAgentRetries: true so stalled transport can recover, but the SDK does not export reconnect or retry state.
  • This example adds a public onConnectionStateChange hub (reconnecting / connected) and a RETRYING stream status so an idle timeout can pause during an in-progress SDK reconnect instead of looking like a dead model.
  • Closes Export a public reconnect/retry signal on the TypeScript SDK #57

Test plan

  • cd sdk/reconnect-signal && pnpm install && pnpm test
  • pnpm typecheck
  • pnpm dev prints RUNNING → reconnecting → RETRYING → connected → FINISHED
  • Optional live run: CURSOR_API_KEY=... pnpm dev -- --live

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread sdk/reconnect-signal/src/reconnect.ts
Comment thread sdk/reconnect-signal/src/reconnect.ts
… SDK stream open.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit 73faa6b. Configure here.

Comment thread sdk/reconnect-signal/src/reconnect.ts Outdated
…ging

Enhance the watchStream functionality by ensuring that cleanup does not hang if the consumer stops while in the RETRYING state. This change includes a new test case to validate the behavior, ensuring that the iterator closes properly without causing delays.
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.

Export a public reconnect/retry signal on the TypeScript SDK

1 participant