Skip to content

Kimi for Coding (k2p5) fails with tool calls when thinking enabled: reasoning_content is missing in assistant tool call message #10996

Description

@willy-scr

Description

Environment

  • OpenCode: v1.1.39
  • OS: Windows (running via WSL2 Ubuntu 22.04)
  • Provider: kimi-for-coding (via opencode auth login)
  • Model: k2p5 (Kimi K2.5)
  • API endpoint (from logs): https://api.kimi.com/coding/v1/messages
    Problem
    When using Kimi for Coding with thinking enabled, any session that triggers tool calls (e.g. Grep/Read) fails with HTTP 400.
    Actual
    OpenCode errors:
    error, status code: 400, message: thinking is enabled but reasoning_content is missing in assistant tool call message at index 101
    Sometimes the index changes as the conversation grows, e.g.:
    ... missing in assistant tool call message at index 104
    Expected
    Tool calls should work while thinking is enabled, or OpenCode should disable thinking / handle reasoning_content correctly for tool call messages (or provide a documented toggle/workaround).
    Reproduction steps
  1. opencode auth login → choose Kimi for Coding
  2. Start a session using model k2p5 (Kimi K2.5)
  3. Ask the agent to do something that triggers tools, e.g. “grep X in file Y” / “read file”
  4. Observe error 400 above.
    Logs (excerpt)
    From ~/.local/share/opencode/log/.log:
  • Request:
  • Response:
    • 400 thinking is enabled but reasoning_content is missing in assistant tool call message at index ...
      Notes / workaround
      Disabling thinking (thinking: disabled) avoids the crash, but removes visible “thinking”.
version'."},"query":{"type":"string","description":"The question or task you need help with. Be specific and include relevant details. Good: 'How to set up authentication with JWT in Express.js' or 'React useEffect cleanup function examples'. Bad: 'auth' or 'hooks'. IMPORTANT: Do not include any sensitive or confidential information such as API keys, passwords, credentials, or personal data in your query."}},"required":["libraryId","query"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}],"tool_choice":{"type":"auto"},"stream":true},"statusCode":400,"responseHeaders":{"cf-cache-status":"DYNAMIC","cf-ray":"9c503405bf4c1f6e-SIN","connection":"keep-alive","content-length":"200","content-type":"application/json; charset=utf-8","date":"Wed, 28 Jan 2026 11:38:23 GMT","server":"cloudflare","strict-transport-security":"max-age=31536000; includeSubDomains"},"responseBody":"{\"error\":{\"type\":\"invalid_request_error\",\"message\":\"error, status code: 400, message: thinking is enabled but reasoning_content is missing in assistant tool call message at index 101\"},\"type\":\"error\"}","isRetryable":false,"data":{"type":"error","error":{"type":"invalid_request_error","message":"error, status code: 400, message: thinking is enabled but reasoning_content is missing in assistant tool call message at index 101"}}}} stream error
ERROR 2026-01-28T11:38:22 +3ms service=session.processor error=error, status code: 400, message: thinking is enabled but reasoning_content is missing in assistant tool call message at index 101 stack="AI_APICallError: error, status code: 400, message: thinking is enabled but reasoning_content is missing in assistant tool call message at index 101\n    at <anonymous> (../../node_modules/.bun/@[email protected]+d6123d32214422cb/node_modules/@ai-sdk/provider-utils/dist/index.mjs:936:18)\n    at processTicksAndRejections (native:7:39)" process
INFO  2026-01-28T11:38:22 +0ms service=bus type=session.error publishing
INFO  2026-01-28T11:38:22 +2ms service=bus type=message.updated publishing

Plugins

dcp, auth antigravity

OpenCode version

v1.1.39

Steps to reproduce

  1. Run opencode auth login and select Kimi for Coding
  2. Start a new session using model k2p5
  3. Ask the agent to perform an action that triggers tool calls, e.g.:
    • “Grep subject_anchor in windows-app/story_presets.json”
  4. Observe the request fails with HTTP 400:
    thinking is enabled but reasoning_content is missing in assistant tool call message at index ...

Workaround
If thinking is disabled, tool calls work.

Screenshot and/or share link

Image Image

Operating System

windows 11 pro, but i use WSL full opencode

Terminal

wezterm

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwindows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions