The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 14:45 UTC
fix(cursor): shell commands that exit non-zero are recorded as failed (#29785)
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Alex Southwell committed
Nov 15, 2026 at 02:36 UTC
8871c265a2be763bbbc3052b8cb75c5ac2009528
2 files changed
+24
packages/provider-cursor/src/server/adapter.test.ts
+20
@@ -166,6 +166,25 @@ describe("CursorAdapterV2", () => {
166
: {}),
167
},
168
})),
169
+ {
170
+ type: "tool-call-completed",
171
+ modelCallId: "native-model-call",
172
+ callId: "shell-exit-1",
173
+ toolCall: {
174
+ type: "shell",
175
+ args: { command: "vp test" },
176
+ result: {
177
+ status: "success",
178
+ value: {
179
+ exitCode: 1,
180
+ signal: "",
181
+ stdout: "",
182
+ stderr: "1 failed",
183
+ executionTime: 1,
184
+ },
185
+ },
186
+ },
187
+ },
188
];
189
for (const update of readUpdates) {
190
yield* input.onDelta!(update);
@@ -294,6 +313,7 @@ describe("CursorAdapterV2", () => {
313
assert.deepEqual(Object.fromEntries(finalNodes), {
314
"read-secret": unfinished,
315
"read-open": "completed",
316
+ "shell-exit-1": "failed",
317
});
318
}).pipe(
319
Effect.scoped,
packages/provider-cursor/src/server/adapter.ts
+4
@@ -379,6 +379,10 @@ function cursorToolFailed(toolCall: ToolCall): boolean {
379
if (toolCall.result?.status === "error") {
380
return true;
381
}
382
+ // The SDK reports a shell command that exits non-zero as a success.
383
+ if (toolCall.type === "shell" && toolCall.result?.status === "success") {
384
+ return toolCall.result.value.exitCode !== 0;
385
+ }
386
return toolCall.type === "mcp" && toolCall.result?.status === "success"
387
? toolCall.result.value.isError
388
: false;