Bug Report: Google Cloud Code Assist / Antigravity JSON Schema Validation Failures
Summary
The Google Cloud Code Assist API (accessed via google-antigravity provider) has extremely strict JSON Schema validation for tool/function calling, causing repeated failures (400 "format" errors) with tool schemas that work fine on other providers (Anthropic, OpenAI, etc.).
Impact
- Tool calling with google-antigravity/claude-* models frequently fails with JSON Schema validation errors
- Users see repetitive "format" failures (80+ errors in my usage stats)
- Forces users to use different providers as primary fallbacks
Root Cause
The Cloud Code Assist API rejects a large subset of standard JSON Schema keywords that are used by tool libraries and other LLM providers:
Completely Rejected:
- Structure defs: $ref, $defs, definitions, $schema, $id, patternProperties, additionalProperties, examples
Validation Constraints (strict - cause 400 on any match):
- minLength, maxLength, minimum, maximum, multipleOf, pattern, format
- minItems, maxItems, uniqueItems
- minProperties, maxProperties
Current Mitigation (in codebase)
The project already has a workaround at src/agents/schema/clean-for-gemini.ts that strips these keywords, but this:
- Loses important validation (e.g., pattern matching, min/max lengths)
- Requires schema modification before provider selection
- Doesn't handle all edge cases
Request
Please investigate whether:
- This is intentional - Cloud Code Assist is designed for a stricter schema subset and apps must comply
- A bug on Google's side - The validation should accept more of standard JSON Schema Draft 2020-12
- A version mismatch - Different models/routes have different schema support
- A misconfiguration - There's an API flag or header to enable looser validation
Reproduction
Any tool schema using standard validation keywords like:
{
"type": "string",
"minLength": 1,
"pattern": "^[a-z]+$"
}
Causes 400 error through Cloud Code Assist but works on Anthropic/OpenAI APIs.
Bug Report: Google Cloud Code Assist / Antigravity JSON Schema Validation Failures
Summary
The Google Cloud Code Assist API (accessed via google-antigravity provider) has extremely strict JSON Schema validation for tool/function calling, causing repeated failures (400 "format" errors) with tool schemas that work fine on other providers (Anthropic, OpenAI, etc.).
Impact
Root Cause
The Cloud Code Assist API rejects a large subset of standard JSON Schema keywords that are used by tool libraries and other LLM providers:
Completely Rejected:
Validation Constraints (strict - cause 400 on any match):
Current Mitigation (in codebase)
The project already has a workaround at src/agents/schema/clean-for-gemini.ts that strips these keywords, but this:
Request
Please investigate whether:
Reproduction
Any tool schema using standard validation keywords like:
{
"type": "string",
"minLength": 1,
"pattern": "^[a-z]+$"
}
Causes 400 error through Cloud Code Assist but works on Anthropic/OpenAI APIs.