-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fix: prevent countdown timer from showing in history for answered follow-up questions #7686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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( | ||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider extracting this follow-up marking logic to a separate method like |
||||||||||||||||||||
| 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) => { | ||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The error handling here only logs to console. Consider propagating this error or at least tracking it with telemetry since persistence failures could lead to the bug reoccurring. Also, the async
Suggested change
|
||||||||||||||||||||
| console.error("Failed to save answered follow-up state:", error) | ||||||||||||||||||||
| }) | ||||||||||||||||||||
| } | ||||||||||||||||||||
| } | ||||||||||||||||||||
| } | ||||||||||||||||||||
|
|
||||||||||||||||||||
| public approveAsk({ text, images }: { text?: string; images?: string[] } = {}) { | ||||||||||||||||||||
|
|
||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a JSDoc comment for the
isAnsweredfield to explain its purpose and when it's set. This would help future developers understand that this field specifically tracks whether a follow-up question has been answered to prevent the countdown timer from reappearing in task history.