Skip to content

Commit ac5cf3b

Browse files
authored
feat(chat): Call LLM to get response of shell command rejection (aws#6966)
## Problem - after user click the reject button of running shell command, we call LLM to get response of shell command rejection ## Solution ![image](https://github.com/user-attachments/assets/7ee4ad3f-44df-4941-80b3-c33dcbc9919f) --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 1deeeac commit ac5cf3b

File tree

1 file changed

+13
-0
lines changed
  • packages/core/src/codewhispererChat/controllers/chat

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,18 @@ export class ChatController {
803803
type: 'chat_message',
804804
context: undefined,
805805
})
806+
807+
const session = this.sessionStorage.getSession(message.tabID!)
808+
const currentToolUse = session.toolUseWithError?.toolUse
809+
if (currentToolUse && currentToolUse.name === ToolType.ExecuteBash) {
810+
session.toolUseWithError.error = new Error('Tool use was rejected by the user.')
811+
} else {
812+
getLogger().error(
813+
`toolUse name: ${currentToolUse!.name} of toolUseWithError in the stored session doesn't match when click shell command reject button.`
814+
)
815+
return
816+
}
817+
806818
await this.generateStaticTextResponse('reject-shell-command', triggerId)
807819
}
808820

@@ -824,6 +836,7 @@ export class ChatController {
824836
break
825837
case 'reject-shell-command':
826838
await this.rejectShellCommand(message)
839+
await this.processToolUseMessage(message)
827840
break
828841
default:
829842
getLogger().warn(`Unhandled action: ${message.action.id}`)

0 commit comments

Comments
 (0)