feat: add kimi-2.5 thinking support#12089
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Potential Related PRs Found:
The search found one potentially related PR that deals with OpenAI-compatible reasoning support. PR #5531 could be relevant since your PR involves mapping reasoning content for OpenAI-compatible API support. You may want to review that PR to ensure there are no overlapping changes or conflicting approaches. |
i have add issue #12090 |
i have checked the pr is not repeat |
|
isn't this information already in https://github.com/anomalyco/models.dev ? why is this necessary? |
|
and the property “thinking” is necessary |
| if (["k2p5", "kimi-k2.5"].includes(input.model.providerID) && input.model.api.npm === "@ai-sdk/openai-compatible") { | ||
| result["thinking"] = { | ||
| type: "enabled", | ||
| budgetTokens: 31999, |
There was a problem hiding this comment.
I think it's only an enabled or disabled thing
Also k2p5 uses anthropic sdk
There was a problem hiding this comment.
k2p5 uses anthropic sdk, but moonshotai-cn use openai-compatible, i mixup.


sorry, i think this is repeated issues, the pr
https://github.com/anomalyco/opencode/pull/12147/changes
has fixed it
|
i will close it |

What does this PR do?
Fixes #12090
This PR adds thinking support for Kimi 2.5 models by enabling the thinking capability and mapping interleaved reasoning content for the k2p5 / kimi-k2.5 provider IDs under the OpenAI-compatible API. It also removes the temporary k2p5 fallback in the availability check now that the mapping is handled explicitly. This works because Kimi 2.5 exposes its reasoning stream via reasoning_content, and the provider supports the thinking flag, so the transformation now passes the correct options to the backend.
How did you verify your code works?
tested locally.