Skip to content

JSON Schema validation fails on empty tool parameters {} with Kimi K2.5 (strict mode error) #11357

@Seniortuco

Description

@Seniortuco

Description

Environment

  • OpenCode version: 1.1.46
  • Provider / Model: Kimi K2.5 (free via Fireworks or Moonshot endpoint)
  • OS: macOS
  • Date: January 30, 2026

Bug Description

When Kimi K2.5 attempts to call a tool with empty object parameters ({}), it returns a JSON Schema validation error:

JSON Schema not supported: could not understand the instance `{}`.

Or a similar variant:

could not validate instance {} against schema ...

This occurs consistently on certain OpenCode internal tools that define parameters: z.object({}) (typically those without required arguments, such as certain read/state helper tools).

Steps to Reproduce

  1. Update OpenCode to the latest version (opencode update or reinstall)
  2. Configure Kimi K2.5 as the main model (free for now)
  3. Start a session and request a task that triggers multiple tool calls in sequence
  4. Often after 2-5 exchanges → the error appears when the model wants to call a tool without parameters

Expected Behavior

OpenCode should be able to handle tool schemas with an empty object without causing validation failures on the provider side. Kimi K2.5 appears to have stricter JSON Schema validation than Claude / GPT-4o / Gemini on this specific case (likely requires explicit "required": [] even for an object without properties).

Current Workaround

Temporarily switch to another model (Claude 4, GPT-4o-mini, Gemini 2.0 flash, GLM-4.7…) → the bug disappears.

Or downgrade to Kimi Code / an earlier version if available.

Related Issues

Additional Context

Kimi K2.5 is excellent in terms of performance/price ratio right now. This small bug is the only real blocker for using it extensively in OpenCode. The issue seems to be related to how Kimi handles JSON Schema validation for minimal/empty objects - it may require explicit schema completion even when no properties are present.

Plugins

No response

OpenCode version

1.1.46

Steps to reproduce

  1. Update OpenCode to version 1.1.46 (or latest)
  2. Configure Kimi K2.5 as the main model (free via Fireworks or Moonshot endpoint)
  3. Start an OpenCode session with a complex task that requires multiple tool calls
  4. Request tasks that trigger sequential tool calls (e.g., code analysis with multiple helper tools)
  5. Within 2-5 exchanges, the model will attempt to call a tool with empty parameters ({})
  6. JSON Schema validation error appears

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions