mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 12:00:44 +00:00
fix: preserve provider-scoped model options
This commit is contained in:
@@ -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, {
|
||||
|
||||
@@ -738,6 +738,7 @@ describe("promptModelAllowlist", () => {
|
||||
config,
|
||||
prompter,
|
||||
preferredProvider: "openai-codex",
|
||||
loadCatalog: false,
|
||||
});
|
||||
|
||||
expect(loadModelCatalog).not.toHaveBeenCalled();
|
||||
|
||||
@@ -788,6 +788,7 @@ export async function promptModelAllowlist(params: {
|
||||
allowedKeys?: string[];
|
||||
initialSelections?: string[];
|
||||
preferredProvider?: string;
|
||||
loadCatalog?: boolean;
|
||||
}): Promise<PromptModelAllowlistResult> {
|
||||
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<ReturnType<typeof loadModelCatalog>>;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user