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>
This commit is contained in:
朝夕 2026-04-27 16:20:17 +08:00 committed by GitHub
parent 82d6b4acbc
commit c39b5eb8e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 7 deletions

View File

@ -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() {
<div>
<label className="block text-sm font-medium text-slate-700 mb-1">Agent Type</label>
<select
value={editData.agent_type || 'OrdinaryIndividual'}
value={editData.agent_type || 'ordinary_individual'}
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}
>
<option value="OrdinaryIndividual">Ordinary Individual</option>
<option value="SkillIndividual">Skill Individual</option>
<option value="SpecialIndividual">Special Individual</option>
<option value="ordinary_individual">Ordinary Individual</option>
<option value="skill_individual">Skill Individual</option>
<option value="special_individual">Special Individual</option>
{(editData as any).is_system && (
<option value="System Node">System Node</option>
)}