Merge pull request #12000 from Kilo-Org/fix/routed-free-model-name

fix(vscode): show routed model name for auto-routed free sessions
This commit is contained in:
Christiaan Arnoldus
2026-07-07 12:46:56 +02:00
committed by GitHub
3 changed files with 8 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---
Fix the model usage panel showing just "free" for auto-routed sessions. The routed model id (e.g. `tencent/hy3:free`) is now displayed correctly instead of being collapsed to its `:free` suffix.
@@ -48,6 +48,8 @@ describe("model usage", () => {
expect(modelUsageName(models[0], providers)).toBe("Qwen 3.7 Plus")
expect(modelUsageName(models[1], providers)).toBe("MiniMax M3")
expect(modelUsageName({ ...models[0], modelID: "moonshotai/kimi-k2.7-code-20260612" }, {})).toBe("kimi-k2.7-code")
// Routed free-variant ids keep their name instead of collapsing to the ":free" suffix
expect(modelUsageName({ ...models[0], modelID: "tencent/hy3:free" }, {})).toBe("hy3:free")
})
test("matches sessions through their top-level tree", () => {
@@ -65,7 +65,7 @@ export function modelUsageName(model: SessionModelUsage["models"][number], provi
const id = model.modelID.replace(DATE_SUFFIX, "")
const name = provider?.models[model.modelID]?.name ?? provider?.models[id]?.name ?? id
return name
.replace(/^[^:]+:\s*/, "")
.replace(/^[^:]+:\s+/, "")
.replace(/^[^/]+\//, "")
.replace(/\s*\([^)]*%\s*off[^)]*\)\s*$/i, "")
.replace(/^qwen(?=\d)/i, "Qwen ")