Kimi 2.5 Reasoning Cutoff/Missing when using NVIDIA API #9277

Open
opened 2026-02-16 18:12:04 -05:00 by yindo · 16 comments
Owner

Originally created by @Phouter0499 on GitHub (Feb 13, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

When using the Kimi K2.5 model via the NVIDIA API key, the reasoning process (thinking) is cut off or missing entirely within OpenCode. However, the exact same model and API key work perfectly on the NVIDIA NIM website/playground (no reasoning truncation). Kimi K2.5 free with opencode zen works just fine.

Plugins

None

OpenCode version

1.1.65

Steps to reproduce

  1. use opencode command at the terminal
  2. ctrl + p
  3. press on connect provider
  4. choose Nvidia
  5. submit api key
  6. select Kimi K2.5 under the Nvidia provider section
  7. send prompt (and this should return thinking section)
  8. now observe the end of the thinking section and you will notice reasoning truncation

Screenshot and/or share link

No response

Operating System

Ubuntu 24.04

Terminal

bash

Originally created by @Phouter0499 on GitHub (Feb 13, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description When using the Kimi K2.5 model via the NVIDIA API key, the reasoning process (thinking) is cut off or missing entirely within OpenCode. However, the exact same model and API key work perfectly on the NVIDIA NIM [website/playground](https://build.nvidia.com/moonshotai/kimi-k2.5) (no reasoning truncation). Kimi K2.5 free with opencode zen works just fine. ### Plugins None ### OpenCode version 1.1.65 ### Steps to reproduce 1. use ```opencode``` command at the terminal 2. ```ctrl + p``` 3. press on connect provider 4. choose Nvidia 5. submit api key 6. select Kimi K2.5 under the Nvidia provider section 7. send prompt (and this should return thinking section) 8. now observe the end of the thinking section and you will notice reasoning truncation ### Screenshot and/or share link _No response_ ### Operating System Ubuntu 24.04 ### Terminal bash
yindo added the bugzen labels 2026-02-16 18:12:04 -05:00
Author
Owner

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

This issue appears to be a duplicate of or directly related to #11194 ("Last token cut off in thinking"), which also reports Kimi K2.5 reasoning truncation via NVIDIA API. Both issues describe identical symptoms with the same model/provider combination.

Please check #11194 to see if it resolves your issue or if there are any workarounds mentioned in the discussion.

@github-actions[bot] commented on GitHub (Feb 13, 2026): This issue appears to be a duplicate of or directly related to #11194 ("Last token cut off in thinking"), which also reports Kimi K2.5 reasoning truncation via NVIDIA API. Both issues describe identical symptoms with the same model/provider combination. Please check #11194 to see if it resolves your issue or if there are any workarounds mentioned in the discussion.
Author
Owner

@rekram1-node commented on GitHub (Feb 13, 2026):

Investigating...

@rekram1-node commented on GitHub (Feb 13, 2026): Investigating...
Author
Owner

@rekram1-node commented on GitHub (Feb 13, 2026):

Image

Interesting

@rekram1-node commented on GitHub (Feb 13, 2026): <img width="945" height="767" alt="Image" src="https://github.com/user-attachments/assets/61b06ced-48a0-4824-8f0d-9b8079764976" /> Interesting
Author
Owner

@rekram1-node commented on GitHub (Feb 13, 2026):

I messed nvidia team, I think this is a bug on their end because we are rendering exactly what the api returns:

data: {"id":"chatcmpl-9dc205430a2de124","object":"chat.completion.chunk","created":1771014517,"model":"moonshotai/kimi-k2.5","choices":[{"index":0,"delta":{"role":"assistant","content":"","reasoning_content":null},"logprobs":null,"finish_reason":null}],"prompt_token_ids":null}

data: {"id":"chatcmpl-9dc205430a2de124","object":"chat.completion.chunk","created":1771014517,"model":"moonshotai/kimi-k2.5","choices":[{"index":0,"delta":{"reasoning":" The","reasoning_content":" The"},"logprobs":null,"finish_reason":null,"token_ids":null}]}

data: {"id":"chatcmpl-9dc205430a2de124","object":"chat.completion.chunk","created":1771014517,"model":"moonshotai/kimi-k2.5","choices":[{"index":0,"delta":{"reasoning":" user is greeting me casually. I should respond in","reasoning_content":" user is greeting me casually. I should respond in"},"logprobs":null,"finish_reason":null,"token_ids":null}]}

data: {"id":"chatcmpl-9dc205430a2de124","object":"chat.completion.chunk","created":1771014517,"model":"moonshotai/kimi-k2.5","choices":[{"index":0,"delta":{"content":" Hey! Not","reasoning_content":null},"logprobs":null,"finish_reason":null,"token_ids":null}]}

data: {"id":"chatcmpl-9dc205430a2de124","object":"chat.completion.chunk","created":1771014517,"model":"moonshotai/kimi-k2.5","choices":[{"index":0,"delta":{"content":" much, just here to help. What can I","reasoning_content":null},"logprobs":null,"finish_reason":null,"token_ids":null}]}

data: {"id":"chatcmpl-9dc205430a2de124","object":"chat.completion.chunk","created":1771014517,"model":"moonshotai/kimi-k2.5","choices":[{"index":0,"delta":{"content":" do for you today?","reasoning_content":null},"logprobs":null,"finish_reason":"stop","stop_reason":163586,"token_ids":null}]}

data: {"id":"chatcmpl-9dc205430a2de124","object":"chat.completion.chunk","created":1771014517,"model":"moonshotai/kimi-k2.5","choices":[],"usage":{"prompt_tokens":13389,"total_tokens":13426,"completion_tokens":37}}

data: [DONE]
@rekram1-node commented on GitHub (Feb 13, 2026): I messed nvidia team, I think this is a bug on their end because we are rendering exactly what the api returns: ``` data: {"id":"chatcmpl-9dc205430a2de124","object":"chat.completion.chunk","created":1771014517,"model":"moonshotai/kimi-k2.5","choices":[{"index":0,"delta":{"role":"assistant","content":"","reasoning_content":null},"logprobs":null,"finish_reason":null}],"prompt_token_ids":null} data: {"id":"chatcmpl-9dc205430a2de124","object":"chat.completion.chunk","created":1771014517,"model":"moonshotai/kimi-k2.5","choices":[{"index":0,"delta":{"reasoning":" The","reasoning_content":" The"},"logprobs":null,"finish_reason":null,"token_ids":null}]} data: {"id":"chatcmpl-9dc205430a2de124","object":"chat.completion.chunk","created":1771014517,"model":"moonshotai/kimi-k2.5","choices":[{"index":0,"delta":{"reasoning":" user is greeting me casually. I should respond in","reasoning_content":" user is greeting me casually. I should respond in"},"logprobs":null,"finish_reason":null,"token_ids":null}]} data: {"id":"chatcmpl-9dc205430a2de124","object":"chat.completion.chunk","created":1771014517,"model":"moonshotai/kimi-k2.5","choices":[{"index":0,"delta":{"content":" Hey! Not","reasoning_content":null},"logprobs":null,"finish_reason":null,"token_ids":null}]} data: {"id":"chatcmpl-9dc205430a2de124","object":"chat.completion.chunk","created":1771014517,"model":"moonshotai/kimi-k2.5","choices":[{"index":0,"delta":{"content":" much, just here to help. What can I","reasoning_content":null},"logprobs":null,"finish_reason":null,"token_ids":null}]} data: {"id":"chatcmpl-9dc205430a2de124","object":"chat.completion.chunk","created":1771014517,"model":"moonshotai/kimi-k2.5","choices":[{"index":0,"delta":{"content":" do for you today?","reasoning_content":null},"logprobs":null,"finish_reason":"stop","stop_reason":163586,"token_ids":null}]} data: {"id":"chatcmpl-9dc205430a2de124","object":"chat.completion.chunk","created":1771014517,"model":"moonshotai/kimi-k2.5","choices":[],"usage":{"prompt_tokens":13389,"total_tokens":13426,"completion_tokens":37}} data: [DONE] ```
Author
Owner

@Phouter0499 commented on GitHub (Feb 13, 2026):

I messed nvidia team, I think this is a bug on their end because we are rendering exactly what the api returns:

Are you sure? cause when I tried using it in the website, it worked perfectly without any reasoning truncation. Here is an image:

Image

No truncation at the end.

@Phouter0499 commented on GitHub (Feb 13, 2026): > I messed nvidia team, I think this is a bug on their end because we are rendering exactly what the api returns: Are you sure? cause when I tried using it in the [website](https://build.nvidia.com/moonshotai/kimi-k2.5), it worked perfectly without any reasoning truncation. Here is an image: <img width="1916" height="884" alt="Image" src="https://github.com/user-attachments/assets/1e351ae2-fe38-4aea-a1a5-2172ea00b9bb" /> No truncation at the end.
Author
Owner

@rekram1-node commented on GitHub (Feb 13, 2026):

Yeah I just don't know what would cause that.

@rekram1-node commented on GitHub (Feb 13, 2026): Yeah I just don't know what would cause that.
Author
Owner

@Phouter0499 commented on GitHub (Feb 13, 2026):

Yeah I just don't know what would cause that.

So I just tried the nvidia api with python (the code is provided at the nvidia website) but no reasoning truncation happened. So I think the problem lies with opencode.

@Phouter0499 commented on GitHub (Feb 13, 2026): > Yeah I just don't know what would cause that. So I just tried the nvidia api with python (the code is provided at the nvidia website) but no reasoning truncation happened. So I think the problem lies with opencode.
Author
Owner

@rekram1-node commented on GitHub (Feb 13, 2026):

@Phouter0499 send example?

@rekram1-node commented on GitHub (Feb 13, 2026): @Phouter0499 send example?
Author
Owner

@rekram1-node commented on GitHub (Feb 13, 2026):

If you are using a non streaming example then it's not the same type of request..

@rekram1-node commented on GitHub (Feb 13, 2026): If you are using a non streaming example then it's not the same type of request..
Author
Owner

@Phouter0499 commented on GitHub (Feb 13, 2026):

@Phouter0499 send example?

github won't let me upload the files so had to make a shorter one. here is the code:

#!/usr/bin/env python3
import json
import requests

# API call
r = requests.post("https://integrate.api.nvidia.com/v1/chat/completions",
                  headers={"Authorization": "Bearer API-KEY",
                           "Accept": "text/event-stream"},
                  json={"model": "moonshotai/kimi-k2.5", "messages": [{"role": "user", "content": "In a world where gravity pushes objects upward and water is solid at room temperature, explain how a person would boil a pot of tea."}],
                        "max_tokens": 16384, "temperature": 1.0, "top_p": 1.0, "stream": True, "chat_template_kwargs": {"thinking": True}})

# Stream to console and collect
lines = []
for l in r.iter_lines():
    if l:
        d = l.decode()
        print(d)
        lines.append(d)
with open("response.json", "w") as f:
    json.dump({"streamed_response": lines}, f)

run the code and you can see that the reasoning works fine so it is opencode that's the problem.

@Phouter0499 commented on GitHub (Feb 13, 2026): > [@Phouter0499](https://github.com/Phouter0499) send example? github won't let me upload the files so had to make a shorter one. here is the code: ```python #!/usr/bin/env python3 import json import requests # API call r = requests.post("https://integrate.api.nvidia.com/v1/chat/completions", headers={"Authorization": "Bearer API-KEY", "Accept": "text/event-stream"}, json={"model": "moonshotai/kimi-k2.5", "messages": [{"role": "user", "content": "In a world where gravity pushes objects upward and water is solid at room temperature, explain how a person would boil a pot of tea."}], "max_tokens": 16384, "temperature": 1.0, "top_p": 1.0, "stream": True, "chat_template_kwargs": {"thinking": True}}) # Stream to console and collect lines = [] for l in r.iter_lines(): if l: d = l.decode() print(d) lines.append(d) with open("response.json", "w") as f: json.dump({"streamed_response": lines}, f) ``` run the code and you can see that the reasoning works fine so it is opencode that's the problem.
Author
Owner

@Phouter0499 commented on GitHub (Feb 13, 2026):

If you are using a non streaming example then it's not the same type of request..

the default example uses streaming.

@Phouter0499 commented on GitHub (Feb 13, 2026): > If you are using a non streaming example then it's not the same type of request.. the default example uses streaming.
Author
Owner

@rekram1-node commented on GitHub (Feb 13, 2026):

If I pass tools to nvidia I replicate the issue using ur snippet.

@rekram1-node commented on GitHub (Feb 13, 2026): If I pass tools to nvidia I replicate the issue using ur snippet.
Author
Owner

@rekram1-node commented on GitHub (Feb 13, 2026):

Yeah If I disable tools on opencode it stops happening.

Seems like an nvidia bug to me.

@rekram1-node commented on GitHub (Feb 13, 2026): Yeah If I disable tools on opencode it stops happening. Seems like an nvidia bug to me.
Author
Owner

@Phouter0499 commented on GitHub (Feb 13, 2026):

Yeah If I disable tools on opencode it stops happening.

Seems like an nvidia bug to me.

My bad, I totally forgot about the tool calls. I made a api request with weather tool enabled and asked for weather for a city and got a successful response? Tools seem to work on the website.

@Phouter0499 commented on GitHub (Feb 13, 2026): > Yeah If I disable tools on opencode it stops happening. > > Seems like an nvidia bug to me. My bad, I totally forgot about the tool calls. I made a api request with weather tool enabled and asked for weather for a city and got a successful response? Tools seem to work on the website.
Author
Owner

@rekram1-node commented on GitHub (Feb 13, 2026):

I'm not really sure what it is, but when I copy the opencode tools into the python example it starts to malfunction

Given that we use the exact same code path for nvidia as we do all other openai compat providers, I think this is a bug on their end. Almost all the providers have weird bugs.

I could be totally wrong but most of the time I investigate these cases I find bugs. So far I've found bugs in:

  • ollama
  • cloudflare ai gateway
  • minimax
  • deepinfra
  • baseten
@rekram1-node commented on GitHub (Feb 13, 2026): I'm not really sure what it is, but when I copy the opencode tools into the python example it starts to malfunction Given that we use the exact same code path for nvidia as we do all other openai compat providers, I think this is a bug on their end. Almost all the providers have weird bugs. I could be totally wrong but most of the time I investigate these cases I find bugs. So far I've found bugs in: - ollama - cloudflare ai gateway - minimax - deepinfra - baseten
Author
Owner

@Phouter0499 commented on GitHub (Feb 14, 2026):

@rekram1-node This issue doesn't look like it will be fixed anytime soon but thank you for all the responses anyways.

@Phouter0499 commented on GitHub (Feb 14, 2026): @rekram1-node This issue doesn't look like it will be fixed anytime soon but thank you for all the responses anyways.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9277