mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-19 07:42:04 +00:00
fix(agents): preserve explicit Ollama local auth marker
This commit is contained in:
parent
9dd01b5e49
commit
a3144b6bfd
3 changed files with 6 additions and 2 deletions
|
|
@ -17,6 +17,7 @@ const AWS_SDK_ENV_MARKERS = new Set([
|
|||
]);
|
||||
const CORE_NON_SECRET_API_KEY_MARKERS = [
|
||||
CUSTOM_LOCAL_AUTH_MARKER,
|
||||
OLLAMA_LOCAL_AUTH_MARKER,
|
||||
NON_ENV_SECRETREF_MARKER,
|
||||
] as const;
|
||||
let knownEnvApiKeyMarkersCache: Set<string> | undefined;
|
||||
|
|
|
|||
|
|
@ -918,7 +918,7 @@ describe("resolveApiKeyForProvider – synthetic local auth for custom providers
|
|||
|
||||
expect(auth).toMatchObject({
|
||||
apiKey: "ollama-local",
|
||||
source: "models.providers.ollama-remote (synthetic local key)",
|
||||
source: "models.json (local marker)",
|
||||
mode: "api-key",
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -179,7 +179,10 @@ export function resolveUsableCustomProviderApiKey(params: {
|
|||
customProviderConfig.baseUrl &&
|
||||
isLocalBaseUrl(customProviderConfig.baseUrl)
|
||||
) {
|
||||
return { apiKey: CUSTOM_LOCAL_AUTH_MARKER, source: "models.json (local marker)" };
|
||||
return {
|
||||
apiKey: customProviderConfig.api === "ollama" ? customKey : CUSTOM_LOCAL_AUTH_MARKER,
|
||||
source: "models.json (local marker)",
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue