Skip to content

HuggingFace provider: reasoning_details not stripped from conversation history for Kimi-K2.5 #13002

Closed

Description

@DeviousCardi

Description

When using moonshotai/Kimi-K2.5:together via the HuggingFace provider, the model returns reasoning_details in its responses. On subsequent turns, OpenCode passes this field back in the conversation history, causing a 400 error from the API:
Extra inputs are not permitted, field: 'messages[2].reasoning_details',

{
"$schema": "https://opencode.ai/config.json",
"provider": {
"huggingface": {
"options": {
"headers": {
"X-HF-Bill-To": "my-lisa"
}
},
"models": {
"moonshotai/Kimi-K2.5:together": {
"name": "kimi k2.5 together",
"reasoning": true,
"interleaved": {
"field": "reasoning_details"
}
}
}
}
}
}
What I've tried (none worked)

Adding "interleaved": { "field": "reasoning_content" } (per #6040)
Setting "reasoning": true with interleaved
Setting "reasoning": false
Starting fresh sessions after each config change
Clearing session cache

Expected behavior
OpenCode should strip reasoning_details from assistant messages before sending them back to the API, or properly map them using the interleaved config.
Environment

OpenCode: v1.1.53
OS: Ubuntu (Linux)
Provider: HuggingFace
Model: moonshotai/Kimi-K2.5:together

Plugins

No response

OpenCode version

OpenCode: v1.1.53

Steps to reproduce

No response

Screenshot and/or share link

Image

Operating System

Ubuntu (Linux) 22.04

Terminal

No response

Activity

  1. github-actions commented on Feb 10, 2026

    @github-actions
    Contributor

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

    If your issue is distinct from these, please clarify how it differs.

  2. OpeOginni commented on Feb 11, 2026

    @OpeOginni
    Contributor

    @DeviousCardi This seems to work well for me

    {
      "$schema": "https://opencode.ai/config.json",
      "provider": {
        "huggingface": {
          "options": {
            "headers": {
            }
          },
          "models": {
            "moonshotai/Kimi-K2.5:together": {
              "name": "kimi k2.5 together",
              "reasoning": true
            }
          }
        }
      }
    }

    have you tried it?

  3. DeviousCardi commented on Feb 11, 2026

    @DeviousCardi
    Author

    @OpeOginni
    Image
    still getting error

  4. OpeOginni commented on Feb 11, 2026

    @OpeOginni
    Contributor

    @DeviousCardi From your screenshots you are not making use of the kimi k2.5 together model, you are just making use of the kimi k2.5 one, please make sure you are choosing the right model and try again

    Image

    I think with this change, you can add in the

    "interleaved": {
      "field": "reasoning_details"
    }

    If you want the model to get the reasoning on every request, and it should still work

  5. github-actions commented on Apr 13, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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 working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions