Ollama Cloud and Zen: "JSON Schema not supported: could not understand the instance {}" with kimi-k2.5 #7898

Closed
opened 2026-02-16 18:08:36 -05:00 by yindo · 5 comments
Owner

Originally created by @ashaney on GitHub (Jan 28, 2026).

Originally assigned to: @fwang on GitHub.

Description

Description:

When using Ollama Cloud as a provider, the kimi-k2.5 model fails with a JSON
Schema error during tool calling. This occurs in both OpenCode Zen mode and
standard mode. Other models like glm-4.7 work correctly with the same
configuration.

Error Message:
Bad Request: JSON Schema not supported: could not understand the instance
{}.

Affected:

  • OpenCode Zen mode + Ollama provider + kimi-k2.5
  • OpenCode standard mode + Ollama provider + kimi-k2.5
  • OpenCode Zen mode + Ollama provider + glm-4.7
  • OpenCode standard mode + Ollama provider + glm-4.7

Environment:

  • OpenCode version: latest as of 2026-01-28
  • Provider: @ai-sdk/openai-compatible
  • Base URL: https://ollama.com/v1
  • Working model: glm-4.7
  • Failing model: kimi-k2.5

Config:
{
"provider": {
"ollama": {
"npm": "@ai-sdk/openai-compatible",
"name": "Ollama Cloud",
"options": {
"baseURL": "https://ollama.com/v1",
"headers": {
"Authorization": "Bearer $OLLAMA_API_KEY"
}
}
}
}
}

Steps to Reproduce:

  1. Configure Ollama Cloud provider as shown above
  2. Select kimi-k2.5 as the model
  3. Launch OpenCode
  4. Send any prompt that triggers tool use

Expected Behavior:
Tool calls should work as they do with glm-4.7 and other models in both modes.

Analysis:
The error suggests an empty {} schema is being sent in a tool definition that
kimi-k2.5 rejects but glm-4.7 tolerates. Since both Zen and Ollama as providers
fail identically, this is likely in the shared tool schema generation code.

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @ashaney on GitHub (Jan 28, 2026). Originally assigned to: @fwang on GitHub. ### Description Description: When using Ollama Cloud as a provider, the kimi-k2.5 model fails with a JSON Schema error during tool calling. This occurs in both OpenCode Zen mode and standard mode. Other models like glm-4.7 work correctly with the same configuration. Error Message: Bad Request: JSON Schema not supported: could not understand the instance `{}`. Affected: - OpenCode Zen mode + Ollama provider + kimi-k2.5 ❌ - OpenCode standard mode + Ollama provider + kimi-k2.5 ❌ - OpenCode Zen mode + Ollama provider + glm-4.7 ✅ - OpenCode standard mode + Ollama provider + glm-4.7 ✅ Environment: - OpenCode version: latest as of 2026-01-28 - Provider: @ai-sdk/openai-compatible - Base URL: https://ollama.com/v1 - Working model: glm-4.7 - Failing model: kimi-k2.5 Config: { "provider": { "ollama": { "npm": "@ai-sdk/openai-compatible", "name": "Ollama Cloud", "options": { "baseURL": "https://ollama.com/v1", "headers": { "Authorization": "Bearer $OLLAMA_API_KEY" } } } } } Steps to Reproduce: 1. Configure Ollama Cloud provider as shown above 2. Select kimi-k2.5 as the model 3. Launch OpenCode 4. Send any prompt that triggers tool use Expected Behavior: Tool calls should work as they do with glm-4.7 and other models in both modes. Analysis: The error suggests an empty {} schema is being sent in a tool definition that kimi-k2.5 rejects but glm-4.7 tolerates. Since both Zen and Ollama as providers fail identically, this is likely in the shared tool schema generation code. ### Plugins _No response_ ### OpenCode version _No response_ ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the bugzen labels 2026-02-16 18:08:36 -05:00
yindo closed this issue 2026-02-16 18:08:36 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 28, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #11072: [BUG] Kimi k2.5 is having trouble making edits - Same model (kimi-k2.5) having trouble with tool-related functionality
  • #11053: [BUG] Kimi k2.5 doesn't use the question tool - Same model (kimi-k2.5) failing to properly use tools
  • #10996: Kimi for Coding (k2p5) fails with tool calls when thinking enabled - Similar kimi model with JSON schema/tool call issues

Feel free to ignore if your specific case differs from these, but they may provide additional context or solutions.

@github-actions[bot] commented on GitHub (Jan 28, 2026): This issue might be a duplicate of existing issues. Please check: - #11072: [BUG] Kimi k2.5 is having trouble making edits - Same model (kimi-k2.5) having trouble with tool-related functionality - #11053: [BUG] Kimi k2.5 doesn't use the question tool - Same model (kimi-k2.5) failing to properly use tools - #10996: Kimi for Coding (k2p5) fails with tool calls when thinking enabled - Similar kimi model with JSON schema/tool call issues Feel free to ignore if your specific case differs from these, but they may provide additional context or solutions.
Author
Owner

@ideallove commented on GitHub (Jan 28, 2026):

I think it's because K2.5 has a default setting of 32k for the maximum tokens, and there is a hardcoded error in the current version (1.1.37 - 1.1.40). You can refer to the explanation in my PR and https://github.com/anomalyco/opencode/issues/10967#issuecomment-3814885708.

@ideallove commented on GitHub (Jan 28, 2026): I think it's because K2.5 has a default setting of 32k for the maximum tokens, and there is a hardcoded error in the current version (1.1.37 - 1.1.40). You can refer to the explanation in my PR and https://github.com/anomalyco/opencode/issues/10967#issuecomment-3814885708.
Author
Owner

@ashaney commented on GitHub (Jan 28, 2026):

@ideallove in my case (not ideal for everyone certainly) I ran opencode uninstall and then ran the standard curl installer script. After that both Ollama cloud and Zen started working.

@ashaney commented on GitHub (Jan 28, 2026): @ideallove in my case (not ideal for everyone certainly) I ran `opencode uninstall` and then ran the standard curl installer script. After that both Ollama cloud and Zen started working.
Author
Owner

@slibien commented on GitHub (Feb 5, 2026):

Sooo how did anyone fix this, im running into the same issue and I don´t know what to do😭😭

@slibien commented on GitHub (Feb 5, 2026): Sooo how did anyone fix this, im running into the same issue and I don´t know what to do😭😭
Author
Owner

@slibien commented on GitHub (Feb 6, 2026):

Nvm, I just did the same as @ashaney and it worked perfectly

@slibien commented on GitHub (Feb 6, 2026): Nvm, I just did the same as @ashaney and it worked perfectly
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7898