GeezerVison is showing github.com — fix(cursor): shell commands that exit non-zero are recorded as failed by saphid · Pull Request #29785 · pingdotgg/t3code
Conversation
Problem
When a Cursor agent runs a shell command that exits non-zero, such as a failing test run, T3 Code stores the command and its tool node as completed. The Cursor SDK (1.2.0) reports both a successful and a failed shell result as status: "success" and only carries the failure in exitCode. cursorToolFailed looked only at status: "error" and MCP isError.
The web and mobile work log already check exitCode first, so the icon is usually right. But the thread timeline returned by t3_thread_read (OrchestratorMcpService.timelineItem) gives each item's stored status, and its command text ($ cmd plus output) has no exit code. An agent reading a delegated Cursor thread sees the failed run as completed. Codex, Claude, Grok and ACP all store failed for the same command.
Change
cursorToolFailed now treats a shell result with a non-zero exitCode as failed, the same check Grok uses (xaiAcpExtension.ts: non-zero exitCode -> failed). Both the execution node and the command_execution turn item take their status from this function. Other tool types are unaffected. Nested subagent shell results already map a raw failure to an error.
Scope and approval
Very small, focused fix for an obvious bug, so no prior issue: 4 non-test lines in one function, matching what the other adapters already do, plus one row in an existing test.
Overlap search: nothing open touches this function or Cursor shell exit status. #21448 (merged) fixed unfinished Cursor tools reported as successful, which is a different path. #26592 (merged) covered subagent ls/lint/MCP results. #29748 is Cursor text-generation error detail.
Verification
- Red on main: the extended
projects Cursor tasks and unfinished tools case failed in all 5 rows with - "shell-exit-1": "failed" / + "shell-exit-1": "completed".
- Green:
vp test run src/server/adapter.test.ts in packages/provider-cursor gives 21/21 passed. apps/server CursorReplayFixtures.integration.test.ts gives 11/11 passed.
vp run check:changed: format, lint, knip, typecheck (10 packages) and tests all pass.
- I confirmed the SDK mapping in
@cursor/sdk/dist/esm/336.js (case "success": case "failure": return {status: "success", value: {exitCode, ...}}). I didn't run a live Cursor turn.
Reviewed with sol-loop: 1 round with GPT-6.1 Sol on high. Sol verdict: approved.
Created with Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
macroscopeapp
Bot
commented
Nov 3, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Approvability
Verdict: Approved at 4f07a45
Macroscope's review found this PR approvable — Cursor shell commands that exit nonzero will now be recorded as failed despite the SDK reporting success. The change affects outcome reporting without changing command execution or output.
No code changes detected at 7bd3800. Prior analysis still applies.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 3, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
The Cursor adapter now marks shell tool results with nonzero exit codes as failed, even when the SDK result status is "success". The lifecycle test covers a command that exits with code 1.
Changes: Cursor shell failure status
| Layer / File(s) |
Summary |
Nonzero shell exit handling packages/provider-cursor/src/server/adapter.ts, packages/provider-cursor/src/server/adapter.test.ts |
cursorToolFailed treats a successful shell result with a nonzero exit code as a failure. The lifecycle test verifies that the tool node ends with status "failed". |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: sunkenintime
Merge Risk: Minimal · up to 7bd38
-
Shell commands that exit nonzero are now reported as failed instead of completed. The change is small and tested, and no actionable merge-blocking risk remains.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the main change: shell commands that exit non-zero are now recorded as failed. The raw summary says cursorToolFailed marks a shell tool call as failed when its exit code is nonzero, an… |
| Description check |
 |
The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and each section has specific content. The Problem section explains the bug and the affected … |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title names the main change: shell commands that exit non-zero are now recorded as failed. The raw summary says cursorToolFailed marks a shell tool call as failed when its exit code is nonzero, and the description confirms this. The title follows a conventional commit format and is specific.
Full details: Description check
-
Explanation
The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and each section has specific content. The Problem section explains the bug and the affected paths. The Change section explains the fix and why it matches other adapters. The Scope section explains why no issue is linked and lists overlap searches. The Verification section gives concrete test results, a red-then-green run, and a note on what was not checked. The template asks for an agent model and harness line, and the description includes one (Claude Opus 5.5 in Claude Code). Two items are weak. The Scope section does not link an issue, but it gives a reason for omitting one, as the template allows. The description also cites an SDK version and internal file paths, which is acceptable detail.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Usage-based review receipt
Note This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 4f07a45 and 7bd3800.
Files selected for processing: 2
-
packages/provider-cursor/src/server/adapter.test.ts
packages/provider-cursor/src/server/adapter.ts
Limit details: You’ve used all 10 included reviews currently available.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Review requested
| Date (UTC) |
Reviewer |
Where |
| 2026-11-13 |
Julius |
Discord DM |
Logged so this PR shows when a maintainer was asked to review it.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Evidence
Ran real Cursor (auto) against fresh, isolated dev servers on both commits. Requested exactly one node -e "process.exit(1)" execution, then asked a second Cursor thread to call t3_thread_read and quote the command timeline item. Both commands exited 1. Base stored completed in the command item, tool-call node, and MCP timeline; head stored failed in all three.
Environment: Linux, Chromium, 1280×800 CSS pixels, light theme. Images show the same crop of the real web thread pane.
Base runtime transcript · Head runtime transcript · Reproduction and collection script
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:XS
0-9 changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|