From f80a1c374f64ccceca1e0ea58491b02474aeaaf4 Mon Sep 17 00:00:00 2001 From: 80mills <164361618+80mills@users.noreply.github.com> Date: Sat, 9 May 2026 02:28:42 +0000 Subject: [PATCH] Fix agent command model-selection mock --- src/commands/agent-command.test-mocks.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/commands/agent-command.test-mocks.ts b/src/commands/agent-command.test-mocks.ts index bbaf3c0a00d..e4f8216d2d5 100644 --- a/src/commands/agent-command.test-mocks.ts +++ b/src/commands/agent-command.test-mocks.ts @@ -87,6 +87,13 @@ vi.mock("../agents/model-selection.js", () => { }); const modelKey = (provider: string, model: string) => `${provider.trim().toLowerCase()}/${model.trim().toLowerCase()}`; + const isModelKeyAllowedBySet = (allowedKeys: ReadonlySet, key: string) => { + if (allowedKeys.has(key)) { + return true; + } + const slash = key.indexOf("/"); + return slash > 0 && allowedKeys.has(`${key.slice(0, slash)}/*`); + }; const resolvePrimary = (cfg?: ConfigWithModels): string | undefined => { const primary = cfg?.agents?.defaults?.model; if (typeof primary === "string") { @@ -132,6 +139,7 @@ vi.mock("../agents/model-selection.js", () => { }; }), buildConfiguredModelCatalog: vi.fn(() => []), + isModelKeyAllowedBySet, isCliProvider: vi.fn(() => false), modelKey, normalizeModelRef,