Description
When using Gemini models (e.g. gemini-3-pro-preview, gemini-3.1-pro-preview) via the native google provider, all requests fail with:
Bad Request: Unable to submit request because `edit` functionDeclaration `parameters.edits` schema specified other fields alongside any_of. When using any_of, it must be the only field set.
The issue is that the edit tool's function declaration schema uses anyOf combined with other fields (like type, description, properties, etc.) in the parameters.edits property. This is valid JSON Schema but violates Google's API constraint that when anyOf is used, it must be the only field set in that schema object.
Plugins
No response
OpenCode version
No response
Steps to reproduce
No response
Screenshot and/or share link
Operating System
No response
Terminal
No response
Description
When using Gemini models (e.g.
gemini-3-pro-preview,gemini-3.1-pro-preview) via the nativegoogleprovider, all requests fail with:The issue is that the
edittool's function declaration schema usesanyOfcombined with other fields (liketype,description,properties, etc.) in theparameters.editsproperty. This is valid JSON Schema but violates Google's API constraint that whenanyOfis used, it must be the only field set in that schema object.Plugins
No response
OpenCode version
No response
Steps to reproduce
No response
Screenshot and/or share link
Operating System
No response
Terminal
No response