File tree Expand file tree Collapse file tree
packages/provider-cursor/src/server Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,6 +141,25 @@ describe("CursorAdapterV2", () => {
141141 : { } ) ,
142142 } ,
143143 } ) ) ,
144+ {
145+ type : "tool-call-completed" ,
146+ modelCallId : "native-model-call" ,
147+ callId : "shell-exit-1" ,
148+ toolCall : {
149+ type : "shell" ,
150+ args : { command : "vp test" } ,
151+ result : {
152+ status : "success" ,
153+ value : {
154+ exitCode : 1 ,
155+ signal : "" ,
156+ stdout : "" ,
157+ stderr : "1 failed" ,
158+ executionTime : 1 ,
159+ } ,
160+ } ,
161+ } ,
162+ } ,
144163 ] ;
145164 for ( const update of readUpdates ) {
146165 yield * input . onDelta ! ( update ) . pipe ( Effect . orDie ) ;
@@ -268,6 +287,7 @@ describe("CursorAdapterV2", () => {
268287 assert . deepEqual ( Object . fromEntries ( finalNodes ) , {
269288 "read-secret" : unfinished ,
270289 "read-open" : "completed" ,
290+ "shell-exit-1" : "failed" ,
271291 } ) ;
272292 } ) . pipe (
273293 Effect . scoped ,
Original file line number Diff line number Diff line change @@ -367,6 +367,10 @@ function cursorToolFailed(toolCall: ToolCall): boolean {
367367 if ( toolCall . result ?. status === "error" ) {
368368 return true ;
369369 }
370+ // The SDK reports a shell command that exits non-zero as a success.
371+ if ( toolCall . type === "shell" && toolCall . result ?. status === "success" ) {
372+ return toolCall . result . value . exitCode !== 0 ;
373+ }
370374 return toolCall . type === "mcp" && toolCall . result ?. status === "success"
371375 ? toolCall . result . value . isError
372376 : false ;
You can’t perform that action at this time.
0 commit comments