Skip to content

Commit c43927b

Browse files
committed
fix: execute command after whitelisting with 'Always allow' button
- Modified addToWhitelist handler to trigger command execution after whitelisting - Fixes issue where chat was stuck after clicking 'Always allow' - Command now gets whitelisted AND executed in one action
1 parent c58268b commit c43927b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/core/webview/webviewMessageHandler.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ export const webviewMessageHandler = async (
588588
break
589589
}
590590
case "addToWhitelist": {
591-
// Handle adding a command pattern to the whitelist without running it
591+
// Handle adding a command pattern to the whitelist and then running it
592592
if (message.pattern) {
593593
// Get current allowed commands
594594
const currentAllowedCommands = getGlobalState("allowedCommands") || []
@@ -608,6 +608,9 @@ export const webviewMessageHandler = async (
608608
// Post state update to webview
609609
await provider.postStateToWebview()
610610
}
611+
612+
// After whitelisting, approve the pending command execution
613+
provider.getCurrentCline()?.handleWebviewAskResponse("yesButtonClicked")
611614
}
612615
break
613616
}

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1659,7 +1659,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
16591659
<>
16601660
{/* Command approval with auto-approve pattern */}
16611661
{clineAsk === "command" && !isStreaming ? (
1662-
<div className="flex flex-col gap-[6px]">
1662+
<div className="flex flex-col gap-[6px] mb-[10px]">
16631663
{/* Top row: Run Command and Reject */}
16641664
<div className="flex gap-[6px]">
16651665
<StandardTooltip content={t("chat:runCommand.tooltip")}>

0 commit comments

Comments
 (0)