Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at 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. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
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 asstatus: "success"and only carries the failure inexitCode.cursorToolFailedlooked only atstatus: "error"and MCPisError.The web and mobile work log already check
exitCodefirst, so the icon is usually right. But the thread timeline returned byt3_thread_read(OrchestratorMcpService.timelineItem) gives each item's storedstatus, and its command text ($ cmdplus output) has no exit code. An agent reading a delegated Cursor thread sees the failed run ascompleted. Codex, Claude, Grok and ACP all storefailedfor the same command.Change
cursorToolFailednow treats a shell result with a non-zeroexitCodeas failed, the same check Grok uses (xaiAcpExtension.ts: non-zero exitCode ->failed). Both the execution node and thecommand_executionturn item take their status from this function. Other tool types are unaffected. Nested subagent shell results already map a rawfailureto 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
projects Cursor tasks and unfinished toolscase failed in all 5 rows with- "shell-exit-1": "failed"/+ "shell-exit-1": "completed".vp test run src/server/adapter.test.tsinpackages/provider-cursorgives 21/21 passed.apps/serverCursorReplayFixtures.integration.test.tsgives 11/11 passed.vp run check:changed: format, lint, knip, typecheck (10 packages) and tests all pass.@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