fix(capabilities): support bare Kimi K3 upstream id - #2697
Open
Jordannst wants to merge 1 commit into
Open
Conversation
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.
Closes #2690.
Problem
Kimi K3 can be selected through aliases such as
kimi/k3andkimi-k3, but the upstream receives the bare model IDk3.Capability resolution runs after that alias resolution:
Before this change, Kimi capability rules only matched model IDs containing
kimi. Barek3therefore reached the default capability floor:That has two user-visible effects:
applyThinking()treats K3 as non-reasoning and removes clientreasoning_effortbefore the upstream request is sent.Fix
Add K3-specific capability entries before generic
*kimi*matching:K3_CAPABILITIESis represented inline and declares:reasoning: truethinkingFormat: "kimi"vision: truevideoInput: truecontextWindow: 1048576maxOutput: 131072The pattern matcher is anchored. Exact
"k3"matches only the bare upstream ID, so unrelated IDs such ask3.5do not inherit K3 capabilities.Why capability metadata is the right layer
The alias itself is working: it correctly routes to upstream
k3. The regression occurs because later capability checks re-infer support from the rewritten ID. Adding the explicit upstream ID preserves existing alias behavior and keeps capability decisions consistent for both original (kimi-k3) and resolved (k3) IDs, without expanding alias-resolution scope.K3 metadata is based on models.dev entries
moonshotai/kimi-k3andkimi-for-coding/k3, plus Kimi Code model documentation: image/video input, reasoning, 1M context window, and 131072 output tokens.Regression coverage
getCapabilitiesForModel("kimi", "kimi-k3")receives K3 capability metadata.getCapabilitiesForModel("kimi", "k3")receives identical metadata after alias resolution.k3.5remains unmatched by exactk3.applyThinking(..., "k3", { reasoning_effort: "high" }, "kimi")preservesreasoning_effort.Verification
Scope
No router or alias-resolution refactor. This is a narrowly scoped capability correction for Kimi K3's documented bare upstream ID.