fix: preserve text input when Resume Task button is clicked

- Modified handlePrimaryButtonClick to handle resume_task separately
- Resume Task now sends the button click without clearing the input
- Maintains current behavior of not sending text with Resume Task
- Fixes #9328 where text was lost when clicking Resume Task
This commit is contained in:
Roo Code 2025-11-18 03:57:02 +00:00
parent e742511d90
commit 55aecc63dc

View file

@ -636,7 +636,6 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
case "tool":
case "browser_action_launch":
case "use_mcp_server":
case "resume_task":
case "mistake_limit_reached":
// Only send text/images if they exist
if (trimmedInput || (images && images.length > 0)) {
@ -653,6 +652,12 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
vscode.postMessage({ type: "askResponse", askResponse: "yesButtonClicked" })
}
break
case "resume_task":
// For resume_task, we don't send the text/images, just the button click
// and we preserve the input text as per user requirement
vscode.postMessage({ type: "askResponse", askResponse: "yesButtonClicked" })
// Don't clear input state - preserve what user typed
break
case "completion_result":
case "resume_completed_task":
// Waiting for feedback, but we can just present a new task button