From f601dac30d6c9e09f65d2251ceeca8bdfe1f0d31 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 5 Jan 2026 01:25:29 +0100 Subject: [PATCH] style: tidy tool schema normalization --- src/agents/pi-tools.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/agents/pi-tools.ts b/src/agents/pi-tools.ts index 0123fcb59..6b56e182e 100644 --- a/src/agents/pi-tools.ts +++ b/src/agents/pi-tools.ts @@ -242,8 +242,7 @@ function normalizeToolParameters(tool: AnyAgentTool): AnyAgentTool { // object-ish fields, force `type: "object"` so OpenAI accepts the schema. if ( !("type" in schema) && - (typeof schema.properties === "object" || - Array.isArray(schema.required)) && + (typeof schema.properties === "object" || Array.isArray(schema.required)) && !Array.isArray(schema.anyOf) && !Array.isArray(schema.oneOf) ) { @@ -311,7 +310,9 @@ function normalizeToolParameters(tool: AnyAgentTool): AnyAgentTool { // Merging properties preserves useful enums like `action` while keeping schemas portable. parameters: cleanSchemaForGemini({ type: "object", - ...(typeof nextSchema.title === "string" ? { title: nextSchema.title } : {}), + ...(typeof nextSchema.title === "string" + ? { title: nextSchema.title } + : {}), ...(typeof nextSchema.description === "string" ? { description: nextSchema.description } : {}),