Pause DAG runner idle timeout during SDK reconnect - #62
Open
rajarshidattapy wants to merge 4 commits into
Open
rajarshidattapy wants to merge 4 commits into
rajarshidattapy wants to merge 4 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
…cal option. onConnectionStateChange is not forwarded on LocalAgentOptions, so the reconnect flag never flipped. Co-authored-by: Cursor <cursoragent@cursor.com>
Counting every decision=RETRY left isRetrying stuck after a reconnect that retried twice or ended in THROW. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
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 e1d79ae. Configure here.
Unlabeled Request successful / Error not retryable was clearing every in-flight reconnect. Co-authored-by: Cursor <cursoragent@cursor.com>
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
ERROR.onConnectionStateChangereportsreconnecting, and still honor the hard task deadline..cursor/skills/dag-task-runnerskill.Fixes #59
Test plan
cd sdk/dag-task-runner && pnpm test(3/3)pnpm typecheckNote
Medium Risk
Runner timing and global console patching affect all in-flight DAG tasks; mis-parsed SDK logs could leave idle timeout paused or tasks still failing on long retries, but behavior is covered by new tests and hard deadlines remain.
Overview
Fixes false ERRORs when the Cursor SDK retries transport stalls and the model stream goes quiet during reconnect.
Idle timeout behavior replaces the old fixed
withTimeoutrace withwithIdleTimeout, which only counts stream silence toward--stream-idle-timeout-mswhen the runner is not in an SDK retry. The per-task deadline (--task-timeout-ms) still applies during retries. Stream iteration and post-streamwait()both use this helper.Reconnect detection adds
createSdkReconnectProbe, which temporarily wrapsconsole.log/warn/infoto infer retry state from SDK diagnostics (AGENT_ERROR_DIAGNOSTICSdecision=RETRY/THROW,[nal_agent_retries]lines), keyed byoriginalRequestIdfor parallel tasks. Local agents are created withenableAgentRetries: true.@cursor/sdkis bumped to ^1.0.30 (lockfile slimmed; Node >=22.13 on the SDK).Changes are mirrored in
.cursor/skills/dag-task-runner; skill docs note that idle timeout pauses while reconnecting. Removesdisable-model-invocationfrom the skill frontmatter. Addspnpm testcovering idle timeout and reconnect probe edge cases.Reviewed by Cursor Bugbot for commit de8aa9e. Bugbot is set up for automated code reviews on this repo. Configure here.