fix: enable reasoning for thinking models via kilo-gateway#504
Open
cbrunnkvist wants to merge 1 commit intoKilo-Org:devfrom
Open
fix: enable reasoning for thinking models via kilo-gateway#504cbrunnkvist wants to merge 1 commit intoKilo-Org:devfrom
cbrunnkvist wants to merge 1 commit intoKilo-Org:devfrom
Conversation
| input.model.capabilities.reasoning && | ||
| input.model.api.id.includes("thinking") | ||
| ) { | ||
| result["reasoning"] = { enabled: true } |
Contributor
There was a problem hiding this comment.
WARNING: Potential reasoning overwrite — the block above (line 771) sets result["reasoning"] = { effort: "high" } for kilo-gateway models whose api.id includes "gemini-3". This new block will overwrite that value with { enabled: true } if a model's api.id contains both "gemini-3" and "thinking" (e.g. a hypothetical google/gemini-3-thinking).
This is unlikely with current model names, but the ordering dependency is fragile. Consider adding an early-return guard (e.g. && !input.model.api.id.includes("gemini-3")) or restructuring to make the precedence explicit.
Contributor
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (2 files)
|
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.
Summary
kimi-k2-thinking) fail with "Reasoning is mandatory for this endpoint" when accessed via Kilo Gatewayreasoning: { enabled: true }for models using@kilocode/kilo-gatewaySDK that have reasoning capability and "thinking" in their model IDChanges
packages/opencode/src/provider/transform.ts: Add logic to enable reasoning for thinking models via Kilo Gatewaypackages/opencode/test/provider/transform.test.ts: Add testsTesting
Verified that
kimi-k2-thinkingnow works:Fixes #503