Skip to content

Bug: OpenCode Go bridge layer incompatible with kimi-k2.6 tool calls #26331

Closed as not planned

Description

@pronzcw

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_content field 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:

  1. Configure OpenCode Go with OpenAI protocol endpoint: https://opencode.ai/zen/go/v1
  2. Use model kimi-k2.6
  3. Start a conversation that triggers tool use (e.g., file operations, bash commands)
  4. After the first tool call response, send a follow-up message
  5. The 400 error occurs on the second turn when the conversation history includes tool results

For Anthropic Protocol Issue:

  1. Configure OpenCode Go with Anthropic protocol endpoint: https://opencode.ai/zen/go
  2. Use model kimi-k2.6
  3. Attempt any tool call
  4. 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_content in 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:

  1. reasoning_content field preservation in OpenAI protocol bridge
  2. Tool name formatting in Anthropic protocol bridge

Thank you!

Activity

  1. github-actions commented on May 8, 2026

    @github-actions
    Contributor

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

    The reasoning_content not 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.

  2. lightrao commented on May 26, 2026

    @lightrao

    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:

    ProviderShared.request: OpenAI Chat user messages only support text content for now
    

    This suggests the Go backend's OpenAI Chat protocol handler (at the /zen/go/v1/chat/completions endpoint) 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.

  3. github-actions commented on Jul 26, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions