




















@@ -273,6 +273,58 @@ describe("modelsListCommand forward-compat", () => {
273273expect(runtime.log).toHaveBeenCalledWith("No models found.");
274274});
275275276+it("includes configured provider model rows for provider-filtered lists", async () => {
277+const ollamaConfig = {
278+agents: { defaults: { model: { primary: "ollama/qwen2.5:7b" } } },
279+models: {
280+providers: {
281+ollama: {
282+api: "ollama",
283+apiKey: "ollama-local",
284+baseUrl: "http://127.0.0.1:11434",
285+models: [
286+{ id: "qwen2.5:7b", name: "Qwen 2.5 7B", input: ["text"] },
287+{ id: "llama3.2:3b", name: "Llama 3.2 3B", input: ["text"] },
288+],
289+},
290+},
291+},
292+};
293+mocks.loadModelsConfigWithSource.mockResolvedValueOnce({
294+sourceConfig: ollamaConfig,
295+resolvedConfig: ollamaConfig,
296+diagnostics: [],
297+});
298+mocks.resolveConfiguredEntries.mockReturnValueOnce({
299+entries: [
300+{
301+key: "ollama/qwen2.5:7b",
302+ref: { provider: "ollama", model: "qwen2.5:7b" },
303+tags: new Set(["default"]),
304+aliases: [],
305+},
306+],
307+});
308+const runtime = createRuntime();
309+310+await modelsListCommand({ json: true, provider: "ollama" }, runtime as never);
311+312+expect(mocks.loadModelRegistry).not.toHaveBeenCalled();
313+const rows = lastPrintedRows<{ key: string; name: string; tags: string[] }>();
314+expect(rows).toEqual([
315+expect.objectContaining({
316+key: "ollama/qwen2.5:7b",
317+name: "Qwen 2.5 7B",
318+tags: ["default"],
319+}),
320+expect.objectContaining({
321+key: "ollama/llama3.2:3b",
322+name: "Llama 3.2 3B",
323+tags: [],
324+}),
325+]);
326+});
327+276328it("does not mark configured codex model as missing when forward-compat can build a fallback", async () => {
277329const runtime = createRuntime();
278330此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。