From 3241e798ac07d646d6a61e22391493b16acc7d73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=9D=E5=A4=95?= Date: Mon, 27 Apr 2026 15:18:01 +0800 Subject: [PATCH] feat: fix individual page configuration to properly display system nodes (#41) - 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: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com> --- frontend/src/components/Agent/AgentLayout.tsx | 2 +- .../Agent/WorkerIndividualSettings.tsx | 179 +++++++++++------- pretor/api/agent.py | 16 ++ pretor/core/database/module/system_node.py | 52 +++++ pretor/core/database/postgres.py | 11 ++ pretor/core/database/table/system_node.py | 21 ++ 6 files changed, 216 insertions(+), 65 deletions(-) create mode 100644 pretor/core/database/module/system_node.py create mode 100644 pretor/core/database/table/system_node.py diff --git a/frontend/src/components/Agent/AgentLayout.tsx b/frontend/src/components/Agent/AgentLayout.tsx index 3d351b9..ce21534 100644 --- a/frontend/src/components/Agent/AgentLayout.tsx +++ b/frontend/src/components/Agent/AgentLayout.tsx @@ -21,7 +21,7 @@ export function AgentLayout({ agentTab, setAgentTab }: AgentLayoutProps) { className={`w-full flex items-center px-4 py-3 text-sm font-medium rounded-xl transition-all ${agentTab === 'worker' ? 'bg-blue-50 text-blue-600' : 'text-slate-600 hover:bg-slate-50 hover:text-slate-900'}`} > - Worker Individual + Individual + + + ))} {workers.map((w) => ( {w.agent_name} @@ -179,7 +222,9 @@ export function WorkerIndividualSettings() {
-

{isNew ? 'Create Worker' : 'Edit Worker'}

+

+ {(editData as any).is_system ? 'Edit System Node' : (isNew ? 'Create Worker' : 'Edit Worker')} +

@@ -195,6 +240,7 @@ export function WorkerIndividualSettings() { value={editData.agent_name || ''} onChange={(e) => setEditData({...editData, agent_name: e.target.value})} className="w-full px-4 py-2 border border-slate-200 rounded-lg focus:ring-2 focus:ring-indigo-500" + disabled={(editData as any).is_system} />
@@ -203,13 +249,14 @@ export function WorkerIndividualSettings() { value={editData.agent_type || 'OrdinaryIndividual'} onChange={(e) => setEditData({...editData, agent_type: e.target.value})} className="w-full px-4 py-2 border border-slate-200 rounded-lg focus:ring-2 focus:ring-indigo-500" + disabled={(editData as any).is_system} > - - - + {(editData as any).is_system && ( + + )}
@@ -249,56 +296,60 @@ export function WorkerIndividualSettings() {
-
- -