diff --git a/src/core/Cline.ts b/src/core/Cline.ts index 3632f25c1b..4bfcf59520 100644 --- a/src/core/Cline.ts +++ b/src/core/Cline.ts @@ -2712,9 +2712,14 @@ export class Cline { // } this.isAwaitingPlanResponse = true - const { text, images } = await this.ask("plan_mode_response", response, false) + let { text, images } = await this.ask("plan_mode_response", response, false) this.isAwaitingPlanResponse = false + // webview invoke sendMessage will send this marker in order to put webview into the proper state (responding to an ask) and as a flag to extension that the user switched to ACT mode. + if (text === "PLAN_MODE_TOGGLE_RESPONSE") { + text = "" + } + if (this.didRespondToPlanAskBySwitchingMode) { pushToolResult( formatResponse.toolResult( @@ -2730,7 +2735,7 @@ export class Cline { pushToolResult(formatResponse.toolResult(`\n${text}\n`, images)) } - if (text || images) { + if (text || images?.length) { await this.say("user_feedback", text ?? "", images) } diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 09a735ae1c..8ef786f4dc 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -627,7 +627,7 @@ export class ClineProvider implements vscode.WebviewViewProvider { await this.postMessageToWebview({ type: "invoke", invoke: "sendMessage", - text: message.chatContent?.message || "[Proceeding with the task...]", + text: message.chatContent?.message || "PLAN_MODE_TOGGLE_RESPONSE", images: message.chatContent?.images, }) } else {