From 84e778e7350a130f9a152a2de848f4a7a71752eb Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 28 May 2026 07:07:25 +0000 Subject: [PATCH] fix(ui): overlay discovered name/description in create flow for dynamic agents Mirror the edit-form overlay in agent_info.tsx so dynamic agent types (e.g. LangGraph) whose forms don't register name/description as Form.Items don't silently lose those discovery-panel edits on save. Co-authored-by: Yassin Kortam --- .../src/components/agents/add_agent_form.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ui/litellm-dashboard/src/components/agents/add_agent_form.tsx b/ui/litellm-dashboard/src/components/agents/add_agent_form.tsx index 6d479bbe83f..45ee941a43f 100644 --- a/ui/litellm-dashboard/src/components/agents/add_agent_form.tsx +++ b/ui/litellm-dashboard/src/components/agents/add_agent_form.tsx @@ -211,9 +211,9 @@ const AddAgentForm: React.FC = ({ }; // Overlay the user's discovery selections onto the agent_card_params built - // from the form. Form-driven fields (name, description, version, url) stay - // as-is; only skills, capabilities, input/output modes, provider, and - // icon/doc URLs are overlaid because dynamic agent forms (e.g. LangGraph) + // from the form. Name and description are overlaid (falling back to the + // form-built value) along with skills, capabilities, input/output modes, + // provider, and icon/doc URLs because dynamic agent forms (e.g. LangGraph) // don't register Form.Items for them, so AntD's setFieldsValue silently // drops those keys and the values never make it back through buildAgentData. const overlayDiscoveredCardParams = ( @@ -225,6 +225,9 @@ const AddAgentForm: React.FC = ({ ...agentData, agent_card_params: { ...agentData.agent_card_params, + name: discovered.name ?? agentData.agent_card_params?.name, + description: + discovered.description ?? agentData.agent_card_params?.description, ...(Array.isArray(discovered.skills) && { skills: discovered.skills, }),