mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-23 18:21:15 +00:00
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:
@@ -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",
|
||||
|
||||
@@ -548,6 +548,10 @@ export async function noteMemorySearchHealth(
|
||||
return;
|
||||
}
|
||||
|
||||
if (provider === "none") {
|
||||
return;
|
||||
}
|
||||
|
||||
if (provider === "local") {
|
||||
const suggestedRemoteProvider = resolveSuggestedRemoteMemoryProvider();
|
||||
const runtimeFacts = opts?.gatewayMemoryProbe?.runtimeFacts;
|
||||
|
||||
Reference in New Issue
Block a user