Skip to content

fix(provider): assistant tool-call messages missing reasoning_content on Kimi K2.6 #23827

Closed

Description

@fkyah3

Problem
Using Kimi K2.6 with , long sessions fail with:

When it happens
Historical assistant messages that contain parts but no parts don't get injected. The existing fix () only covers messages after the last user turn.

Repro

  1. Start a session with Kimi K2.6
  2. Trigger a tool call (e.g. On branch fix/permission-reasoning-truncation
    Your branch is up to date with 'origin/fix/permission-reasoning-truncation'.

Untracked files:
(use "git add ..." to include in what will be committed)
fkyah3_dev/

nothing added to commit but untracked files present (use "git add" to track))
3. Continue conversation until ~80+ messages
4. Re-open the session and send any message → error on historical tool-call assistants

Fix approach
In , force empty for all assistant messages containing parts when is enabled, not just post-last-user messages.

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


Tested on Win11 + Bun 1.3.11, OpenCode dev mode.

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:

    All of these reports describe the same root cause and reference the same fix implementation. Please consolidate into a single issue.

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