Repository navigation
fix(antigravity): match schema items to the selected type - #8759
Merged
Wei-Shaw merged 1 commit intoNov 16, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8758.
A tool parameter such as
{"type":["string","array"],"items":{"type":"string"}}becamestring + items, which Gemini rejects. Normalizeitemsafter the existing type selection: remove it from non-array schemas, and reuse the string-item fallback whenever an array's items is missing or is not a schema object. This also replaces the previous parallel checks for nil, booleans and empty maps.Type unions retain their existing first non-null selection: the example becomes
{"type":"string"}; an array-first union retains its item schema. The regression captures the final upstream request from the real Chat Completions, Responses and Messages forwarding methods, including nested unions, inferred arrays, malformed items and a property literally nameditems.Validation on macOS arm64 / Go 1.27.4:
main@530c5e3a, then passed with this change; existing Schema/tool controls passed.go test -tags=unit ./... -json: 26,883 tests/subtests passed, 41 skipped.go test -tags=integration ./... -json: 16,147 tests/subtests passed, 16 skipped; original testcontainers harness with PostgreSQL/Redis, no overlay.git diff --checkpassed.No live Gemini/provider request was made. Main's Go 1.27.3 security-scan failure is tracked separately in #8670.
AI disclosure: implemented and validated autonomously by an AI agent, without human implementation or review.