Skip to content

Commit a10add7

Browse files
fix(models): mark local Ollama rows available (#97491)
* fix(models): mark local Ollama rows available * fix(models): mark local Ollama rows available --------- Co-authored-by: Vincent Koc <[email protected]>
1 parent b580258 commit a10add7

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

src/commands/models/list.model-row.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,22 @@ describe("toModelRow", () => {
5656
expect(row.local).toBe(true);
5757
}
5858
});
59+
60+
it("keeps local provider rows available when registry availability omits the model key", () => {
61+
const row = toModelRow({
62+
model: {
63+
...OPENROUTER_MODEL,
64+
provider: "ollama",
65+
id: "qwen3.6:35b-a3b",
66+
name: "qwen3.6:35b-a3b",
67+
baseUrl: "http://127.0.0.1:11434",
68+
} as never,
69+
key: "ollama/qwen3.6:35b-a3b",
70+
tags: [],
71+
availableKeys: new Set(["ollama/llama3.2"]),
72+
});
73+
74+
expect(row.local).toBe(true);
75+
expect(row.available).toBe(true);
76+
});
5977
});

src/commands/models/list.model-row.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ export function toModelRow(params: {
5050

5151
const input = model.input.join("+") || "text";
5252
const local = isLocalBaseUrl(model.baseUrl ?? "");
53-
const modelIsAvailable = availableKeys?.has(modelKey(model.provider, model.id)) ?? false;
54-
// Prefer model-level registry availability when present.
53+
const modelIsAvailable =
54+
local || (availableKeys?.has(modelKey(model.provider, model.id)) ?? false);
55+
// Local provider rows use their baseUrl as the auth marker.
56+
// Otherwise prefer model-level registry availability when present.
5557
// Fall back to provider-level auth heuristics only if registry availability isn't available,
5658
// or if the caller marks this as a synthetic/forward-compat model that won't appear in getAvailable().
5759
const available =

0 commit comments

Comments
 (0)