fix(cursor): recover from cursor agent http/2 transport drops - #565
Merged
Merged
Conversation
Cursor Agent writes RetriableError envelopes (PING timed out, NGHTTP2_INTERNAL_ERROR, generic [unavailable]/[internal], resource_exhausted) either on stderr or as the last line of an ACP assistant text chunk that still answers session/prompt with end_turn, so drops were recorded as finished answers. Classify the envelope from both stderr and last-line assistant text, strip the raw envelope from the transcript, end the turn as runtime_failure, and stop appending agent login help to transport/capacity failures. A last-line stream_drop gets one same-session continuation; capacity does not auto-retry. Surface a transport recovery notice so a terminal drop offers Resume.
astyfx
requested review from
JongSikLim and
schang124
and removed request for
a team
September 21, 2026 08:30
|
| CVE | Package | Version |
|---|---|---|
| CVE-2026-76172 | fast-uri |
3.1.0 |
| CVE-2026-13676 | fast-uri |
3.1.0 |
| CVE-2026-16221 | fast-uri |
3.1.0 |
| CVE-2026-75975 | fast-uri |
3.1.0 |
| CVE-2026-6321 | fast-uri |
3.1.0 |
| CVE-2026-18446 | fast-uri |
3.1.0 |
| CVE-2026-6322 | fast-uri |
3.1.0 |
View full analysis in Upwind Console
Scan completed in 17s
Scan history (2 scans)
| Commit | Scanned at | New | Resolved | Net |
|---|---|---|---|---|
cb8ff43 |
2026-09-21 08:30 UTC | 0 | -7 | -7 |
1181170 < |
2026-09-21 08:43 UTC | 0 | -7 | -7 |
Last scanned: 1181170 · 2026-09-21 08:43 UTC
|
| Commit | Scanned at | New | Resolved | Net |
|---|---|---|---|---|
cb8ff43 |
2026-09-21 08:30 UTC | 0 | 0 | 0 |
1181170 < |
2026-09-21 08:44 UTC | 0 | 0 | 0 |
Last scanned: 1181170 · 2026-09-21 08:44 UTC
astyfx
enabled auto-merge (squash)
September 21, 2026 08:30
…accessor The main-process typecheck (typecheck:lens-main) narrowed agentTextTransportFailure to null at its read sites because it is only assigned inside the onNotification closure, which control-flow analysis does not treat as reachable, producing TS2339 on .retryable. Read the state through a typed accessor so access sites use the declared type.
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
Recover from Cursor Agent HTTP/2 transport drops that the CLI reports as
RetriableErrorenvelopes, so a dropped stream ends as a real failure with a Resume path instead of being recorded as a finished answer.Changes
Fixes
RetriableErrorenvelopes (PING timed out,NGHTTP2_INTERNAL_ERROR, generic[unavailable]/[internal],[resource_exhausted]) from both stderr and the last line of an ACP assistant text chunk that still answerssession/promptwithend_turn.runtime_failureand strip the rawRetriableErrorline from the transcript instead of keeping it as assistant text.agent loginhelp to transport/capacity failures; a last-linestream_dropgets one same-session continuation, while capacity does not auto-retry.data-provider-error="transport") so a terminal drop offers Resume.Test Evidence
bun run typecheck: clean (tsc --noEmit).bun test tests/cursor-agent-transport.test.ts tests/cursor-acp-runtime.test.ts tests/provider-error-recovery.test.ts: 37 pass / 0 fail (113 assertions), covering stderr and assistant-text PING/NGHTTP2 classification, same-session continuation, capacity no-retry, prose-mention false-positive guard, envelope stripping, and recovery eligibility.Notes
agent acpprocess, not ACP. This PR is recovery (classify + continue/Resume), not prevention.package.jsonchanges; the license gate is not applicable to this diff.