Skip to content

fix(antigravity): match schema items to the selected type - #8759

Merged
Wei-Shaw merged 1 commit into
Wei-Shaw:mainfrom
r266-tech:codex/gemini-schema-array-items
Nov 16, 2026
Merged

Wei-Shaw merged 1 commit into
Wei-Shaw:mainfrom
r266-tech:codex/gemini-schema-array-items

Conversation

@r266-tech

Copy link
Copy Markdown
Contributor

Fixes #8758.

A tool parameter such as {"type":["string","array"],"items":{"type":"string"}} became string + items, which Gemini rejects. Normalize items after 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 named items.

Validation on macOS arm64 / Go 1.27.4:

  • The new regression failed in all three protocols on 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.
  • CI-pinned golangci-lint v2.14.0: 0 issues; gofmt and git diff --check passed.

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.

@Wei-Shaw
Wei-Shaw merged commit 2027404 into Wei-Shaw:main Nov 16, 2026
8 of 9 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

请求gemini的模型报错Upstream request failed

2 participants