Commit 2f572a5
fix(expert): dismiss pending tool-approval cards when a new message is sent (#7663)
## Description
Fixes #7662.
When the Expert deferred a tool call for approval, sending a new message instead of clicking Allow or Deny left the approval card active, with its buttons still live and the card looking pending. The backend already abandons the deferred tool calls and addresses the new message, but the frontend never dismissed the stale card.
## Changes
- `handleQuery` now cancels the open approval batch when a new message is sent, so pending cards are dismissed instead of lingering.
- `cancelPendingToolApprovals` takes an outcome status: a new message marks unanswered cards as `cancelled` (matching how the agent self-heals those calls), while chat stop and Start Over keep the existing `denied` outcome.
- `ToolApprovalCard` renders a `Cancelled` outcome label.
Co-authored-by: andypalmi <andrea@flowfuse.com>1 parent 5abb3d8 commit 2f572a5
2 files changed
Lines changed: 12 additions & 8 deletions
File tree
- frontend/src
- components/expert/components/messages/components/resources
- stores
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
| 104 | + | |
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
215 | 219 | | |
216 | 220 | | |
217 | 221 | | |
| |||
564 | 568 | | |
565 | 569 | | |
566 | 570 | | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
572 | 575 | | |
573 | 576 | | |
574 | 577 | | |
575 | 578 | | |
576 | | - | |
| 579 | + | |
577 | 580 | | |
578 | 581 | | |
579 | 582 | | |
| |||
0 commit comments