mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 03:40:22 +00:00
fix: restore provider auth and build checks
This commit is contained in:
@@ -119,6 +119,7 @@ export async function ensureApiKeyFromOptionEnvOrPrompt(params: {
|
||||
tokenProvider: string | undefined;
|
||||
secretInputMode?: SecretInputMode;
|
||||
config: OpenClawConfig;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
expectedProviders: string[];
|
||||
provider: string;
|
||||
envLabel: string;
|
||||
@@ -148,6 +149,7 @@ export async function ensureApiKeyFromOptionEnvOrPrompt(params: {
|
||||
|
||||
return await ensureApiKeyFromEnvOrPrompt({
|
||||
config: params.config,
|
||||
env: params.env,
|
||||
provider: params.provider,
|
||||
envLabel: params.envLabel,
|
||||
promptMessage: params.promptMessage,
|
||||
@@ -161,6 +163,7 @@ export async function ensureApiKeyFromOptionEnvOrPrompt(params: {
|
||||
|
||||
export async function ensureApiKeyFromEnvOrPrompt(params: {
|
||||
config: OpenClawConfig;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
provider: string;
|
||||
envLabel: string;
|
||||
promptMessage: string;
|
||||
@@ -174,7 +177,8 @@ export async function ensureApiKeyFromEnvOrPrompt(params: {
|
||||
prompter: params.prompter,
|
||||
explicitMode: params.secretInputMode,
|
||||
});
|
||||
const envKey = resolveEnvApiKey(params.provider);
|
||||
const env = params.env ?? process.env;
|
||||
const envKey = resolveEnvApiKey(params.provider, env);
|
||||
|
||||
if (selectedMode === "ref") {
|
||||
if (typeof params.prompter.select !== "function") {
|
||||
@@ -182,6 +186,7 @@ export async function ensureApiKeyFromEnvOrPrompt(params: {
|
||||
config: params.config,
|
||||
provider: params.provider,
|
||||
preferredEnvVar: envKey?.source ? extractEnvVarFromSourceLabel(envKey.source) : undefined,
|
||||
env,
|
||||
});
|
||||
await params.setCredential(fallback.ref, selectedMode);
|
||||
return fallback.resolvedValue;
|
||||
@@ -191,6 +196,7 @@ export async function ensureApiKeyFromEnvOrPrompt(params: {
|
||||
config: params.config,
|
||||
prompter: params.prompter,
|
||||
preferredEnvVar: envKey?.source ? extractEnvVarFromSourceLabel(envKey.source) : undefined,
|
||||
env,
|
||||
});
|
||||
await params.setCredential(resolved.ref, selectedMode);
|
||||
return resolved.resolvedValue;
|
||||
|
||||
Reference in New Issue
Block a user