
























@@ -276,6 +276,63 @@ describe("noteMemorySearchHealth", () => {
276276);
277277});
278278279+it("does not warn when CLI backend resolution is missing but gateway memory probe is ready", async () => {
280+resolveActiveMemoryBackendConfig.mockReturnValue(null);
281+resolveMemorySearchConfig.mockReturnValue({
282+provider: "auto",
283+local: {},
284+remote: {},
285+});
286+287+await noteMemorySearchHealth(cfg, {
288+gatewayMemoryProbe: { checked: true, ready: true },
289+});
290+291+expect(resolveApiKeyForProvider).not.toHaveBeenCalled();
292+expect(checkQmdBinaryAvailability).not.toHaveBeenCalled();
293+expect(note).not.toHaveBeenCalled();
294+});
295+296+it("warns when CLI backend resolution is missing and gateway memory probe was skipped", async () => {
297+resolveActiveMemoryBackendConfig.mockReturnValue(null);
298+resolveMemorySearchConfig.mockReturnValue({
299+provider: "auto",
300+local: {},
301+remote: {},
302+});
303+304+await noteMemorySearchHealth(cfg, {
305+gatewayMemoryProbe: { checked: false, ready: false, skipped: true },
306+});
307+308+expect(resolveApiKeyForProvider).not.toHaveBeenCalled();
309+expect(checkQmdBinaryAvailability).not.toHaveBeenCalled();
310+expect(note).toHaveBeenCalledTimes(1);
311+expect(String(note.mock.calls[0]?.[0] ?? "")).toContain(
312+"No active memory plugin is registered",
313+);
314+});
315+316+it("warns when CLI backend resolution is missing and gateway memory probe is not ready", async () => {
317+resolveActiveMemoryBackendConfig.mockReturnValue(null);
318+resolveMemorySearchConfig.mockReturnValue({
319+provider: "auto",
320+local: {},
321+remote: {},
322+});
323+324+await noteMemorySearchHealth(cfg, {
325+gatewayMemoryProbe: { checked: true, ready: false, error: "memory search unavailable" },
326+});
327+328+expect(resolveApiKeyForProvider).not.toHaveBeenCalled();
329+expect(checkQmdBinaryAvailability).not.toHaveBeenCalled();
330+expect(note).toHaveBeenCalledTimes(1);
331+expect(String(note.mock.calls[0]?.[0] ?? "")).toContain(
332+"No active memory plugin is registered",
333+);
334+});
335+279336it("does not warn when QMD backend is active", async () => {
280337const qmdCfg = { memory: { backend: "qmd", qmd: { command: "qmd" } } } as OpenClawConfig;
281338resolveMemorySearchConfig.mockReturnValue({
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。