mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05:00
fix: avoid allowlist picker for custom endpoint (#11106) (thanks @MackDing)
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
promptDefaultModel,
|
||||
promptModelAllowlist,
|
||||
} from "./model-picker.js";
|
||||
import { promptCustomApiConfig } from "./onboard-custom.js";
|
||||
|
||||
type GatewayAuthChoice = "token" | "password";
|
||||
|
||||
@@ -53,7 +54,10 @@ export async function promptAuthConfig(
|
||||
});
|
||||
|
||||
let next = cfg;
|
||||
if (authChoice !== "skip") {
|
||||
if (authChoice === "custom-api-key") {
|
||||
const customResult = await promptCustomApiConfig({ prompter, runtime, config: next });
|
||||
next = customResult.config;
|
||||
} else if (authChoice !== "skip") {
|
||||
const applied = await applyAuthChoice({
|
||||
authChoice,
|
||||
config: next,
|
||||
@@ -78,16 +82,18 @@ export async function promptAuthConfig(
|
||||
const anthropicOAuth =
|
||||
authChoice === "setup-token" || authChoice === "token" || authChoice === "oauth";
|
||||
|
||||
const allowlistSelection = await promptModelAllowlist({
|
||||
config: next,
|
||||
prompter,
|
||||
allowedKeys: anthropicOAuth ? ANTHROPIC_OAUTH_MODEL_KEYS : undefined,
|
||||
initialSelections: anthropicOAuth ? ["anthropic/claude-opus-4-6"] : undefined,
|
||||
message: anthropicOAuth ? "Anthropic OAuth models" : undefined,
|
||||
});
|
||||
if (allowlistSelection.models) {
|
||||
next = applyModelAllowlist(next, allowlistSelection.models);
|
||||
next = applyModelFallbacksFromSelection(next, allowlistSelection.models);
|
||||
if (authChoice !== "custom-api-key") {
|
||||
const allowlistSelection = await promptModelAllowlist({
|
||||
config: next,
|
||||
prompter,
|
||||
allowedKeys: anthropicOAuth ? ANTHROPIC_OAUTH_MODEL_KEYS : undefined,
|
||||
initialSelections: anthropicOAuth ? ["anthropic/claude-opus-4-6"] : undefined,
|
||||
message: anthropicOAuth ? "Anthropic OAuth models" : undefined,
|
||||
});
|
||||
if (allowlistSelection.models) {
|
||||
next = applyModelAllowlist(next, allowlistSelection.models);
|
||||
next = applyModelFallbacksFromSelection(next, allowlistSelection.models);
|
||||
}
|
||||
}
|
||||
|
||||
return next;
|
||||
|
||||
Reference in New Issue
Block a user