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 <xu.jincheng@xydigit.com>

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
jincheng-xydt
2026-07-15 12:01:38 +08:00
committed by GitHub
parent bc769663f8
commit 41aa36a6e7
2 changed files with 36 additions and 0 deletions

View File

@@ -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",

View File

@@ -548,6 +548,10 @@ export async function noteMemorySearchHealth(
return;
}
if (provider === "none") {
return;
}
if (provider === "local") {
const suggestedRemoteProvider = resolveSuggestedRemoteMemoryProvider();
const runtimeFacts = opts?.gatewayMemoryProbe?.runtimeFacts;