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

Open
opened 2026-02-16 18:11:21 -05:00 by yindo · 4 comments
Owner

Originally created by @DeviousCardi on GitHub (Feb 10, 2026).

Originally assigned to: @thdxr on GitHub.

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

Originally created by @DeviousCardi on GitHub (Feb 10, 2026). Originally assigned to: @thdxr on GitHub. ### 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 <img width="1815" height="312" alt="Image" src="https://github.com/user-attachments/assets/e6d3d977-7046-4b24-a4c0-0cf28af33568" /> ### Operating System Ubuntu (Linux) 22.04 ### Terminal _No response_
yindo added the bug label 2026-02-16 18:11:21 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 10, 2026):

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

  • #12506: Error with Kimi k 2.5 and huggingface provider in build mode
  • #11591: Kimi K2.5 Free OpenCode Zen throws an error
  • #12396: [FEATURE]: Add thinking/reasoning support for Kimi K2.5 (mentions same field handling issue)
  • #12964: Bug: Unknown agent frontmatter fields leak into LLM API request body via options (similar root cause of unwanted fields being sent to API)

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

@github-actions[bot] commented on GitHub (Feb 10, 2026): This issue might be a duplicate of existing issues. Please check: - #12506: Error with Kimi k 2.5 and huggingface provider in build mode - #11591: Kimi K2.5 Free OpenCode Zen throws an error - #12396: [FEATURE]: Add thinking/reasoning support for Kimi K2.5 (mentions same field handling issue) - #12964: Bug: Unknown agent frontmatter fields leak into LLM API request body via options (similar root cause of unwanted fields being sent to API) If your issue is distinct from these, please clarify how it differs.
Author
Owner

@OpeOginni commented on GitHub (Feb 10, 2026):

@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?

@OpeOginni commented on GitHub (Feb 10, 2026): @DeviousCardi This seems to work well for me ```json { "$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?
Author
Owner

@DeviousCardi commented on GitHub (Feb 10, 2026):

@OpeOginni
Image
still getting error

@DeviousCardi commented on GitHub (Feb 10, 2026): @OpeOginni <img width="1846" height="764" alt="Image" src="https://github.com/user-attachments/assets/4e531f36-ef70-4dfc-b2b7-3d010593868a" /> still getting error
Author
Owner

@OpeOginni commented on GitHub (Feb 10, 2026):

@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

@OpeOginni commented on GitHub (Feb 10, 2026): @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 <img width="478" height="44" alt="Image" src="https://github.com/user-attachments/assets/2a658bf8-3392-450c-90ab-ad36061fc787" /> I think with this change, you can add in the ```json "interleaved": { "field": "reasoning_details" } ``` If you want the model to get the reasoning on every request, and it should still work
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8995