From 402cf40203ea78110743c0744f9ea741155c7198 Mon Sep 17 00:00:00 2001 From: Ramnique Singh <30795890+ramnique@users.noreply.github.com> Date: Thu, 14 Aug 2025 06:04:12 +0530 Subject: [PATCH] better pipeline agent fix --- apps/rowboat/app/lib/client_utils.ts | 10 +++------- apps/rowboat/app/lib/types/workflow_types.ts | 3 ++- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/apps/rowboat/app/lib/client_utils.ts b/apps/rowboat/app/lib/client_utils.ts index 693a7fed..eea2bffb 100644 --- a/apps/rowboat/app/lib/client_utils.ts +++ b/apps/rowboat/app/lib/client_utils.ts @@ -20,13 +20,10 @@ export function validateConfigChanges(configType: string, configChanges: Record< break; } case 'agent': { - // Determine if this is a pipeline agent from the config changes - const isPipelineAgent = configChanges.type === 'pipeline'; - testObject = { name: 'test', description: 'test', - type: isPipelineAgent ? 'pipeline' : 'conversation', + type: 'conversation', instructions: 'test', prompts: [], tools: [], @@ -34,9 +31,8 @@ export function validateConfigChanges(configType: string, configChanges: Record< ragReturnType: 'chunks', ragK: 10, connectedAgents: [], - // Set correct defaults based on agent type - controlType: isPipelineAgent ? 'relinquish_to_parent' : 'retain', - outputVisibility: isPipelineAgent ? 'internal' : 'user_facing', + controlType: 'retain', + outputVisibility: 'user_facing', maxCallsPerParentAgent: 3, } as z.infer; schema = WorkflowAgent; diff --git a/apps/rowboat/app/lib/types/workflow_types.ts b/apps/rowboat/app/lib/types/workflow_types.ts index edd03a04..4432b426 100644 --- a/apps/rowboat/app/lib/types/workflow_types.ts +++ b/apps/rowboat/app/lib/types/workflow_types.ts @@ -26,7 +26,8 @@ export const WorkflowAgent = z.object({ 'relinquish_to_start', ]).optional().describe('Whether this agent retains control after a turn, relinquishes to the parent agent, or relinquishes to the start agent'), maxCallsPerParentAgent: z.number().default(3).describe('Maximum number of times this agent can be called by a parent agent in a single turn').optional(), -}).refine((data) => { +}); +export const StrictWorkflowAgent = WorkflowAgent.refine((data) => { // Pipeline agents should have internal output visibility and relinquish_to_parent control type if (data.type === 'pipeline' && data.outputVisibility !== 'internal') { return false;