Skip to content

OpenCode 2: Gemini requests fail with 400 Unknown name "exclusiveMinimum" when a submitted tool schema has an exclusive bound #36

Closed

Description

@chrisolszewski

What happens

On OpenCode 2 with v3.0.2, a request to an Antigravity Gemini model fails when any of its submitted tool declarations still has exclusiveMinimum. OpenCode 2's built-in webfetch tool is one such case. Its timeout parameter is Schema.isGreaterThan(0) (packages/core/src/tool/plugin/webfetch.ts), which becomes "exclusiveMinimum": 0. Ordinary sessions include that tool, so their Gemini requests fail.

The endpoint rejects the request:

Invalid JSON payload received. Unknown name "exclusiveMinimum" at
'request.tools[0].function_declarations[33].parameters.properties[2].value': Cannot find field.
Status: 400
Requested Model: antigravity-gemini-3.8-flash

Cause

applyGeminiTransforms (packages/core/src/transform/gemini.ts) moves numeric JSON-Schema keywords into the description only for GPT-OSS models:

const result = normalizeGeminiTools(payload, {
  moveNumericConstraintsToDescription: model
    .toLowerCase()
    .startsWith('gpt-oss-'),
})

For Gemini models, the numeric keywords stay in the schema. toGeminiSchema strips some unsupported keywords, but none of the numeric ones. The cleaner that does remove exclusiveMinimum, cleanJSONSchemaForAntigravity in packages/opencode/src/plugin/request-helpers.ts, runs only for Claude models.

Reproduction

  1. Run OpenCode 2.0.28 with @cortexkit/opencode-antigravity-auth 3.0.2 as its plugin, with one Antigravity account.
  2. Send a prompt to google/antigravity-gemini-3.8-flash in a session whose tools include the built-in webfetch.
  3. The request fails with the 400 above.

A live retest succeeded with moveNumericConstraintsToDescription: true for all models handled by applyGeminiTransforms, including a turn that made a bash tool call. The constraint then becomes a hint appended to the description: "Optional timeout in seconds (maximum: 120) (exclusiveMinimum: 0, maximum: 120)".

Suggested fix

Move numeric constraints into descriptions for Gemini models as well as GPT-OSS. If that is too broad, at least strip exclusiveMinimum, which the endpoint rejects outright. exclusiveMaximum also passes through untouched for Gemini, and the Claude cleaner treats it as unsupported. I have not seen the endpoint reject it, but it should be handled the same way.

A unit test can call applyGeminiTransforms with model: 'gemini-3.8-flash' and a tool whose property has exclusiveMinimum, then assert that the keyword is gone from the declaration.

Activity

  1. chrisolszewski commented on Oct 14, 2026

    @chrisolszewski
    Author

    Fixed in v3.0.3 by the tool-schema normalization (exclusive bounds now move into the description); confirmed on OpenCode 2. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions