fix: reset UI state when canceling during streaming to prevent frozen cancel button

This fixes issue #9529 where the cancel button would get stuck/frozen when attempting to cancel a task during an API request. The UI state variables (sendingDisabled, clineAsk, enableButtons) are now properly reset when canceling during streaming, allowing the UI to return to the correct state and show the "new task" and "terminate" buttons.

Fixes #9529
This commit is contained in:
Roo Code 2025-11-24 07:59:00 +00:00
parent becdb1ac1c
commit 3ff10faede

View file

@ -682,6 +682,10 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
if (isStreaming) {
vscode.postMessage({ type: "cancelTask" })
setDidClickCancel(true)
// Reset UI state to prevent frozen UI after canceling
setSendingDisabled(true)
setClineAsk(undefined)
setEnableButtons(false)
return
}