mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-30 01:52:18 +00:00
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 <yassin@berri.ai>
This commit is contained in:
parent
a65357f9bb
commit
a3f958d8d5
1 changed files with 11 additions and 1 deletions
|
|
@ -176,8 +176,18 @@ const AgentCardDiscovery: React.FC<AgentCardDiscoveryProps> = ({
|
|||
// ``discoveryMode`` / ``discoveryParamsKey`` are primitive proxies for
|
||||
// ``discoveryRequest`` content; the actual object is read via the ref
|
||||
// above so identity churn from the parent doesn't recreate this callback.
|
||||
// ``savedAgentCard`` is captured indirectly via ``resetSelections``: if
|
||||
// the parent refetches the agent and hands us a new saved card, we need
|
||||
// a fresh callback so "Re-discover" pre-selects against the latest data.
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [accessToken, effectiveUrl, isParentDriven, discoveryMode, discoveryParamsKey]);
|
||||
}, [
|
||||
accessToken,
|
||||
effectiveUrl,
|
||||
isParentDriven,
|
||||
discoveryMode,
|
||||
discoveryParamsKey,
|
||||
savedAgentCard,
|
||||
]);
|
||||
|
||||
// Auto-discover when the URL (or parent plan) becomes available.
|
||||
useEffect(() => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue