Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(cursor): preserve internal agent errors without transport labels #11365

Mergedshivamhwp(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/11365/headmerged by maria-rcks View on GitHub

Cursor 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

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at 6611910

      Macroscope'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 13ba4c7. Prior analysis still applies.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire13.5 KiB13.6 KiB+10 B (+0.1%)15.1 KiB✅
      CodexThread snapshot wire7.0 KiB7.0 KiB−5 B (−0.1%)7.3 KiB✅
      CodexLive turn WebSocket wire6.5 KiB6.5 KiB+15 B (+0.2%)7.8 KiB✅
      CodexLive turn WebSocket decoded57.0 KiB57.0 KiB0 B (0.0%)66.4 KiB✅
      CodexLive turn messages880 (0.0%)21✅
      ClaudeTotal thread wire13.6 KiB13.6 KiB−39 B (−0.3%)15.1 KiB✅
      ClaudeThread snapshot wire7.1 KiB7.1 KiB−3 B (−0.0%)7.3 KiB✅
      ClaudeLive turn WebSocket wire6.6 KiB6.5 KiB−36 B (−0.5%)7.8 KiB✅
      ClaudeLive turn WebSocket decoded57.9 KiB57.8 KiB−44 B (−0.1%)66.4 KiB✅
      ClaudeLive turn messages109−1 (−10.0%)21✅

      Baseline: e628683 · PR result: 13ba4c7 · Source CI: success

      Scenario 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.

    4. Independent validation of 3ab5724370bb4e7430ee9eabefa4998dd577a987 (merge-base 050e2cafb144).

      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.

    5. github-actions[bot](GitHub profile, opens in a new tab) added labels📱 Native Change

    6. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review Change StackReview Change Stack

      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.ts
      • apps/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 RetriableError diagnostics 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.ts
      The matcher rejects RetriableError diagnostics 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 13ba4

      Internal 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 nameStatusExplanation
      Docstring Coverage✅ PassedNo 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✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Title check✅ PassedThe title clearly and concisely describes the main change: preserving Cursor internal agent errors without classifying them as transport failures.
      Description check✅ PassedThe 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.
    7. maria-rcks merged this9bf349c

    8. maria-rcks closed this

Sign in to join this conversation.