mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 19:11:23 +00:00
feat(onboard): add custom/local API configuration flow (#11106)
* feat(onboard): add custom/local API configuration flow * ci: retry macos check * fix: expand custom API onboarding (#11106) (thanks @MackDing) * fix: refine custom endpoint detection (#11106) (thanks @MackDing) * fix: streamline custom endpoint onboarding (#11106) (thanks @MackDing) * fix: skip model picker for custom endpoint (#11106) (thanks @MackDing) * fix: avoid allowlist picker for custom endpoint (#11106) (thanks @MackDing) * Onboard: reuse shared fetch timeout helper (#11106) (thanks @MackDing) * Onboard: clarify default base URL name (#11106) (thanks @MackDing) --------- Co-authored-by: OpenClaw Contributor <contributor@openclaw.ai> Co-authored-by: Gustavo Madeira Santana <gumadeiras@gmail.com>
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
} from "../commands/auth-choice.js";
|
||||
import { applyPrimaryModel, promptDefaultModel } from "../commands/model-picker.js";
|
||||
import { setupChannels } from "../commands/onboard-channels.js";
|
||||
import { promptCustomApiConfig } from "../commands/onboard-custom.js";
|
||||
import {
|
||||
applyWizardMetadata,
|
||||
DEFAULT_WORKSPACE,
|
||||
@@ -378,26 +379,38 @@ export async function runOnboardingWizard(
|
||||
includeSkip: true,
|
||||
}));
|
||||
|
||||
const authResult = await applyAuthChoice({
|
||||
authChoice,
|
||||
config: nextConfig,
|
||||
prompter,
|
||||
runtime,
|
||||
setDefaultModel: true,
|
||||
opts: {
|
||||
tokenProvider: opts.tokenProvider,
|
||||
token: opts.authChoice === "apiKey" && opts.token ? opts.token : undefined,
|
||||
},
|
||||
});
|
||||
nextConfig = authResult.config;
|
||||
let customPreferredProvider: string | undefined;
|
||||
if (authChoice === "custom-api-key") {
|
||||
const customResult = await promptCustomApiConfig({
|
||||
prompter,
|
||||
runtime,
|
||||
config: nextConfig,
|
||||
});
|
||||
nextConfig = customResult.config;
|
||||
customPreferredProvider = customResult.providerId;
|
||||
} else {
|
||||
const authResult = await applyAuthChoice({
|
||||
authChoice,
|
||||
config: nextConfig,
|
||||
prompter,
|
||||
runtime,
|
||||
setDefaultModel: true,
|
||||
opts: {
|
||||
tokenProvider: opts.tokenProvider,
|
||||
token: opts.authChoice === "apiKey" && opts.token ? opts.token : undefined,
|
||||
},
|
||||
});
|
||||
nextConfig = authResult.config;
|
||||
}
|
||||
|
||||
if (authChoiceFromPrompt) {
|
||||
if (authChoiceFromPrompt && authChoice !== "custom-api-key") {
|
||||
const modelSelection = await promptDefaultModel({
|
||||
config: nextConfig,
|
||||
prompter,
|
||||
allowKeep: true,
|
||||
ignoreAllowlist: true,
|
||||
preferredProvider: resolvePreferredProviderForAuthChoice(authChoice),
|
||||
preferredProvider:
|
||||
customPreferredProvider ?? resolvePreferredProviderForAuthChoice(authChoice),
|
||||
});
|
||||
if (modelSelection.model) {
|
||||
nextConfig = applyPrimaryModel(nextConfig, modelSelection.model);
|
||||
|
||||
Reference in New Issue
Block a user