diff --git a/ui/litellm-dashboard/src/components/agents/agent_card_discovery.tsx b/ui/litellm-dashboard/src/components/agents/agent_card_discovery.tsx index a5ca5f4d562..7395c2feb91 100644 --- a/ui/litellm-dashboard/src/components/agents/agent_card_discovery.tsx +++ b/ui/litellm-dashboard/src/components/agents/agent_card_discovery.tsx @@ -176,8 +176,18 @@ const AgentCardDiscovery: React.FC = ({ // ``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(() => {