From 45082aaed3d007a5289175404f33d7224425fb0a Mon Sep 17 00:00:00 2001 From: HCL Date: Thu, 30 Apr 2026 06:52:08 +0800 Subject: [PATCH] fix(doctor): suppress false-positive embedding warning when probe skipped MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When `openclaw doctor` runs without --deep, the gateway probe is skipped and returns { checked: false, ready: false } (SKIPPED_MEMORY_EMBEDDING_PROBE). Key-optional providers (ollama, lmstudio, local) were incorrectly shown "could not confirm embeddings are ready" in this case, misleading users into thinking their fully-functional embedding setup had an issue. Guard the key-optional provider path: if probe.checked is false (probe was skipped, not run), return early without warning. A skipped probe carries no readiness signal — it is not a failure. - Adds two focused regression tests for ollama and lmstudio with skipped probe (checked: false) → expect note() not called - Updates the prior test that expected a warning on checked:false to reflect the corrected behaviour Fixes #74608 --- src/commands/doctor-memory-search.test.ts | 26 ++++++++++++++++++----- src/commands/doctor-memory-search.ts | 6 ++++++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/commands/doctor-memory-search.test.ts b/src/commands/doctor-memory-search.test.ts index ddee6c267c5..3171dfedaba 100644 --- a/src/commands/doctor-memory-search.test.ts +++ b/src/commands/doctor-memory-search.test.ts @@ -459,7 +459,11 @@ describe("noteMemorySearchHealth", () => { expect(message).toContain("embeddings are not ready"); }); - it("warns when lmstudio gateway probe is unavailable", async () => { + it("does not warn when key-optional provider (lmstudio) probe was skipped (checked: false)", async () => { + // When `openclaw doctor` runs without --deep, the probe is skipped and returns + // { checked: false, ready: false }. This must NOT produce a false-positive warning — + // it means readiness was never checked, not that embeddings are unavailable. + // Regression test for: https://github.com/openclaw/openclaw/issues/74608 resolveMemorySearchConfig.mockReturnValue({ provider: "lmstudio", local: {}, @@ -470,10 +474,22 @@ describe("noteMemorySearchHealth", () => { gatewayMemoryProbe: { checked: false, ready: false }, }); - const message = String(note.mock.calls[0]?.[0] ?? ""); - expect(message).toContain('provider "lmstudio" is configured'); - expect(message).toContain("could not confirm embeddings are ready"); - expect(message).toContain("openclaw memory status --deep"); + expect(note).not.toHaveBeenCalled(); + }); + + it("does not warn when key-optional provider (ollama) probe was skipped (checked: false)", async () => { + // Same guard for ollama — the most commonly reported false-positive case. + resolveMemorySearchConfig.mockReturnValue({ + provider: "ollama", + local: {}, + remote: {}, + }); + + await noteMemorySearchHealth(cfg, { + gatewayMemoryProbe: { checked: false, ready: false }, + }); + + expect(note).not.toHaveBeenCalled(); }); it("notes when gateway probe reports embeddings ready and CLI API key is missing", async () => { diff --git a/src/commands/doctor-memory-search.ts b/src/commands/doctor-memory-search.ts index c8ba2560579..02979d7419e 100644 --- a/src/commands/doctor-memory-search.ts +++ b/src/commands/doctor-memory-search.ts @@ -410,6 +410,12 @@ export async function noteMemorySearchHealth( if (opts?.gatewayMemoryProbe?.checked && opts.gatewayMemoryProbe.ready) { return; } + // When the probe was skipped (checked: false), we have no embedding status + // information — do not warn. A skipped probe means the user ran `openclaw doctor` + // without --deep; it does not mean embeddings are unavailable. + if (opts?.gatewayMemoryProbe && !opts.gatewayMemoryProbe.checked) { + return; + } const gatewayProbeWarning = buildGatewayProbeWarning(opts?.gatewayMemoryProbe); note( [