fix(ui): prevent duplicate ask_user card on session load#1446
Merged
EItanya merged 1 commit intokagent-dev:mainfrom Mar 5, 2026
Merged
fix(ui): prevent duplicate ask_user card on session load#1446EItanya merged 1 commit intokagent-dev:mainfrom
EItanya merged 1 commit intokagent-dev:mainfrom
Conversation
When loading a session with a pending ask_user request, the confirmation appeared twice because two code paths both created an AskUserRequest card: 1. extractMessagesFromTasks() found the unresolved confirmation in task history and created a pending card. 2. extractApprovalMessagesFromTasks() found the same confirmation in task.status.message and created another pending card. Both were then concatenated into storedMessages, resulting in the duplicate "Questions for you" UI shown to the user. Fix: skip unresolved confirmations in extractMessagesFromTasks(). Pending confirmations are now exclusively owned by extractApprovalMessagesFromTasks() via task.status.message, while resolved ones continue to be rendered inline from history. Signed-off-by: Matcham89 <cjmatcham@hotmail.co.uk>
EItanya
approved these changes
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ask_userrequest, the "Questions for you" card was rendered twiceAskUserRequestmessage for the same pending confirmation:extractMessagesFromTasks()found it in task history (no decision yet → pending card)extractApprovalMessagesFromTasks()found the same confirmation intask.status.messagestoredMessages, causing the duplicateFix:
extractMessagesFromTasks()now skips unresolved confirmations (where no subsequent user decision exists in history). Pending confirmations are exclusively owned byextractApprovalMessagesFromTasks()viatask.status.message; resolved ones continue to render inline from history as before.Test plan
ask_user(e.g. an agent configured to ask before merging a PR)ask_userprompt, then reload/revisit the sessionask_usersessions show the answered card correctly (read-only)