From 43ba36b42dfe7c1cb0696904f60b8e7afae6ba60 Mon Sep 17 00:00:00 2001 From: Hannes Rudolph Date: Mon, 9 Feb 2026 10:43:18 -0700 Subject: [PATCH] fix(chat): keep approval pending until messages update --- webview-ui/src/components/chat/ChatView.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index b3532a00b7..98567296aa 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -184,6 +184,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction(null) const everVisibleMessagesTsRef = useRef>( new LRUCache({ max: 100, @@ -516,10 +517,18 @@ const ChatViewComponent: React.ForwardRefRenderFunction { if (!isApprovalActionPending) { + approvalPendingMessagesSnapshotRef.current = null return } - clearApprovalActionPending() + if (approvalPendingMessagesSnapshotRef.current === null) { + approvalPendingMessagesSnapshotRef.current = messages + return + } + + if (messages !== approvalPendingMessagesSnapshotRef.current) { + clearApprovalActionPending() + } }, [messages, isApprovalActionPending, clearApprovalActionPending]) // Update button text when messages change (e.g., completion_result is added) for subtasks in resume_task state @@ -923,6 +932,8 @@ const ChatViewComponent: React.ForwardRefRenderFunction