diff --git a/src/commands/doctor-memory-search.test.ts b/src/commands/doctor-memory-search.test.ts index 45fe8b125d1..7020c3664ef 100644 --- a/src/commands/doctor-memory-search.test.ts +++ b/src/commands/doctor-memory-search.test.ts @@ -320,12 +320,12 @@ describe("noteMemorySearchHealth", () => { const message = String(note.mock.calls[0]?.[0] ?? ""); expect(message).toContain("ollama"); expect(message).toContain("does not require an API key"); - expect(message).toContain("connection refused"); + expect(message).toContain("Gateway probe: connection refused"); expect(message).not.toContain("API key was not found"); expect(note.mock.calls[0]?.[1]).toBe("Memory search"); }); - it("shows informational note when ollama provider is set and no gateway probe", async () => { + it("does not warn when ollama provider is set and no gateway probe is available", async () => { resolveMemorySearchConfig.mockReturnValue({ provider: "ollama", local: {}, @@ -334,12 +334,7 @@ describe("noteMemorySearchHealth", () => { await noteMemorySearchHealth(cfg); - expect(note).toHaveBeenCalledTimes(1); - const message = String(note.mock.calls[0]?.[0] ?? ""); - expect(message).toContain("ollama"); - expect(message).toContain("does not require an API key"); - expect(message).not.toContain("API key was not found"); - expect(note.mock.calls[0]?.[1]).toBe("Memory search"); + expect(note).not.toHaveBeenCalled(); }); }); diff --git a/src/commands/doctor-memory-search.ts b/src/commands/doctor-memory-search.ts index d5f62adf4cc..f8608476d07 100644 --- a/src/commands/doctor-memory-search.ts +++ b/src/commands/doctor-memory-search.ts @@ -81,24 +81,24 @@ export async function noteMemorySearchHealth( } if (resolved.provider === "ollama") { // Ollama runs locally and does not require an API key. - // If a gateway probe confirmed embeddings are ready, all good. - if (opts?.gatewayMemoryProbe?.checked && opts.gatewayMemoryProbe.ready) { - return; + // Only warn when the gateway probe explicitly reports not-ready; + // if no probe ran we cannot tell whether the service is up, so + // stay silent (consistent with the "local" branch above). + if (opts?.gatewayMemoryProbe?.checked && !opts.gatewayMemoryProbe.ready) { + const detail = opts.gatewayMemoryProbe.error?.trim(); + note( + [ + 'Memory search provider is set to "ollama".', + "Ollama does not require an API key, but the ollama service must be running.", + detail ? `Gateway probe: ${detail}` : null, + "", + `Verify: ${formatCliCommand("openclaw memory status --deep")}`, + ] + .filter(Boolean) + .join("\n"), + "Memory search", + ); } - // No probe or probe not ready — nudge the user to verify the service. - const detail = opts?.gatewayMemoryProbe?.error?.trim(); - note( - [ - 'Memory search provider is set to "ollama".', - "Ollama does not require an API key, but the ollama service must be running.", - detail ? `Gateway probe: ${detail}` : null, - "", - `Verify: ${formatCliCommand("openclaw memory status --deep")}`, - ] - .filter(Boolean) - .join("\n"), - "Memory search", - ); return; } // Remote provider — check for API key