Merge 002011527c8b70d3a72f9d05d82068146dd7caaf into 5bb5d7dab4b29e68b15bb7665d0736f46499a35c
This commit is contained in:
commit
d7d908c986
@ -169,6 +169,18 @@ function resolveSyntheticLocalProviderAuth(params: {
|
||||
cfg: OpenClawConfig | undefined;
|
||||
provider: string;
|
||||
}): ResolvedProviderAuth | null {
|
||||
// Check for known local providers first — these should always get synthetic auth,
|
||||
// even when the user sets models.primary without running the provider setup wizard
|
||||
// (i.e., no explicit models.providers.{name} config entry exists).
|
||||
const normalizedProvider = normalizeProviderId(params.provider);
|
||||
if (normalizedProvider === "ollama") {
|
||||
return {
|
||||
apiKey: OLLAMA_LOCAL_AUTH_MARKER,
|
||||
source: "models.providers.ollama (synthetic local key)",
|
||||
mode: "api-key",
|
||||
};
|
||||
}
|
||||
|
||||
const providerConfig = resolveProviderConfig(params.cfg, params.provider);
|
||||
if (!providerConfig) {
|
||||
return null;
|
||||
@ -182,15 +194,6 @@ function resolveSyntheticLocalProviderAuth(params: {
|
||||
return null;
|
||||
}
|
||||
|
||||
const normalizedProvider = normalizeProviderId(params.provider);
|
||||
if (normalizedProvider === "ollama") {
|
||||
return {
|
||||
apiKey: OLLAMA_LOCAL_AUTH_MARKER,
|
||||
source: "models.providers.ollama (synthetic local key)",
|
||||
mode: "api-key",
|
||||
};
|
||||
}
|
||||
|
||||
const authOverride = resolveProviderAuthOverride(params.cfg, params.provider);
|
||||
if (authOverride && authOverride !== "api-key") {
|
||||
return null;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user