fix(antigravity): strip deprecated/readOnly/writeOnly from tool schemas

Gemini/Antigravity generateContent rejects the JSON Schema annotation
keywords deprecated, readOnly, writeOnly with a 400 INVALID_ARGUMENT.
MCP tool schemas (e.g. Claude Code) commonly set deprecated:true, making
every request with such a tool fail. Add them to
UNSUPPORTED_SCHEMA_CONSTRAINTS so cleanJSONSchemaForAntigravity removes
them recursively before the request is sent.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
iletai
2026-06-29 15:09:29 +07:00
committed by decolua
parent 526235872a
commit 3d20a4ccd2

View File

@@ -12,6 +12,8 @@ export const UNSUPPORTED_SCHEMA_CONSTRAINTS = [
"default", "examples",
// JSON Schema meta keywords
"$schema", "$defs", "definitions", "const", "$ref", "$comment",
// Annotation keywords (rejected by Gemini/Antigravity - e.g. MCP tool schemas set these)
"deprecated", "readOnly", "writeOnly",
// Object validation keywords (not supported)
"additionalProperties", "propertyNames", "patternProperties", "enumDescriptions",
// Complex schema keywords (handled by flattenAnyOfOneOf/mergeAllOf)