diff --git a/src/langbot/pkg/agent/runner/registry.py b/src/langbot/pkg/agent/runner/registry.py index 2c8270cb..f1b04851 100644 --- a/src/langbot/pkg/agent/runner/registry.py +++ b/src/langbot/pkg/agent/runner/registry.py @@ -262,6 +262,14 @@ class AgentRunnerRegistry: stages = [] for descriptor in runners: + config_schema = [] + for index, config_item in enumerate(descriptor.config_schema): + item = dict(config_item) + if not item.get('id'): + item_name = item.get('name') or str(index) + item['id'] = f'{descriptor.id}.{item_name}' + config_schema.append(item) + # Add runner option options.append( { @@ -278,7 +286,7 @@ class AgentRunnerRegistry: 'name': descriptor.id, 'label': descriptor.label, 'description': descriptor.description, - 'config': descriptor.config_schema, + 'config': config_schema, } ) diff --git a/web/src/app/home/components/dynamic-form/DynamicFormComponent.tsx b/web/src/app/home/components/dynamic-form/DynamicFormComponent.tsx index 814669f0..d82b1e38 100644 --- a/web/src/app/home/components/dynamic-form/DynamicFormComponent.tsx +++ b/web/src/app/home/components/dynamic-form/DynamicFormComponent.tsx @@ -494,12 +494,13 @@ export default function DynamicFormComponent({ }} /> - {itemConfigList.map((config) => { + {itemConfigList.map((config, index) => { // Create a normalized config with type converted to frontend format const normalizedConfig = { ...config, type: normalizeItemType(config.type), }; + const fieldKey = config.id || config.name || `field-${index}`; if (config.show_if) { const dependValue = resolveShowIfValue( @@ -543,7 +544,7 @@ export default function DynamicFormComponent({ return ( +
( @@ -688,7 +689,7 @@ export default function DynamicFormComponent({ return ( ( diff --git a/web/src/app/home/components/dynamic-form/DynamicFormItemComponent.tsx b/web/src/app/home/components/dynamic-form/DynamicFormItemComponent.tsx index 72499176..c1f2bac0 100644 --- a/web/src/app/home/components/dynamic-form/DynamicFormItemComponent.tsx +++ b/web/src/app/home/components/dynamic-form/DynamicFormItemComponent.tsx @@ -254,6 +254,7 @@ export default function DynamicFormItemComponent({ type="number" className="max-w-xs" {...field} + value={field.value ?? ''} onChange={(e) => field.onChange(Number(e.target.value))} /> ); @@ -262,7 +263,7 @@ export default function DynamicFormItemComponent({ if (config.options && config.options.length > 0) { return (
- +