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 {
894
894
currentToolUse . name === ToolType . ListDirectory )
895
895
) {
896
896
session . toolUseWithError . error = new Error ( 'Tool use was rejected by the user.' )
897
+ session . setToolUseWithError ( undefined )
898
+ this . messenger . sendAsyncEventProgress ( message . tabID ! , false , undefined )
897
899
} else {
898
900
getLogger ( ) . error (
899
901
`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 {
928
930
case 'reject-shell-command' :
929
931
case 'reject-tool-use' :
930
932
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
+ }
932
939
break
933
940
default :
934
941
getLogger ( ) . warn ( `Unhandled action: ${ message . action . id } ` )
935
942
}
936
943
}
937
944
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
+
938
951
private async restoreBackup ( message : CustomFormActionMessage ) {
939
952
const tabID = message . tabID
940
953
const toolUseId = message . action . formItemValues ?. toolUseId
You can’t perform that action at this time.
0 commit comments