fix(provider): auto-enable interleaved reasoning for Kimi K2.6 models#25066
Open
DhtIsCoding wants to merge 1 commit intoanomalyco:devfrom
Open
fix(provider): auto-enable interleaved reasoning for Kimi K2.6 models#25066DhtIsCoding wants to merge 1 commit intoanomalyco:devfrom
DhtIsCoding wants to merge 1 commit intoanomalyco:devfrom
Conversation
When using Kimi K2.6 via OpenCode Zen/Go with tool calls, the API requires reasoning_content to be present on assistant messages. Without it, Moonshot returns: 'thinking is enabled but reasoning_content is missing in assistant tool call message'. Changes: - Auto-detect kimi-k2 models for interleaved reasoning (like DeepSeek) - Add kimi-k2.6 to models-api.json for opencode and opencode-go providers - Add test coverage for Kimi interleaved auto-detection Fixes anomalyco#20427
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #20427
Closes #24722
Closes #23646
Type of change
What does this PR do?
When using Kimi K2.6 (and other kimi-k2 models) through OpenCode's Zen or Go providers, the model configuration was missing the
interleavedcapability that tells OpenCode to preservereasoning_contentin conversation history.Without this, multi-turn tool-use conversations fail with Moonshot returning:
This PR:
@ai-sdk/openai-compatible(same pattern as DeepSeek)kimi-k2.6entries tomodels-api.jsonforopencode(Zen) andopencode-goprovidersHow did you verify your code works?
provider.test.tsverifying custom Kimi models getinterleaved: { field: "reasoning_content" }automaticallykimi-k2.5entriesProviderTransform.message()logic confirms interleaved field triggersreasoning_contentpreservation on assistant messagesScreenshots / recordings
N/A - This is a backend/provider fix, not a UI change.
Checklist