File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
packages/core/src/codewhispererChat/controllers/chat Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -894,6 +894,8 @@ export class ChatController {
894894 currentToolUse . name === ToolType . ListDirectory )
895895 ) {
896896 session . toolUseWithError . error = new Error ( 'Tool use was rejected by the user.' )
897+ session . setToolUseWithError ( undefined )
898+ this . messenger . sendAsyncEventProgress ( message . tabID ! , false , undefined )
897899 } else {
898900 getLogger ( ) . error (
899901 `toolUse name: ${ currentToolUse ! . name } of toolUseWithError in the stored session doesn't match when click shell command reject button.`
@@ -928,13 +930,24 @@ export class ChatController {
928930 case 'reject-shell-command' :
929931 case 'reject-tool-use' :
930932 await this . rejectShellCommand ( message )
931- await this . processToolUseMessage ( message )
933+ if ( message . tabID ) {
934+ await this . sendCommandRejectMessage ( message . tabID )
935+ }
936+ if ( message . triggerId ) {
937+ ConversationTracker . getInstance ( ) . markTriggerCompleted ( message . triggerId )
938+ }
932939 break
933940 default :
934941 getLogger ( ) . warn ( `Unhandled action: ${ message . action . id } ` )
935942 }
936943 }
937944
945+ private async sendCommandRejectMessage ( tabID : string ) {
946+ const session = this . sessionStorage . getSession ( tabID )
947+ session . setAgenticLoopInProgress ( false )
948+ this . messenger . sendDirectiveMessage ( tabID , '' , 'Command Rejected' )
949+ }
950+
938951 private async restoreBackup ( message : CustomFormActionMessage ) {
939952 const tabID = message . tabID
940953 const toolUseId = message . action . formItemValues ?. toolUseId
You can’t perform that action at this time.
0 commit comments