Skip to content

Commit 4d3c958

Browse files
daniel-lxsmtone
authored andcommitted
fix: prevent countdown timer from showing in history for answered follow-up questions (RooCodeInc#7686)
1 parent e0d091f commit 4d3c958

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

packages/types/src/message.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ export const clineMessageSchema = z.object({
214214
contextCondense: contextCondenseSchema.optional(),
215215
isProtected: z.boolean().optional(),
216216
apiProtocol: z.union([z.literal("openai"), z.literal("anthropic")]).optional(),
217+
isAnswered: z.boolean().optional(),
217218
metadata: z
218219
.object({
219220
gpt5: z

src/core/task/Task.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,24 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
887887
this.askResponse = askResponse
888888
this.askResponseText = text
889889
this.askResponseImages = images
890+
891+
// Mark the last follow-up question as answered
892+
if (askResponse === "messageResponse" || askResponse === "yesButtonClicked") {
893+
// Find the last unanswered follow-up message using findLastIndex
894+
const lastFollowUpIndex = findLastIndex(
895+
this.clineMessages,
896+
(msg) => msg.type === "ask" && msg.ask === "followup" && !msg.isAnswered,
897+
)
898+
899+
if (lastFollowUpIndex !== -1) {
900+
// Mark this follow-up as answered
901+
this.clineMessages[lastFollowUpIndex].isAnswered = true
902+
// Save the updated messages
903+
this.saveClineMessages().catch((error) => {
904+
console.error("Failed to save answered follow-up state:", error)
905+
})
906+
}
907+
}
890908
}
891909

892910
public approveAsk({ text, images }: { text?: string; images?: string[] } = {}) {

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
14991499
onSuggestionClick={handleSuggestionClickInRow} // This was already stabilized
15001500
onBatchFileResponse={handleBatchFileResponse}
15011501
onFollowUpUnmount={handleFollowUpUnmount}
1502-
isFollowUpAnswered={messageOrGroup.ts === currentFollowUpTs}
1502+
isFollowUpAnswered={messageOrGroup.isAnswered === true || messageOrGroup.ts === currentFollowUpTs}
15031503
editable={
15041504
messageOrGroup.type === "ask" &&
15051505
messageOrGroup.ask === "tool" &&

0 commit comments

Comments
 (0)