Skip to content

fix(capabilities): support bare Kimi K3 upstream id - #2697

Open
Jordannst wants to merge 1 commit into
decolua:masterfrom
Jordannst:fix/kimi-k3-capabilities
Open

fix(capabilities): support bare Kimi K3 upstream id#2697
Jordannst wants to merge 1 commit into
decolua:masterfrom
Jordannst:fix/kimi-k3-capabilities

Conversation

@Jordannst

@Jordannst Jordannst commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Closes #2690.

Problem

Kimi K3 can be selected through aliases such as kimi/k3 and kimi-k3, but the upstream receives the bare model ID k3.

Capability resolution runs after that alias resolution:

kimi/k3 → k3 → getCapabilitiesForModel(provider, "k3")

Before this change, Kimi capability rules only matched model IDs containing kimi. Bare k3 therefore reached the default capability floor:

{ reasoning: false, vision: false, videoInput: false }

That has two user-visible effects:

  1. applyThinking() treats K3 as non-reasoning and removes client reasoning_effort before the upstream request is sent.
  2. Modality filtering treats K3 as text-only and removes image/video input before translation.

Fix

Add K3-specific capability entries before generic *kimi* matching:

{ pattern: "*kimi*k3*", caps: K3_CAPABILITIES },
{ pattern: "k3",        caps: K3_CAPABILITIES },

K3_CAPABILITIES is represented inline and declares:

  • reasoning: true
  • thinkingFormat: "kimi"
  • vision: true
  • videoInput: true
  • contextWindow: 1048576
  • maxOutput: 131072

The pattern matcher is anchored. Exact "k3" matches only the bare upstream ID, so unrelated IDs such as k3.5 do 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-k3 and kimi-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.5 remains unmatched by exact k3.
  • applyThinking(..., "k3", { reasoning_effort: "high" }, "kimi") preserves reasoning_effort.

Verification

npx vitest run --config tests/vitest.config.js tests/unit/capabilities.test.js tests/translator/thinking-unified.test.js

2 test files passed
40 tests passed

Scope

No router or alias-resolution refactor. This is a narrowly scoped capability correction for Kimi K3's documented bare upstream ID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kimi/k3 upstream id bypasses capabilities matching — client reasoning_effort silently stripped

1 participant