Skip to content

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

Closed

Description

@fkyah3

Bug: When using interleaved reasoning models (e.g. Kimi K2.5, K2.6 via OpenAI-compatible), historical assistant messages containing tool calls but no reasoning parts fail validation with:

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

Root cause: only adds empty for messages after the last user turn. Historical assistant messages with tool calls are skipped.

Fix: Force (empty string) on all interleaved assistant messages that contain tool calls, not just post-user messages.

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

Refs: AI SDK PR #12049, Vercel/ai issue #14071

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 doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • No issue template was used. Please use the Bug Report template, which requires a Description field with real content, steps to reproduce, and system information.
    • The title uses a commit-message format (fix(provider): ...). Bug report titles should describe the problem, not the proposed fix.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


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

    If you believe this was flagged incorrectly, please let a maintainer know.

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)needs:complianceThis means the issue will auto-close after 2 hours.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions