From 0e8c512cb9c87ff1062ea2cf265ade70eaa88053 Mon Sep 17 00:00:00 2001 From: Abhi Date: Wed, 11 Mar 2026 17:44:54 -0400 Subject: [PATCH] addressing gemini's comments --- packages/core/src/tools/tools.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/core/src/tools/tools.ts b/packages/core/src/tools/tools.ts index 71c7a8be77..2330f2f795 100644 --- a/packages/core/src/tools/tools.ts +++ b/packages/core/src/tools/tools.ts @@ -410,20 +410,25 @@ export abstract class DeclarativeTool< * This allows the model to explicitly control parallel vs sequential execution. */ private addWaitForPreviousParameter(schema: unknown): unknown { - if (!this.isSchemaObject(schema)) { + if (!this.isSchemaObject(schema) || schema['type'] !== 'object') { return schema; } const props = schema['properties']; + let propertiesObj: Record = {}; - if (schema['type'] !== 'object' || !this.isSchemaObject(props)) { - return schema; + if (props !== undefined) { + if (!this.isSchemaObject(props)) { + // properties exists but is not an object, so it's a malformed schema. + return schema; + } + propertiesObj = props; } return { ...schema, properties: { - ...props, + ...propertiesObj, wait_for_previous: { type: 'boolean', description: