Skip to content

[Bug] Gemini models reject edit tool due to anyOf schema violation in parameters.edits #14700

@ArtanisInc

Description

@ArtanisInc

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions