Added Kimi API key invocation and the new model Kimi-k2.5 #7743

Open
opened 2026-02-16 18:08:06 -05:00 by yindo · 6 comments
Owner

Originally created by @anyiba on GitHub (Jan 27, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Kimi-k2.5 model adaptation,
Added Kimi API key invocation and the new model Kimi-k2.5

Plugins

vscode

OpenCode version

v1.1.36

Steps to reproduce

thinking is enabled but reasoning_content is missing in assistant tool call message at index 2

Screenshot and/or share link

Image

Operating System

windows 11

Terminal

VS Code terminal

Originally created by @anyiba on GitHub (Jan 27, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description Kimi-k2.5 model adaptation, Added Kimi API key invocation and the new model Kimi-k2.5 ### Plugins vscode ### OpenCode version v1.1.36 ### Steps to reproduce thinking is enabled but reasoning_content is missing in assistant tool call message at index 2 ### Screenshot and/or share link <img width="585" height="111" alt="Image" src="https://github.com/user-attachments/assets/ce60a697-1203-46c2-b1c1-b5b9182a7300" /> ### Operating System windows 11 ### Terminal VS Code terminal
yindo added the windowsbug labels 2026-02-16 18:08:06 -05:00
Author
Owner

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

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

  • #10811: [FEATURE]: kimi k2.5 integration - Feature request for kimi k2.5 integration
  • #8851: Kimi-K2 via OpenRouter fails with tool call tokens inside thinking block - Related to tool call issues with thinking/reasoning content
  • #9433: Logic behind mapping tags to reasoning_content - Related to reasoning_content handling in thinking mode
  • #7314: Missing Kimi model options: K2 turbo and K2 thinking turbo for coding - Related to Kimi model configuration

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 27, 2026): This issue might be a duplicate of existing issues. Please check: - #10811: [FEATURE]: kimi k2.5 integration - Feature request for kimi k2.5 integration - #8851: Kimi-K2 via OpenRouter fails with tool call tokens inside thinking block - Related to tool call issues with thinking/reasoning content - #9433: Logic behind mapping <think> tags to reasoning_content - Related to reasoning_content handling in thinking mode - #7314: Missing Kimi model options: K2 turbo and K2 thinking turbo for coding - Related to Kimi model configuration Feel free to ignore if none of these address your specific case.
Author
Owner

@kassieclaire commented on GitHub (Jan 27, 2026):

Are you using DCP? There might be an issue related to pruning tool use context that includes thinking for K2.5

@kassieclaire commented on GitHub (Jan 27, 2026): Are you using DCP? There might be an issue related to pruning tool use context that includes thinking for K2.5
Author
Owner

@mcowger commented on GitHub (Jan 27, 2026):

I have this an dont use DCP

@mcowger commented on GitHub (Jan 27, 2026): I have this an dont use DCP
Author
Owner

@kassieclaire commented on GitHub (Jan 27, 2026):

Do you have any custom settings related to the Kimi-K2.5 model in your configuration, and which provider are you using?

@kassieclaire commented on GitHub (Jan 27, 2026): Do you have any custom settings related to the Kimi-K2.5 model in your configuration, and which provider are you using?
Author
Owner

@qingchunnh commented on GitHub (Jan 27, 2026):

I'm using OpenRouter's API. I solved a similar problem through #6040, so this might help you.

@qingchunnh commented on GitHub (Jan 27, 2026): I'm using OpenRouter's API. I solved a similar problem through #6040, so this might help you.
Author
Owner

@jackjoliet commented on GitHub (Feb 11, 2026):

Might be a different stack, but I was facing the same issue with ai-sdk. Here's what solved it for me

// reasoning_content — Kimi's API requires this field on every assistant
// tool-call message when thinking mode is enabled.
const kimiProvider = createOpenAICompatible({
  name: 'moonshot',
  baseURL: 'https://api.moonshot.ai/v1',
  apiKey: KIMI_API_KEY,
  includeUsage: true,
  transformRequestBody: (body: Record<string, unknown>) => {
    const messages = body.messages
    if (!Array.isArray(messages)) return body
    for (const msg of messages) {
      if (
        msg.role === 'assistant' &&
        Array.isArray(msg.tool_calls) &&
        msg.tool_calls.length > 0 &&
        !msg.reasoning_content
      ) {
        msg.reasoning_content = '.'
      }
    }
    return body
  },
})
@jackjoliet commented on GitHub (Feb 11, 2026): Might be a different stack, but I was facing the same issue with ai-sdk. Here's what solved it for me ``` // reasoning_content — Kimi's API requires this field on every assistant // tool-call message when thinking mode is enabled. const kimiProvider = createOpenAICompatible({ name: 'moonshot', baseURL: 'https://api.moonshot.ai/v1', apiKey: KIMI_API_KEY, includeUsage: true, transformRequestBody: (body: Record<string, unknown>) => { const messages = body.messages if (!Array.isArray(messages)) return body for (const msg of messages) { if ( msg.role === 'assistant' && Array.isArray(msg.tool_calls) && msg.tool_calls.length > 0 && !msg.reasoning_content ) { msg.reasoning_content = '.' } } return body }, }) ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7743