mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-30 01:52:18 +00:00
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 <yassin@berri.ai>
This commit is contained in:
parent
824a7861cd
commit
84e778e735
1 changed files with 6 additions and 3 deletions
|
|
@ -211,9 +211,9 @@ const AddAgentForm: React.FC<AddAgentFormProps> = ({
|
|||
};
|
||||
|
||||
// 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<AddAgentFormProps> = ({
|
|||
...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,
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue