File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
packages/core/src/codewhispererChat Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -753,14 +753,19 @@ export class ChatController {
753753 const output = await ToolUtils . invoke ( tool , chatStream )
754754 ToolUtils . validateOutput ( output , tool . type )
755755
756+ let status : ToolResultStatus = ToolResultStatus . SUCCESS
757+ if ( output . output . success === false ) {
758+ status = ToolResultStatus . ERROR
759+ }
760+
756761 toolResults . push ( {
757762 content : [
758763 output . output . kind === OutputKind . Text
759764 ? { text : output . output . content }
760765 : { json : output . output . content } ,
761766 ] ,
762767 toolUseId : toolUse . toolUseId ,
763- status : ToolResultStatus . SUCCESS ,
768+ status,
764769 } )
765770 } catch ( e : any ) {
766771 toolResults . push ( {
Original file line number Diff line number Diff line change @@ -311,6 +311,7 @@ export class ExecuteBash {
311311 const exitStatus = result . exitCode ?? 0
312312 const stdout = stdoutBuffer . join ( '\n' )
313313 const stderr = stderrBuffer . join ( '\n' )
314+ const success = exitStatus === 0 && ! stderr
314315 const [ stdoutTrunc , stdoutSuffix ] = ExecuteBash . truncateSafelyWithSuffix (
315316 stdout ,
316317 maxBashToolResponseSize / 3
@@ -330,6 +331,7 @@ export class ExecuteBash {
330331 output : {
331332 kind : OutputKind . Json ,
332333 content : outputJson ,
334+ success,
333335 } ,
334336 } )
335337 } catch ( err : any ) {
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export interface InvokeOutput {
1919 output : {
2020 kind : OutputKind
2121 content : string | any
22+ success ?: boolean
2223 }
2324}
2425
You can’t perform that action at this time.
0 commit comments