From 746e9c33a65650f6ca542ad556e91a5b02972eb1 Mon Sep 17 00:00:00 2001 From: Daniel Riccio Date: Thu, 4 Sep 2025 19:29:48 -0500 Subject: [PATCH] fix: prevent countdown timer from showing in history for answered follow-up questions - Added isAnswered field to ClineMessage type to persist follow-up answer state - Updated Task.handleWebviewAskResponse to mark follow-up questions as answered - Modified ChatView to pass isAnswered state from persisted message data - FollowUpSuggest now uses isAnswered prop to hide countdown for answered questions Fixes #7624 --- packages/types/src/message.ts | 1 + src/core/task/Task.ts | 18 ++++++++++++++++++ webview-ui/src/components/chat/ChatView.tsx | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/types/src/message.ts b/packages/types/src/message.ts index 2303b0f6fd..b6eb67e171 100644 --- a/packages/types/src/message.ts +++ b/packages/types/src/message.ts @@ -214,6 +214,7 @@ export const clineMessageSchema = z.object({ contextCondense: contextCondenseSchema.optional(), isProtected: z.boolean().optional(), apiProtocol: z.union([z.literal("openai"), z.literal("anthropic")]).optional(), + isAnswered: z.boolean().optional(), metadata: z .object({ gpt5: z diff --git a/src/core/task/Task.ts b/src/core/task/Task.ts index be932b098f..677d6e587d 100644 --- a/src/core/task/Task.ts +++ b/src/core/task/Task.ts @@ -887,6 +887,24 @@ export class Task extends EventEmitter implements TaskLike { this.askResponse = askResponse this.askResponseText = text this.askResponseImages = images + + // Mark the last follow-up question as answered + if (askResponse === "messageResponse" || askResponse === "yesButtonClicked") { + // Find the last unanswered follow-up message using findLastIndex + const lastFollowUpIndex = findLastIndex( + this.clineMessages, + (msg) => msg.type === "ask" && msg.ask === "followup" && !msg.isAnswered, + ) + + if (lastFollowUpIndex !== -1) { + // Mark this follow-up as answered + this.clineMessages[lastFollowUpIndex].isAnswered = true + // Save the updated messages + this.saveClineMessages().catch((error) => { + console.error("Failed to save answered follow-up state:", error) + }) + } + } } public approveAsk({ text, images }: { text?: string; images?: string[] } = {}) { diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index b6523e4399..3d9212dd56 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -1499,7 +1499,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction