From 41aa36a6e703a92c2d166fb4e1b0ee4712efe1db Mon Sep 17 00:00:00 2001 From: jincheng-xydt Date: Wed, 15 Jul 2026 12:01:38 +0800 Subject: [PATCH] fix(doctor): accept memory provider none without api key (#107778) * fix(doctor): accept memory provider none without api key * test(doctor): preserve FTS-only backend diagnostics Co-authored-by: jincheng-xydt --------- Co-authored-by: Peter Steinberger --- src/commands/doctor-memory-search.test.ts | 32 +++++++++++++++++++++++ src/commands/doctor-memory-search.ts | 4 +++ 2 files changed, 36 insertions(+) diff --git a/src/commands/doctor-memory-search.test.ts b/src/commands/doctor-memory-search.test.ts index 623c82c98b8d..831f41292c68 100644 --- a/src/commands/doctor-memory-search.test.ts +++ b/src/commands/doctor-memory-search.test.ts @@ -266,6 +266,38 @@ describe("noteMemorySearchHealth", () => { expect(note).not.toHaveBeenCalled(); }); + it("does not warn or request NONE_API_KEY for intentional FTS-only mode", async () => { + resolveMemorySearchConfig.mockReturnValue({ + provider: "none", + fallback: "none", + local: {}, + remote: {}, + }); + + await noteMemorySearchHealth(cfg, {}); + + expect(note).not.toHaveBeenCalled(); + expect(resolveApiKeyForProvider).not.toHaveBeenCalled(); + }); + + it("still reports a missing memory backend in intentional FTS-only mode", async () => { + resolveMemorySearchConfig.mockReturnValue({ + provider: "none", + fallback: "none", + local: {}, + remote: {}, + }); + resolveActiveMemoryBackendConfig.mockReturnValue(null); + + await noteMemorySearchHealth(cfg, {}); + + expect(note).toHaveBeenCalledWith( + "No active memory plugin is registered for the current config.", + "Memory search", + ); + expect(resolveApiKeyForProvider).not.toHaveBeenCalled(); + }); + it("reports last-known llama.cpp runtime facts from the gateway", async () => { resolveMemorySearchConfig.mockReturnValue({ provider: "local", diff --git a/src/commands/doctor-memory-search.ts b/src/commands/doctor-memory-search.ts index e1dee1ab709f..8543b73dd975 100644 --- a/src/commands/doctor-memory-search.ts +++ b/src/commands/doctor-memory-search.ts @@ -548,6 +548,10 @@ export async function noteMemorySearchHealth( return; } + if (provider === "none") { + return; + } + if (provider === "local") { const suggestedRemoteProvider = resolveSuggestedRemoteMemoryProvider(); const runtimeFacts = opts?.gatewayMemoryProbe?.runtimeFacts;