Skip to content

Commit f0f0f01

Browse files
committed
When user reject executing command, loop will be terminated, reject won't send to LLM
1 parent 5dac164 commit f0f0f01

File tree

1 file changed

+12
-1
lines changed
  • packages/core/src/codewhispererChat/controllers/chat

1 file changed

+12
-1
lines changed

packages/core/src/codewhispererChat/controllers/chat/controller.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,13 +928,24 @@ export class ChatController {
928928
case 'reject-shell-command':
929929
case 'reject-tool-use':
930930
await this.rejectShellCommand(message)
931-
await this.processToolUseMessage(message)
931+
if (message.tabID) {
932+
await this.sendCommandRejectMessage(message.tabID)
933+
}
934+
if (message.triggerId) {
935+
ConversationTracker.getInstance().markTriggerCompleted(message.triggerId)
936+
}
932937
break
933938
default:
934939
getLogger().warn(`Unhandled action: ${message.action.id}`)
935940
}
936941
}
937942

943+
private async sendCommandRejectMessage(tabID: string) {
944+
const session = this.sessionStorage.getSession(tabID)
945+
session.setAgenticLoopInProgress(false)
946+
this.messenger.sendDirectiveMessage(tabID, '', 'Command Rejected')
947+
}
948+
938949
private async restoreBackup(message: CustomFormActionMessage) {
939950
const tabID = message.tabID
940951
const toolUseId = message.action.formItemValues?.toolUseId

0 commit comments

Comments
 (0)