From 8344fae38720f415bffa09aa6ba18b4d942188d5 Mon Sep 17 00:00:00 2001 From: Shakker Date: Sun, 26 Apr 2026 11:35:04 +0100 Subject: [PATCH] fix: preserve provider-scoped model options --- src/commands/configure.gateway-auth.ts | 1 + src/commands/model-picker.test.ts | 1 + src/flows/model-picker.ts | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/commands/configure.gateway-auth.ts b/src/commands/configure.gateway-auth.ts index ff0f5407f14..5047a0e4342 100644 --- a/src/commands/configure.gateway-auth.ts +++ b/src/commands/configure.gateway-auth.ts @@ -177,6 +177,7 @@ export async function promptAuthConfig( initialSelections: modelAllowlist?.initialSelections, message: modelAllowlist?.message, preferredProvider, + loadCatalog: false, }); if (allowlistSelection.models) { next = applyModelFallbacksFromSelection(next, allowlistSelection.models, { diff --git a/src/commands/model-picker.test.ts b/src/commands/model-picker.test.ts index c6e7da673bf..e654864f876 100644 --- a/src/commands/model-picker.test.ts +++ b/src/commands/model-picker.test.ts @@ -738,6 +738,7 @@ describe("promptModelAllowlist", () => { config, prompter, preferredProvider: "openai-codex", + loadCatalog: false, }); expect(loadModelCatalog).not.toHaveBeenCalled(); diff --git a/src/flows/model-picker.ts b/src/flows/model-picker.ts index 6adfed8c619..2301de4e9ff 100644 --- a/src/flows/model-picker.ts +++ b/src/flows/model-picker.ts @@ -788,6 +788,7 @@ export async function promptModelAllowlist(params: { allowedKeys?: string[]; initialSelections?: string[]; preferredProvider?: string; + loadCatalog?: boolean; }): Promise { const cfg = params.config; const existingKeys = resolveConfiguredModelKeys(cfg); @@ -839,11 +840,12 @@ export async function promptModelAllowlist(params: { cfg, }) : undefined; + const loadCatalog = params.loadCatalog ?? true; const scopedFastKeys = allowedKeys.length > 0 ? allowedKeys - : preferredProvider && hasRealSeed + : !loadCatalog && preferredProvider && hasRealSeed ? initialSeeds.filter((key) => { const entry = splitModelKey(key); return entry ? matchesPreferredProvider?.(entry.provider) === true : false; @@ -888,6 +890,10 @@ export async function promptModelAllowlist(params: { return { models: [], scopeKeys }; } + if (!loadCatalog) { + return {}; + } + const allowlistProgress = params.prompter.progress("Loading available models"); let catalog: Awaited>; try {