1
0
Эх сурвалжийг харах

fix(tool-bash): report foreground aborts as the TOOL_ABORTED HarnessError

Huanqi Cao 2 сар өмнө
parent
commit
12c6f43bf1

+ 5 - 1
packages/bash/tool-bash/src/index.ts

@@ -381,7 +381,11 @@ export function apply(ctx: Context, config: Config = {}): void {
         ...request,
         ...request,
         signal: exec.signal,
         signal: exec.signal,
       }))
       }))
-      if (result.aborted) throw new Error('command aborted')
+      if (result.aborted) {
+        const error = new HarnessError('tool call aborted', TOOL_ABORTED)
+        error.name = 'AbortError'
+        throw error
+      }
       return { kind: 'foreground' as const, ...canonicalBashResult(result) }
       return { kind: 'foreground' as const, ...canonicalBashResult(result) }
     },
     },
     presentCall: presentBashCall,
     presentCall: presentBashCall,