mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-25 02:13:31 +00:00
fix: log auth profile resolution failures instead of swallowing silently (#41271)
Merged via squash.
Prepared head SHA: 049d1e119a
Co-authored-by: he-yufeng <40085740+he-yufeng@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
This commit is contained in:
@@ -4,6 +4,7 @@ import { formatCliCommand } from "../cli/command-format.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import type { ModelProviderAuthMode, ModelProviderConfig } from "../config/types.js";
|
||||
import { getShellEnvAppliedKeys } from "../infra/shell-env.js";
|
||||
import { createSubsystemLogger } from "../logging/subsystem.js";
|
||||
import {
|
||||
normalizeOptionalSecretInput,
|
||||
normalizeSecretInput,
|
||||
@@ -22,6 +23,8 @@ import { normalizeProviderId } from "./model-selection.js";
|
||||
|
||||
export { ensureAuthProfileStore, resolveAuthProfileOrder } from "./auth-profiles.js";
|
||||
|
||||
const log = createSubsystemLogger("model-auth");
|
||||
|
||||
const AWS_BEARER_ENV = "AWS_BEARER_TOKEN_BEDROCK";
|
||||
const AWS_ACCESS_KEY_ENV = "AWS_ACCESS_KEY_ID";
|
||||
const AWS_SECRET_KEY_ENV = "AWS_SECRET_ACCESS_KEY";
|
||||
@@ -221,7 +224,9 @@ export async function resolveApiKeyForProvider(params: {
|
||||
mode: mode === "oauth" ? "oauth" : mode === "token" ? "token" : "api-key",
|
||||
};
|
||||
}
|
||||
} catch {}
|
||||
} catch (err) {
|
||||
log.debug?.(`auth profile "${candidate}" failed for provider "${provider}": ${String(err)}`);
|
||||
}
|
||||
}
|
||||
|
||||
const envResolved = resolveEnvApiKey(provider);
|
||||
|
||||
Reference in New Issue
Block a user