Skip to content

Commit a3f958d

Browse files
fix(a2a/ui): include savedAgentCard in handleDiscover deps
The previous deps list omitted savedAgentCard, so handleDiscover (and the resetSelections it calls) kept the closure's saved-card value even after the parent refetched the agent. Clicking 'Re-discover' would then pre-select skills against stale data. Adding savedAgentCard to the deps array forces the callback to refresh whenever the saved card changes. Co-authored-by: Yassin Kortam <[email protected]>
1 parent a65357f commit a3f958d

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

ui/litellm-dashboard/src/components/agents/agent_card_discovery.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,18 @@ const AgentCardDiscovery: React.FC<AgentCardDiscoveryProps> = ({
176176
// ``discoveryMode`` / ``discoveryParamsKey`` are primitive proxies for
177177
// ``discoveryRequest`` content; the actual object is read via the ref
178178
// above so identity churn from the parent doesn't recreate this callback.
179+
// ``savedAgentCard`` is captured indirectly via ``resetSelections``: if
180+
// the parent refetches the agent and hands us a new saved card, we need
181+
// a fresh callback so "Re-discover" pre-selects against the latest data.
179182
// eslint-disable-next-line react-hooks/exhaustive-deps
180-
}, [accessToken, effectiveUrl, isParentDriven, discoveryMode, discoveryParamsKey]);
183+
}, [
184+
accessToken,
185+
effectiveUrl,
186+
isParentDriven,
187+
discoveryMode,
188+
discoveryParamsKey,
189+
savedAgentCard,
190+
]);
181191

182192
// Auto-discover when the URL (or parent plan) becomes available.
183193
useEffect(() => {

0 commit comments

Comments
 (0)