Skip to content

fix(provider): assistant messages with tool calls missing reasoning_content on Kimi K2.6 #23828

Closed

Description

@fkyah3

Description

When using Kimi K2.6 (via OpenAI-compatible provider) with , long conversations fail during history replay with:

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

Root cause

in only adds when:

  1. Assistant message actually contains reasoning parts, OR
  2. Message is after the last user turn

Historical assistant messages that contain tool calls but no reasoning are missed, violating API requirements.

Fix

Force empty on all interleaved assistant messages containing tool calls:

Reference implementation: https://github.com/fkyah3/opencode-fkyah3/commit/d14da0b74

Verification

Tested in dev mode with multi-turn tool call conversations (git commands + document summarization). History replay no longer triggers the error.

Related

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 22, 2026
  2. github-actions commented on Apr 22, 2026

    @github-actions
    Contributor

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

    Please check these issues to see if your report is already covered. If so, consider closing this one and contributing to the existing discussion.

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

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions