From ce0142f04e4c428c19e3326f62208a195ffa3b11 Mon Sep 17 00:00:00 2001 From: mikasa <0668001030@xydigit.com> Date: Wed, 24 Jun 2026 10:04:12 +0800 Subject: [PATCH] fix #92582: Bug: doctor falsely warns local memory embeddings are not ready (#95393) * fix(doctor): ignore skipped local embedding probe * fix(doctor): keep skipped local model diagnostics --------- Co-authored-by: Vincent Koc <25068+vincentkoc@users.noreply.github.com> --- src/commands/doctor-memory-search.test.ts | 41 +++++++++++++++++++++++ src/commands/doctor-memory-search.ts | 5 +++ 2 files changed, 46 insertions(+) diff --git a/src/commands/doctor-memory-search.test.ts b/src/commands/doctor-memory-search.test.ts index 1b553233df5c..3e170a173777 100644 --- a/src/commands/doctor-memory-search.test.ts +++ b/src/commands/doctor-memory-search.test.ts @@ -237,6 +237,47 @@ describe("noteMemorySearchHealth", () => { expect(note).not.toHaveBeenCalled(); }); + it("does not warn when local provider readiness probe was intentionally skipped", async () => { + resolveMemorySearchConfig.mockReturnValue({ + provider: "local", + local: { modelPath: "hf:some-org/some-model-GGUF/model.gguf" }, + remote: {}, + }); + + await noteMemorySearchHealth(cfg, { + gatewayMemoryProbe: { + checked: false, + ready: false, + error: + "memory embedding readiness not checked; run `openclaw memory status --deep` to probe", + skipped: true, + }, + }); + + expect(note).not.toHaveBeenCalled(); + }); + + it("warns when local provider skipped readiness but configured local model is missing", async () => { + resolveMemorySearchConfig.mockReturnValue({ + provider: "local", + local: { modelPath: "/definitely/missing/openclaw-memory-model.gguf" }, + remote: {}, + }); + + await noteMemorySearchHealth(cfg, { + gatewayMemoryProbe: { + checked: false, + ready: false, + error: + "memory embedding readiness not checked; run `openclaw memory status --deep` to probe", + skipped: true, + }, + }); + + expect(note).toHaveBeenCalledTimes(1); + expect(firstNoteMessage()).toContain('Memory search provider is set to "local"'); + }); + it("warns when local provider readiness probe is inconclusive", async () => { resolveMemorySearchConfig.mockReturnValue({ provider: "local", diff --git a/src/commands/doctor-memory-search.ts b/src/commands/doctor-memory-search.ts index aaba473c9b00..66a4939dcc35 100644 --- a/src/commands/doctor-memory-search.ts +++ b/src/commands/doctor-memory-search.ts @@ -473,6 +473,11 @@ export async function noteMemorySearchHealth( return; } const hasExplicitLocalModel = hasLocalEmbeddings(resolved.local); + const hasUnavailableConfiguredLocalModel = + Boolean(normalizeOptionalString(resolved.local.modelPath)) && !hasExplicitLocalModel; + if (opts?.gatewayMemoryProbe?.skipped && !hasUnavailableConfiguredLocalModel) { + return; + } const detail = opts?.gatewayMemoryProbe?.error?.trim(); note( [