diff --git a/apps/rowboat/app/projects/[projectId]/entities/agent_config.tsx b/apps/rowboat/app/projects/[projectId]/entities/agent_config.tsx index 0ccf3435..15abca57 100644 --- a/apps/rowboat/app/projects/[projectId]/entities/agent_config.tsx +++ b/apps/rowboat/app/projects/[projectId]/entities/agent_config.tsx @@ -158,6 +158,13 @@ export function AgentConfig({ } }, [agent.controlType, agent.outputVisibility, agent, handleUpdate]); + // Add effect to ensure internal agents have maxCallsPerParentAgent set to 1 by default + useEffect(() => { + if (agent.outputVisibility === "internal" && !isPipelineAgent && agent.maxCallsPerParentAgent === undefined) { + handleUpdate({ ...agent, maxCallsPerParentAgent: 1 }); + } + }, [agent.outputVisibility, agent.maxCallsPerParentAgent, agent, handleUpdate, isPipelineAgent]); + // Add effect to handle escape key useEffect(() => { const handleEscape = (e: KeyboardEvent) => { @@ -239,13 +246,7 @@ export function AgentConfig({ currentAgent: agent }); - // Add local state for max calls input - const [maxCallsInput, setMaxCallsInput] = useState(String(agent.maxCallsPerParentAgent || 3)); - const [maxCallsError, setMaxCallsError] = useState(null); - // Sync local state with agent prop - useEffect(() => { - setMaxCallsInput(String(agent.maxCallsPerParentAgent || 3)); - }, [agent.maxCallsPerParentAgent]); + return ( - {tab.charAt(0).toUpperCase() + tab.slice(1)} + {tab === 'instructions' ? 'Instructions' : 'Model & RAG'} ))} @@ -644,43 +645,7 @@ export function AgentConfig({ } - {agent.outputVisibility === "internal" && !isPipelineAgent && ( -
- -
- { - setMaxCallsInput(value); - setMaxCallsError(null); - const num = Number(value); - if (value && !isNaN(num) && num >= 1 && Number.isInteger(num)) { - if (num !== agent.maxCallsPerParentAgent) { - handleUpdate({ - ...agent, - maxCallsPerParentAgent: num - }); - } - } - }} - validate={(value: string) => { - const num = Number(value); - if (!value || isNaN(num) || num < 1 || !Number.isInteger(num)) { - return { valid: false, errorMessage: "Must be an integer >= 1" }; - } - return { valid: true }; - }} - error={maxCallsError} - min={1} - className="w-full max-w-24" - /> - {maxCallsError && ( -

{maxCallsError}

- )} -
-
- )} + {USE_TRANSFER_CONTROL_OPTIONS && !isPipelineAgent && (