
















@@ -278,6 +278,84 @@ describe("noteMemorySearchHealth", () => {
278278expect(firstNoteMessage()).toContain("No active memory plugin is registered");
279279});
280280281+it("does not warn when an enabled alternate memory plugin owns the memory slot", async () => {
282+resolveActiveMemoryBackendConfig.mockReturnValue(null);
283+resolveMemorySearchConfig.mockReturnValue({
284+provider: "auto",
285+local: {},
286+remote: {},
287+});
288+const cfgWithLancedb = {
289+plugins: {
290+slots: { memory: "memory-lancedb" },
291+entries: { "memory-lancedb": { enabled: true, config: { dbPath: ".openclaw/memory" } } },
292+},
293+} as unknown as OpenClawConfig;
294+295+await noteMemorySearchHealth(cfgWithLancedb, {});
296+297+expect(resolveApiKeyForProvider).not.toHaveBeenCalled();
298+expect(checkQmdBinaryAvailability).not.toHaveBeenCalled();
299+expect(note).not.toHaveBeenCalled();
300+});
301+302+it("still warns when an alternate memory slot has no configured plugin entry", async () => {
303+resolveActiveMemoryBackendConfig.mockReturnValue(null);
304+resolveMemorySearchConfig.mockReturnValue({
305+provider: "auto",
306+local: {},
307+remote: {},
308+});
309+const cfgWithSlotOnly = {
310+plugins: { slots: { memory: "memory-lancedb" } },
311+} as unknown as OpenClawConfig;
312+313+await noteMemorySearchHealth(cfgWithSlotOnly, {});
314+315+expect(note).toHaveBeenCalledTimes(1);
316+expect(firstNoteMessage()).toContain("No active memory plugin is registered");
317+});
318+319+it("still warns when an alternate memory slot entry is disabled", async () => {
320+resolveActiveMemoryBackendConfig.mockReturnValue(null);
321+resolveMemorySearchConfig.mockReturnValue({
322+provider: "auto",
323+local: {},
324+remote: {},
325+});
326+const cfgWithDisabledLancedb = {
327+plugins: {
328+slots: { memory: "memory-lancedb" },
329+entries: { "memory-lancedb": { enabled: false } },
330+},
331+} as unknown as OpenClawConfig;
332+333+await noteMemorySearchHealth(cfgWithDisabledLancedb, {});
334+335+expect(note).toHaveBeenCalledTimes(1);
336+expect(firstNoteMessage()).toContain("No active memory plugin is registered");
337+});
338+339+it("still warns when an alternate memory slot entry is only a placeholder", async () => {
340+resolveActiveMemoryBackendConfig.mockReturnValue(null);
341+resolveMemorySearchConfig.mockReturnValue({
342+provider: "auto",
343+local: {},
344+remote: {},
345+});
346+const cfgWithPlaceholderEntry = {
347+plugins: {
348+slots: { memory: "memory-lancedb" },
349+entries: { "memory-lancedb": {} },
350+},
351+} as unknown as OpenClawConfig;
352+353+await noteMemorySearchHealth(cfgWithPlaceholderEntry, {});
354+355+expect(note).toHaveBeenCalledTimes(1);
356+expect(firstNoteMessage()).toContain("No active memory plugin is registered");
357+});
358+281359it("does not warn when CLI backend resolution is missing but gateway memory probe is ready", async () => {
282360resolveActiveMemoryBackendConfig.mockReturnValue(null);
283361resolveMemorySearchConfig.mockReturnValue({
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。