From 25d791bc4336da7a10b2314671d3cd2e18a6c7e7 Mon Sep 17 00:00:00 2001 From: Will Li Date: Thu, 21 Aug 2025 03:52:14 -0700 Subject: [PATCH] done --- webview-ui/src/components/chat/ChatView.tsx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index 3b77bbdb7d..f19d8f0917 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -449,11 +449,14 @@ const ChatViewComponent: React.ForwardRefRenderFunction { if (isHidden) { @@ -636,11 +639,14 @@ const ChatViewComponent: React.ForwardRefRenderFunction { // Early return if conditions aren't met // Also don't process queue if there's an API error (clineAsk === "api_req_failed") + // Additionally, DO NOT process queued messages when there is no active task context + // (messages.length === 0). This prevents accidentally starting a new task after cancel. if ( sendingDisabled || messageQueue.length === 0 || isProcessingQueueRef.current || - clineAsk === "api_req_failed" + clineAsk === "api_req_failed" || + messages.length === 0 ) { return } @@ -685,7 +691,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction { isProcessingQueueRef.current = false } - }, [sendingDisabled, messageQueue, handleSendMessage, clineAsk]) + }, [sendingDisabled, messageQueue, handleSendMessage, clineAsk, messages.length]) const handleSetChatBoxMessage = useCallback( (text: string, images: string[]) => {