fix: prevent countdown timer from showing in history for answered follow-up questions (#7686)

This commit is contained in:
Daniel 2025-09-04 22:19:05 -05:00 committed by GitHub
parent 571d1a4833
commit de12ec169b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 1 deletions

View file

@ -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

View file

@ -887,6 +887,24 @@ export class Task extends EventEmitter<TaskEvents> 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[] } = {}) {

View file

@ -1499,7 +1499,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
onSuggestionClick={handleSuggestionClickInRow} // This was already stabilized
onBatchFileResponse={handleBatchFileResponse}
onFollowUpUnmount={handleFollowUpUnmount}
isFollowUpAnswered={messageOrGroup.ts === currentFollowUpTs}
isFollowUpAnswered={messageOrGroup.isAnswered === true || messageOrGroup.ts === currentFollowUpTs}
editable={
messageOrGroup.type === "ask" &&
messageOrGroup.ask === "tool" &&