Skip to content

Commit 7f13bea

Browse files
committed
call LLM to get response of shell command rejection
1 parent c920e68 commit 7f13bea

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
@@ -806,6 +806,18 @@ export class ChatController {
806806
type: 'chat_message',
807807
context: undefined,
808808
})
809+
810+
const session = this.sessionStorage.getSession(message.tabID!)
811+
const currentToolUse = session.toolUseWithError?.toolUse
812+
if (currentToolUse && currentToolUse.name === ToolType.ExecuteBash) {
813+
session.toolUseWithError.error = new Error('Tool use was rejected by the user.')
814+
} else {
815+
getLogger().error(
816+
`toolUse name: ${currentToolUse!.name} of toolUseWithError in the stored session doesn't match when click shell command reject button.`
817+
)
818+
return
819+
}
820+
809821
await this.generateStaticTextResponse('reject-shell-command', triggerId)
810822
}
811823

@@ -827,6 +839,7 @@ export class ChatController {
827839
break
828840
case 'reject-shell-command':
829841
await this.rejectShellCommand(message)
842+
await this.processToolUseMessage(message)
830843
break
831844
default:
832845
getLogger().warn(`Unhandled action: ${message.action.id}`)

0 commit comments

Comments
 (0)