Repository navigation
Bug: OpenCode Go bridge layer incompatible with kimi-k2.6 tool calls #26331
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Description
Bug Report: OpenCode Go bridge layer incompatible with kimi-k2.6 tool calls
Environment
- Client: MyAgents (Claude Agent SDK based)
- Provider: OpenCode Go
- Model: kimi-k2.6 (via Moonshot AI)
- API Protocols tested: OpenAI-compatible (
/zen/go/v1) and Anthropic (/zen/go)
Problem Description
When using kimi-k2.6 through OpenCode Go's bridge layer, tool calls fail due to incompatible message formatting. The issue manifests differently depending on which protocol is used:
1. OpenAI Protocol (/zen/go/v1) - Original Issue
Error:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error",
"message":"Error from provider: Provider returned error"}}
Root cause (from provider logs):
thinking is enabled but reasoning_content is missing in assistant tool call message at index 2
provider_name: Moonshot AI
Analysis:
- kimi-k2.6 has thinking enabled by default
- When the AI makes tool calls in subsequent conversation turns, the bridge layer fails to properly forward the
reasoning_contentfield in the message history - Moonshot AI rejects the request because the thinking content is missing from previous assistant messages
2. Anthropic Protocol (/zen/go) - Alternative Test
Error:
Invalid request: function name is invalid, must start with a letter
and can contain letters, numbers, underscores, and dashes
provider_name: Moonshot AI
Analysis:
- The Anthropic protocol bridge has a different issue with tool name formatting
- Tool names passed through the bridge don't meet Moonshot's validation requirements
Steps to Reproduce
For OpenAI Protocol Issue:
- Configure OpenCode Go with OpenAI protocol endpoint:
https://opencode.ai/zen/go/v1 - Use model
kimi-k2.6 - Start a conversation that triggers tool use (e.g., file operations, bash commands)
- After the first tool call response, send a follow-up message
- The 400 error occurs on the second turn when the conversation history includes tool results
For Anthropic Protocol Issue:
- Configure OpenCode Go with Anthropic protocol endpoint:
https://opencode.ai/zen/go - Use model
kimi-k2.6 - Attempt any tool call
- The request fails immediately with function name validation error
Expected Behavior
- kimi-k2.6 should work seamlessly through OpenCode Go bridge layer
- Tool calls should succeed across multiple conversation turns
- Thinking/reasoning content should be properly preserved and forwarded
Actual Behavior
- Both protocol bridges fail with kimi-k2.6 tool calls
- OpenAI bridge: Missing
reasoning_contentin message history - Anthropic bridge: Invalid tool name format
Workaround
Using Moonshot AI's native API endpoint (https://api.moonshot.cn/anthropic) works correctly with kimi-k2.6 and tool calls, confirming this is specifically an OpenCode Go bridge layer issue.
Additional Context
- kimi-k2.5 (without thinking) works fine through OpenCode Go
- The issue is specific to kimi-k2.6's thinking capability combined with tool use
- This appears to be a bridge layer message format conversion issue
Request
Please investigate and fix the bridge layer to properly handle:
reasoning_contentfield preservation in OpenAI protocol bridge- Tool name formatting in Anthropic protocol bridge
Thank you!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
github-actions commentedon May 8, 2026
This issue might be a duplicate of existing issues. Please check:
The
reasoning_contentnot being preserved in multi-turn tool call conversations is a well-known issue that has been reported many times for various thinking-enabled models (DeepSeek, Kimi K2.x). Please check if any of the above issues already tracks this and add a \u{1F44D} or comment there instead of opening a new one.lightrao commentedon May 26, 2026
I'm also experiencing a related but distinct error with opencode-go/kimi-k2.6. When the model tries to process multimodal content (images), I get:
This suggests the Go backend's OpenAI Chat protocol handler (at the
/zen/go/v1/chat/completionsendpoint) rejects user messages containing non-text content like images. Kimi K2.6 is a multimodal model that supports image input, but the protocol bridge doesn't seem to handle image content in user messages.This might be a different layer of the same bridge incompatibility described in this issue. Wanted to add this error variant here in case it helps with diagnosis.
github-actions commentedon Jul 26, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.