From c39b5eb8e25697cea5821659c57b738fc8ae6edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=9D=E5=A4=95?= Date: Mon, 27 Apr 2026 16:20:17 +0800 Subject: [PATCH] Fix individual page system nodes 12812679583942839801 (#43) * feat: fix individual page configuration to properly display system nodes - Added `SystemNodeConfig` database table to persist system node config (provider and model). - Updated `AgentLayout` and `WorkerIndividualSettings` to restrict config modifications to only provider and model for system nodes. - Hid delete button for system nodes and removed them from the creation modal dropdown. - Updated Agent API to support querying configured system nodes and persisting setups. Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com> * feat: fix individual page configuration to properly display system nodes - Added `SystemNodeConfig` database table to persist system node config (provider and model). - Updated `AgentLayout` and `WorkerIndividualSettings` to restrict config modifications to only provider and model for system nodes. - Hid delete button for system nodes and removed them from the creation modal dropdown. - Updated Agent API to support querying configured system nodes and persisting setups. - Fixed an issue where the table would not render if only system nodes were present (and no custom workers existed). Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com> * fix: correct individual worker agent_type and system node model display - Updated the `agent_type` options in `WorkerIndividualSettings.tsx` to match the backend's expected `AgentType` enum values (`ordinary_individual`, `skill_individual`, `special_individual`). This fixes the 422 error when creating a new worker. - Fixed the system node provider and model selection logic so it correctly defaults to the first available provider when unconfigured, allowing the model dropdown to populate. Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com> --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com> --- .../Agent/WorkerIndividualSettings.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/Agent/WorkerIndividualSettings.tsx b/frontend/src/components/Agent/WorkerIndividualSettings.tsx index fce633a..22bc619 100644 --- a/frontend/src/components/Agent/WorkerIndividualSettings.tsx +++ b/frontend/src/components/Agent/WorkerIndividualSettings.tsx @@ -43,14 +43,17 @@ export function WorkerIndividualSettings() { const sysNodesData = sysRes.data.system_nodes || []; const defaultSysNodes = ['supervisory_node', 'consciousness_node', 'control_node']; + const providersList = Object.values(provRes.data.provider_list || {}) as Provider[]; + const defaultProvider = providersList.length > 0 ? providersList[0].provider_title : ''; + const formattedSysNodes = defaultSysNodes.map(nodeName => { const found = sysNodesData.find((n: any) => n.node_name === nodeName); return { agent_id: nodeName, agent_name: nodeName, agent_type: 'System Node', - provider_title: found ? found.provider_title : 'Not Configured', - model_id: found ? found.model_id : 'Not Configured', + provider_title: found && found.provider_title ? found.provider_title : defaultProvider, + model_id: found && found.model_id ? found.model_id : '', is_system: true }; }); @@ -82,7 +85,7 @@ export function WorkerIndividualSettings() { const handleAddNew = () => { setEditData({ agent_name: '', - agent_type: 'OrdinaryIndividual', + agent_type: 'ordinary_individual', description: '', provider_title: providers.length > 0 ? providers[0].provider_title : '', model_id: '', @@ -246,14 +249,14 @@ export function WorkerIndividualSettings() {