fix: sanitize empty Gemini object requirements#11955
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge The previous WARNING (missing changeset for this user-facing bug fix) is resolved: this update adds Files Reviewed (3 files)
Previous Review Summary (commit b07dff5)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit b07dff5)Status: 1 Issue Found | Recommendation: Merge (non-blocking) Overview
The fix itself is correct: it filters the Gemini-facing Issue Details (click to expand)WARNING
Files Reviewed (2 files)
Reviewed by claude-sonnet-5-20260630 · Input: 14 · Output: 2.4K · Cached: 245.2K Review guidance: REVIEW.md from base branch |
|
|
||
| expect(result.properties.issue_fields.items.required).toBeUndefined() | ||
| }) | ||
|
|
There was a problem hiding this comment.
please move the new tests to a new file in a kilocode folder
Summary
Fixes #11950.
Gemini rejects function declarations when a nested object schema has
requiredentries that are not defined in that same node'sproperties. MCP tools can expose this shape through array item schemas, which makes the request fail before any model output.Changes
requiredarrays to names that exist in the same schema node'sproperties.requiredwhen an object schema has noproperties, or when filtering leaves no valid required fields.properties, including the Kilo Gateway Gemini route.Verification
bun test ./test/provider/transform.test.ts bun run typecheck git diff --check HEAD^..HEAD -- packages/opencode/src/provider/transform.ts packages/opencode/test/provider/transform.test.ts