mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:30:43 +00:00
fix(agents): preserve explicit Ollama local auth marker
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user