fix(cursor): preserve internal agent errors without transport labels #11365
main fromrefs/pull/11365/head·merged by maria-rcks View on GitHubCursor can return an internal agent-loop error as its assistant answer. T3 currently calls every RetriableError a transport failure, including [internal] Failed to run step, exceeded max retries. Preserve internal diagnostics as returned text instead of replacing their meaning with a transport label.
Refs #10480. This fixes the classification issue identified in maintainer triage; it does not repair Cursor ACP or add retries.
Validation: 42 focused parser/adapter tests pass. Both new internal-error regressions fail on the parent, including a stack trace. Targeted lint, formatting and diff checks pass. No live Cursor ACP/model request was tested. Internal Fable refinement pending.
Rebased onto main; only the diagnostic parser and its tests change.
Model and harness: GPT-6 through Codex.
Rebased on main 20363c32c9bfdbf49c2716ef11d1f18483fcc01b. Scoped validation rerun after rebasing; existing native and human review limits remain.
Summary by CodeRabbit#
- Bug Fixes
- Improved error handling so internal retryable step-failure messages are preserved as readable error details instead of being incorrectly classified as terminal transport failures.
- Continued recognizing genuine retryable and connection-related transport errors as expected.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Approvability#
Verdict: Approved at
6611910Macroscope's review found this PR approvable — This is a narrowly scoped Cursor error-classification fix with regression tests. It preserves internal agent diagnostics without changing transport-error handling, product defaults, schemas, deployment, or static-analysis configuration.
Notes:
- Diff unchanged. Approvability was decided on eligibility alone.
No code changes detected at
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).13ba4c7. Prior analysis still applies.Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire 13.5 KiB 13.6 KiB +10 B (+0.1%) 15.1 KiB ✅ Codex Thread snapshot wire 7.0 KiB 7.0 KiB −5 B (−0.1%) 7.3 KiB ✅ Codex Live turn WebSocket wire 6.5 KiB 6.5 KiB +15 B (+0.2%) 7.8 KiB ✅ Codex Live turn WebSocket decoded 57.0 KiB 57.0 KiB 0 B (0.0%) 66.4 KiB ✅ Codex Live turn messages 8 8 0 (0.0%) 21 ✅ Claude Total thread wire 13.6 KiB 13.6 KiB −39 B (−0.3%) 15.1 KiB ✅ Claude Thread snapshot wire 7.1 KiB 7.1 KiB −3 B (−0.0%) 7.3 KiB ✅ Claude Live turn WebSocket wire 6.6 KiB 6.5 KiB −36 B (−0.5%) 7.8 KiB ✅ Claude Live turn WebSocket decoded 57.9 KiB 57.8 KiB −44 B (−0.1%) 66.4 KiB ✅ Claude Live turn messages 10 9 −1 (−10.0%) 21 ✅ Baseline:
e628683· PR result:13ba4c7· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 113.9 KiB
- Claude decoded thread snapshot: 114.6 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
Independent validation of
3ab5724370bb4e7430ee9eabefa4998dd577a987(merge-base050e2cafb144).Checked the internal-error diagnostic at every possible two-chunk stream split, with LF/CRLF and optional stack trace: 354 cases. This revision preserved the diagnostic in every case; the merge-base classified every case as a transport failure. Unavailable, aborted, and deadline-exceeded transport diagnostics still classified as failures. Assertions were made after the complete diagnostic arrived.
Reproduction scripts and recorded results —
first.mjs; the numbered metadata file pins this PR’s tested revisions.Model: GPT-6. Harness: Codex.
github-actions[bot](GitHub profile, opens in a new tab) added labels📱 Native Change
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
a6b87bab-6106-4970-94b0-176662026de9📥 Commits
Reviewing files that changed from the base of the PR and between 20363c32c9bfdbf49c2716ef11d1f18483fcc01b and 661191036167effa0cbf8630c284a9327cd18071.
📒 Files selected for processing (2)
apps/server/src/provider/acp/CursorTransportFailure.test.tsapps/server/src/provider/acp/CursorTransportFailure.ts
Limit details: You’ve used all 10 included reviews currently available.
📝 Walkthrough
Walkthrough#
The transport-error matcher now excludes
RetriableErrordiagnostics containing[internal]. Regression tests cover internal failures with and without stack traces.Changes#
Cursor transport classification
Layer / File(s) Summary Exclude internal retriable failures
apps/server/src/provider/acp/CursorTransportFailure.ts,apps/server/src/provider/acp/CursorTransportFailure.test.tsThe matcher rejects RetriableErrordiagnostics containing[internal]. Tests verify this behavior with and without stack traces while preserving other transport-error classifications.Priority: ⬇️ Low
Estimated code review effort: 1 (Trivial) | ~5 minutes
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
13ba4Internal agent-loop diagnostics retain their diagnostic text, and no concrete current-head merge-blocking risk is identified.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2… Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request. Title check ✅ Passed The title clearly and concisely describes the main change: preserving Cursor internal agent errors without classifying them as transport failures. Description check ✅ Passed The description explains what changed, why it changed, scope limits, validation results, and testing limitations. It does not include the template headings or checklist, but the required information i… ✨ Finishing Touches
📝 Generate docstrings
- Create stacked PR
- Commit on current branch
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch `fix/cursor-internal-error-classification`
Comment `@coderabbitai help` to get the list of available commands.maria-rcks merged this9bf349c
maria-rcks closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed