-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Description
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
- Update OpenCode to the latest version (opencode update or reinstall)
- Configure Kimi K2.5 as the main model (free for now)
- Start a session and request a task that triggers multiple tool calls in sequence
- 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
- Similar issue already reported: Strict JSON Schema validation fail on backends like SGLang (Missing required field in empty tool parameters) #8184 (mentions SGLang + zod → JSON Schema without "required")
- Tweet reporting same problem: https://x.com/SirDiden/status/2017284394075971838
- Previous tweet from same user: https://x.com/SirDiden/status/2017204889202373069
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
- Update OpenCode to version 1.1.46 (or latest)
- Configure Kimi K2.5 as the main model (free via Fireworks or Moonshot endpoint)
- Start an OpenCode session with a complex task that requires multiple tool calls
- Request tasks that trigger sequential tool calls (e.g., code analysis with multiple helper tools)
- Within 2-5 exchanges, the model will attempt to call a tool with empty parameters ({})
- JSON Schema validation error appears
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response