From fdbd4041ca4ca8fb8cac9bdc36a311f60fcb1566 Mon Sep 17 00:00:00 2001 From: Luis Pater Date: Thu, 5 Mar 2026 11:48:15 +0800 Subject: [PATCH] Fixed: #1531 fix(gemini): add `deprecated` to unsupported schema keywords Add `deprecated` to the list of unsupported schema metadata fields in Gemini and update tests to verify its removal. --- .../executor/antigravity_executor_buildrequest_test.go | 4 ++++ internal/util/gemini_schema.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/runtime/executor/antigravity_executor_buildrequest_test.go b/internal/runtime/executor/antigravity_executor_buildrequest_test.go index c5cba4ee..27dbeca4 100644 --- a/internal/runtime/executor/antigravity_executor_buildrequest_test.go +++ b/internal/runtime/executor/antigravity_executor_buildrequest_test.go @@ -59,6 +59,7 @@ func buildRequestBodyFromPayload(t *testing.T, modelName string) map[string]any "properties": { "mode": { "type": "string", + "deprecated": true, "enum": ["a", "b"], "enumTitles": ["A", "B"] } @@ -156,4 +157,7 @@ func assertSchemaSanitizedAndPropertyPreserved(t *testing.T, params map[string]a if _, ok := mode["enumTitles"]; ok { t.Fatalf("enumTitles should be removed from nested schema") } + if _, ok := mode["deprecated"]; ok { + t.Fatalf("deprecated should be removed from nested schema") + } } diff --git a/internal/util/gemini_schema.go b/internal/util/gemini_schema.go index b8d07bf4..8617b846 100644 --- a/internal/util/gemini_schema.go +++ b/internal/util/gemini_schema.go @@ -430,7 +430,7 @@ func removeUnsupportedKeywords(jsonStr string) string { keywords := append(unsupportedConstraints, "$schema", "$defs", "definitions", "const", "$ref", "$id", "additionalProperties", "propertyNames", "patternProperties", // Gemini doesn't support these schema keywords - "enumTitles", "prefill", // Claude/OpenCode schema metadata fields unsupported by Gemini + "enumTitles", "prefill", "deprecated", // Schema metadata fields unsupported by Gemini ) deletePaths := make([]string, 0)