fix(memory): wire Ollama into doctor and tests

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
nico-hoff
2026-02-25 10:38:40 +01:00
committed by Gustavo Madeira Santana
parent 00317343e7
commit e4ef85e2df
3 changed files with 3 additions and 4 deletions

View File

@@ -255,7 +255,7 @@
"engines": { "engines": {
"node": ">=22.12.0" "node": ">=22.12.0"
}, },
"packageManager": "pnpm@10.23.0", "packageManager": "pnpm@10.30.2",
"pnpm": { "pnpm": {
"minimumReleaseAge": 2880, "minimumReleaseAge": 2880,
"overrides": { "overrides": {

View File

@@ -117,7 +117,7 @@ export async function noteMemorySearchHealth(
if (hasLocalEmbeddings(resolved.local)) { if (hasLocalEmbeddings(resolved.local)) {
return; return;
} }
for (const provider of ["openai", "gemini", "voyage", "mistral"] as const) { for (const provider of ["openai", "gemini", "voyage", "mistral", "ollama"] as const) {
if (hasRemoteApiKey || (await hasApiKeyForProvider(provider, cfg, agentDir))) { if (hasRemoteApiKey || (await hasApiKeyForProvider(provider, cfg, agentDir))) {
return; return;
} }
@@ -186,7 +186,7 @@ function hasLocalEmbeddings(local: { modelPath?: string }, useDefaultFallback =
} }
async function hasApiKeyForProvider( async function hasApiKeyForProvider(
provider: "openai" | "gemini" | "voyage" | "mistral", provider: "openai" | "gemini" | "voyage" | "mistral" | "ollama",
cfg: OpenClawConfig, cfg: OpenClawConfig,
agentDir: string, agentDir: string,
): Promise<boolean> { ): Promise<boolean> {

View File

@@ -11,7 +11,6 @@ describe("embeddings-ollama", () => {
headers: { "content-type": "application/json" }, headers: { "content-type": "application/json" },
}), }),
); );
// @ts-expect-error test override
globalThis.fetch = fetchMock; globalThis.fetch = fetchMock;
const { provider } = await createOllamaEmbeddingProvider({ const { provider } = await createOllamaEmbeddingProvider({