diff --git a/src/core/webview/webviewMessageHandler.ts b/src/core/webview/webviewMessageHandler.ts index c646224ba5..9b2e3286ac 100644 --- a/src/core/webview/webviewMessageHandler.ts +++ b/src/core/webview/webviewMessageHandler.ts @@ -588,7 +588,7 @@ export const webviewMessageHandler = async ( break } case "addToWhitelist": { - // Handle adding a command pattern to the whitelist without running it + // Handle adding a command pattern to the whitelist and then running it if (message.pattern) { // Get current allowed commands const currentAllowedCommands = getGlobalState("allowedCommands") || [] @@ -608,6 +608,9 @@ export const webviewMessageHandler = async ( // Post state update to webview await provider.postStateToWebview() } + + // After whitelisting, approve the pending command execution + provider.getCurrentCline()?.handleWebviewAskResponse("yesButtonClicked") } break } diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index c18d64bf9c..176f3e1ce3 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -1659,7 +1659,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction {/* Command approval with auto-approve pattern */} {clineAsk === "command" && !isStreaming ? ( -
+
{/* Top row: Run Command and Reject */}