@@ -91,7 +91,7 @@ import {
9191 workspaceChunkMaxSize ,
9292 defaultContextLengths ,
9393} from '../../constants'
94- import { ChatSession } from '../../clients/chat/v0/chat'
94+ import { ChatSession , ToolUseWithError } from '../../clients/chat/v0/chat'
9595import { amazonQTabSuffix } from '../../../shared/constants'
9696import { OutputKind } from '../../tools/toolShared'
9797import { ToolUtils , Tool , ToolType } from '../../tools/toolUtils'
@@ -806,6 +806,17 @@ export class ChatController {
806806 type : 'chat_message' ,
807807 context : undefined ,
808808 } )
809+
810+ const toolUseWithError : ToolUseWithError = {
811+ toolUse : {
812+ name : ToolType . ExecuteBash ,
813+ input : message . action . text ,
814+ toolUseId : message . action . formItemValues ?. toolUseId ,
815+ } ,
816+ error : new Error ( 'Tool use was rejected by the user.' ) ,
817+ }
818+ const session = this . sessionStorage . getSession ( message . tabID ! )
819+ session . setToolUseWithError ( toolUseWithError )
809820 await this . generateStaticTextResponse ( 'reject-shell-command' , triggerId )
810821 }
811822
@@ -827,6 +838,7 @@ export class ChatController {
827838 break
828839 case 'reject-shell-command' :
829840 await this . rejectShellCommand ( message )
841+ await this . processToolUseMessage ( message )
830842 break
831843 default :
832844 getLogger ( ) . warn ( `Unhandled action: ${ message . action . id } ` )
0 commit comments