Repository navigation
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
Activity
rekram1-node commentedon Jan 30, 2026
Can you send me an example?
opencode export > session.jsonR44VC0RP commentedon Jan 30, 2026
I am unable to repro this on 1.1.46 with Kimi K2.5 Fireworks or Kimi K2.5 via Zen
moddi3 commentedon Jan 31, 2026
@rekram1-node i have the issue with opencode 1.47 and kimi-k2.5-free on zen, here is sesstion export
session.json
drevantonder commentedon Feb 1, 2026
Similar and/or related. I get
session json:
{ "info": { "id": "ses_3e775b654ffepnRjPmQPuWU9n1", "slug": "tidy-canyon", "version": "1.1.48", "projectID": "44fae5a933cfba39852e86b08f84d825ce4b9515", "directory": "/Users/drevan/projects/personal", "title": "Light chat greeting", "time": { "created": 1769938241963, "updated": 1769938247170 }, "summary": { "additions": 0, "deletions": 0, "files": 0 } }, "messages": [ { "info": { "id": "msg_c188a49ae001yZjr6PtM7MO06K", "sessionID": "ses_3e775b654ffepnRjPmQPuWU9n1", "role": "user", "time": { "created": 1769938241973 }, "summary": { "title": "Greeting tone check-in", "diffs": [] }, "agent": "build", "model": { "providerID": "opencode", "modelID": "kimi-k2.5-free" } }, "parts": [ { "id": "prt_c188a49ae002jQK8pDvgT0KOQn", "sessionID": "ses_3e775b654ffepnRjPmQPuWU9n1", "messageID": "msg_c188a49ae001yZjr6PtM7MO06K", "type": "text", "text": "hey!" } ] }, { "info": { "id": "msg_c188a49be001v5GnC5o3ER55y4", "sessionID": "ses_3e775b654ffepnRjPmQPuWU9n1", "role": "assistant", "time": { "created": 1769938241982, "completed": 1769938249755 }, "error": { "name": "APIError", "data": { "message": "JSON Schema not supported: could not understand the instance `{'not': {}}`.", "statusCode": 400, "isRetryable": false, "responseHeaders": { "cf-placement": "remote-ATL", "cf-ray": "9c706ea6ac4c2f4b-LAX", "connection": "keep-alive", "content-type": "application/json", "date": "Sun, 01 Feb 2026 09:30:49 GMT", "server": "cloudflare", "transfer-encoding": "chunked", "vary": "accept-encoding" }, "responseBody": "{\"error\":{\"object\":\"error\",\"type\":\"invalid_request_error\",\"code\":\"invalid_request_error\",\"message\":\"JSON Schema not supported: could not understand the instance `{'not': {}}`.\"}}", "metadata": { "url": "https://opencode.ai/zen/v1/chat/completions" } } }, "parentID": "msg_c188a49ae001yZjr6PtM7MO06K", "modelID": "kimi-k2.5-free", "providerID": "opencode", "mode": "build", "agent": "build", "path": { "cwd": "/Users/drevan/projects/personal", "root": "/Users/drevan/projects/personal" }, "cost": 0, "tokens": { "input": 0, "output": 0, "reasoning": 0, "cache": { "read": 0, "write": 0 } } }, "parts": [] } ] }If I disable all the MCP servers in my project's opencode.json, it works. My
opencode.jsonin the project:{ "$schema": "https://opencode.ai/config.json", "mcp": { "cloudflare-bindings": { "type": "remote", "enabled": true, "url": "https://bindings.mcp.cloudflare.com/mcp" }, "cloudflare-docs": { "type": "remote", "enabled": true, "url": "https://docs.mcp.cloudflare.com/mcp" }, "cloudflare-worker-observability": { "type": "remote", "enabled": true, "url": "https://observability.mcp.cloudflare.com/mcp" }, "cloudflare-worker-builds": { "type": "remote", "enabled": true, "url": "https://builds.mcp.cloudflare.com/mcp" } } }Or if I run it outside the project, it works as well.
tomjod commentedon Feb 2, 2026
same problem here but If I disable all the MCP servers in my project's opencode.json, it works.
drevantonder commentedon Feb 3, 2026
Strangely, if I disable all the MCP tools via glob pattern and renable manually for each one (minus one specific tool for
mcp-google-sheets) it now works. E.g.{ "tools": { "mcp-google-sheets*": false, "cloudflare-bindings*": false, "cloudflare_bindings_accounts_list": true, "cloudflare_bindings_set_active_account": true, "cloudflare_bindings_kv_namespaces_list": true, "cloudflare_bindings_kv_namespace_create": true, "cloudflare_bindings_kv_namespace_delete": true, "cloudflare_bindings_kv_namespace_get": true, "cloudflare_bindings_kv_namespace_update": true, "cloudflare_bindings_workers_list": true, "cloudflare_bindings_workers_get_worker": true, "cloudflare_bindings_workers_get_worker_code": true, "cloudflare_bindings_r2_buckets_list": true, "cloudflare_bindings_r2_bucket_create": true, "cloudflare_bindings_r2_bucket_get": true, "cloudflare_bindings_r2_bucket_delete": true, "cloudflare_bindings_d1_databases_list": true, "cloudflare_bindings_d1_database_create": true, "cloudflare_bindings_d1_database_delete": true, "cloudflare_bindings_d1_database_get": true, "cloudflare_bindings_d1_database_query": true, "cloudflare_bindings_hyperdrive_configs_list": true, "cloudflare_bindings_hyperdrive_config_create": true, "cloudflare_bindings_hyperdrive_config_delete": true, "cloudflare_bindings_hyperdrive_config_get": true, "cloudflare_bindings_hyperdrive_config_edit": true, "mcp-google-sheets_add_columns": true, "mcp-google-sheets_add_rows": true, "mcp-google-sheets_batch_update": true, "mcp-google-sheets_batch_update_cells": true, "mcp-google-sheets_copy_sheet": true, "mcp-google-sheets_create_sheet": true, "mcp-google-sheets_create_spreadsheet": true, "mcp-google-sheets_find_in_spreadsheet": true, "mcp-google-sheets_get_multiple_sheet_data": true, "mcp-google-sheets_get_multiple_spreadsheet_summary": true, "mcp-google-sheets_get_sheet_data": true, "mcp-google-sheets_get_sheet_formulas": true, "mcp-google-sheets_list_folders": true, "mcp-google-sheets_list_sheets": true, "mcp-google-sheets_list_spreadsheets": true, "mcp-google-sheets_rename_sheet": true, "mcp-google-sheets_search_spreadsheets": true, "mcp-google-sheets_share_spreadsheet": true, // "mcp-google-sheets_update_cells": true } }And more details on what/which error:
mcp-google-sheetsenabled gives:cloudflare-bindingsenabled gives:(The rest of the MCPs don't throw an error)
rekram1-node commentedon Feb 3, 2026
Ahh okay that helps, ill look
chandler2252 commentedon Feb 6, 2026
Unrelated to opencode, but I am seeing the same exact situation with Flowise 3.0.12 self hosted. Same model on Fireworks. Same response. I've tried it with many different MCP servers and tools. Unsure what is causing it currently.
For what it's worth.
fix(opencode): Add MCP schema sanitization for Kimi K2.5 compatibility
github-actions commentedon Apr 8, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.