Skip to content

fix(provider): missing reasoning_content for tool-call assistant messages with interleaved models #23826

Closed

Description

@fkyah3

Description

When using Kimi K2.6 (via OpenAI-compatible provider with \interleaved\ reasoning), long conversation history replay fails with:

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

New message generation works fine. Only historical message replay triggers the error.

Root cause

in filters reasoning parts from assistant message content and places them into . However, it only does this when:

  1. reasoning text exists, or
  2. the message is after the last user turn

Historical assistant messages containing tool calls but no reasoning parts get no field, violating API requirements.

Solution

Also force empty when assistant messages contain tool calls and the model uses interleaved reasoning.

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

Environment

  • Model: Kimi K2.6 via OpenAI-compatible provider
  • OS: Windows 11

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 review these issues and, if this is indeed a duplicate, consider closing this one in favor of the existing report.

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)windows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions