From 770c8106500c98b537015461ab77cfe2e0e7a649 Mon Sep 17 00:00:00 2001 From: Atef Bellaaj Date: Mon, 23 Jun 2025 12:25:44 +0200 Subject: [PATCH] feat: add validation and error messages for agent name in AgentConfig and AgentPanel --- .../SidePanel/Agents/AgentConfig.tsx | 37 +++++++++++++------ .../SidePanel/Agents/AgentPanel.tsx | 6 +++ client/src/locales/en/translation.json | 4 +- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/client/src/components/SidePanel/Agents/AgentConfig.tsx b/client/src/components/SidePanel/Agents/AgentConfig.tsx index ed483825b6..6007125b9e 100644 --- a/client/src/components/SidePanel/Agents/AgentConfig.tsx +++ b/client/src/components/SidePanel/Agents/AgentConfig.tsx @@ -39,7 +39,10 @@ export default function AgentConfig({ const [showToolDialog, setShowToolDialog] = useState(false); const { actions, setAction, groupedTools: allTools, setActivePanel } = useAgentPanelContext(); - const { control } = methods; + const { + control, + formState: { errors }, + } = methods; const provider = useWatch({ control, name: 'provider' }); const model = useWatch({ control, name: 'model' }); const agent = useWatch({ control, name: 'agent' }); @@ -190,21 +193,33 @@ export default function AgentConfig({ /> ( - + <> + +
+ {errors.name ? errors.name.message : ' '} +
+ )} />