From 2abe8b855c6e146d557b55c92a37d67df4da8c69 Mon Sep 17 00:00:00 2001 From: Muhammad Usama <55662931+MuhammadUsamaMX@users.noreply.github.com> Date: Wed, 5 Aug 2026 10:42:30 +0700 Subject: [PATCH] fix(translator): drop JSON Schema keywords Gemini has no field for Tool schemas carrying uniqueItems, contains, multipleOf, unevaluatedProperties, unevaluatedItems, or contentSchema get rejected by the Gemini API with "Unknown name ...: Cannot find field", failing the whole request. Add them to UNSUPPORTED_SCHEMA_CONSTRAINTS alongside the existing stripped keywords (minItems, maxItems, format, ...). --- open-sse/translator/formats/gemini.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/open-sse/translator/formats/gemini.js b/open-sse/translator/formats/gemini.js index b1d4db34..6393a78b 100644 --- a/open-sse/translator/formats/gemini.js +++ b/open-sse/translator/formats/gemini.js @@ -7,7 +7,13 @@ import { OPENAI_BLOCK } from "../schema/index.js"; export const UNSUPPORTED_SCHEMA_CONSTRAINTS = [ // Basic constraints (not supported by Gemini API) "minLength", "maxLength", "exclusiveMinimum", "exclusiveMaximum", - "minItems", "maxItems", "format", + "minItems", "maxItems", "format", "multipleOf", + // Array keywords the Gemini schema proto has no field for. Agent tool + // schemas set these routinely, and one occurrence rejects the whole request + // with "Unknown name ...: Cannot find field". + "uniqueItems", "contains", + // 2020-12 keywords with no Gemini equivalent + "unevaluatedProperties", "unevaluatedItems", "contentSchema", // Claude rejects these in VALIDATED mode "default", "examples", // JSON Schema meta keywords