[Agentic Chat] Tool approval buttons get re-enabled after action

Problem

Similar to the Editor Extension agentic chat issue, tool approval buttons in Web Agentic chat get enabled after user click before the tool has done running. This can lead to bringing workflow into non-recoverable state.

MRs linked it the Editor Extension issue fixed this behaviour for the Editor Chat. It was expected that Duo UI fix will fix it for the web as well but it did not. The idea behind the fix is that once the tool approval button was clicked it can't be reset. We track Approving/Denying state in the tool message approval component and it can't be reverted back.

The reason buttons get enabled in Web Chat is that the Tool Approval message component is recreated and tracked state is lost.

Link this Duo UI MR and try to call the tool that requires approval.

Screenshot_2025-12-08_at_10.19.03

Component created - localProcessingState: null ✓
User clicks approve - localProcessingState changes to 'approving' ✓
Parent sets isProcessing: true - buttons stay disabled ✓
Parent sets isProcessing: false - still disabled because localProcessingState === 'approving' ✓
Component is RECREATED - localProcessingState resets to null ❌
Old component destroyed - with localProcessingState: 'approving'

Potential fix

  1. Either do not update incorrectly parent component isProcessing prop similar to LS fix
  2. Or make sure the tool approval message component is not recreated (might be more involved)
  3. Also, we could keep an approval state based on message_id, e.g {tool_approval_message_id_1: 'approved'}. Then even between component recreations we'll know the tool was approved.
  4. It might be autofixed with BE sending partial updates instead of the full chat log.

So ideal ix would be 4, then 2

Edited by 🤖 GitLab Bot 🤖