From 3f1224e23edfb5905b28eb33707b2b40d5f451f4 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Wed, 3 Sep 2025 23:40:33 -0400 Subject: [PATCH] fix: improve type checking for graphConfig in createRun function --- packages/api/src/agents/run.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/api/src/agents/run.ts b/packages/api/src/agents/run.ts index 52e8908ce9..2600e9332f 100644 --- a/packages/api/src/agents/run.ts +++ b/packages/api/src/agents/run.ts @@ -153,7 +153,7 @@ export async function createRun({ edges: agents[0].edges, }; - if (agentInputs.length > 1 || ('edges' in graphConfig && graphConfig.edges.length > 0)) { + if (agentInputs.length > 1 || ((graphConfig as MultiAgentGraphConfig).edges?.length ?? 0) > 0) { (graphConfig as unknown as MultiAgentGraphConfig).type = 'multi-agent'; } else { (graphConfig as StandardGraphConfig).type = 'standard';