fix(agents): preserve explicit Ollama local auth marker · openclaw/openclaw@a3144b6
steipete
·
2026-04-27
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,6 +17,7 @@ const AWS_SDK_ENV_MARKERS = new Set([
|
17 | 17 | ]); |
18 | 18 | const CORE_NON_SECRET_API_KEY_MARKERS = [ |
19 | 19 | CUSTOM_LOCAL_AUTH_MARKER, |
| 20 | +OLLAMA_LOCAL_AUTH_MARKER, |
20 | 21 | NON_ENV_SECRETREF_MARKER, |
21 | 22 | ] as const; |
22 | 23 | let knownEnvApiKeyMarkersCache: Set<string> | undefined; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -918,7 +918,7 @@ describe("resolveApiKeyForProvider – synthetic local auth for custom providers
|
918 | 918 | |
919 | 919 | expect(auth).toMatchObject({ |
920 | 920 | apiKey: "ollama-local", |
921 | | -source: "models.providers.ollama-remote (synthetic local key)", |
| 921 | +source: "models.json (local marker)", |
922 | 922 | mode: "api-key", |
923 | 923 | }); |
924 | 924 | }); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -179,7 +179,10 @@ export function resolveUsableCustomProviderApiKey(params: {
|
179 | 179 | customProviderConfig.baseUrl && |
180 | 180 | isLocalBaseUrl(customProviderConfig.baseUrl) |
181 | 181 | ) { |
182 | | -return { apiKey: CUSTOM_LOCAL_AUTH_MARKER, source: "models.json (local marker)" }; |
| 182 | +return { |
| 183 | +apiKey: customProviderConfig.api === "ollama" ? customKey : CUSTOM_LOCAL_AUTH_MARKER, |
| 184 | +source: "models.json (local marker)", |
| 185 | +}; |
183 | 186 | } |
184 | 187 | return null; |
185 | 188 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。