

























@@ -105,6 +105,7 @@ describe("memory cli", () => {
105105106106function makeMemoryStatus(overrides: Record<string, unknown> = {}) {
107107return {
108+backend: "builtin",
108109files: 0,
109110chunks: 0,
110111dirty: false,
@@ -113,7 +114,7 @@ describe("memory cli", () => {
113114provider: "openai",
114115model: "text-embedding-3-small",
115116requestedProvider: "openai",
116-vector: { enabled: true, available: true },
117+vector: { enabled: true, storeAvailable: true, semanticAvailable: true, available: true },
117118 ...overrides,
118119};
119120}
@@ -226,6 +227,8 @@ describe("memory cli", () => {
226227fts: { enabled: true, available: true },
227228vector: {
228229enabled: true,
230+storeAvailable: true,
231+semanticAvailable: true,
229232available: true,
230233extensionPath: "/opt/sqlite-vec.dylib",
231234dims: 1024,
@@ -238,7 +241,8 @@ describe("memory cli", () => {
238241await runMemoryCli(["status"]);
239242240243expect(probeVectorAvailability).not.toHaveBeenCalled();
241-expect(log).toHaveBeenCalledWith(expect.stringContaining("Vector: ready"));
244+expect(log).toHaveBeenCalledWith(expect.stringContaining("Vector store: ready"));
245+expect(log).toHaveBeenCalledWith(expect.stringContaining("Semantic vectors: ready"));
242246expect(log).toHaveBeenCalledWith(expect.stringContaining("Vector dims: 1024"));
243247expect(log).toHaveBeenCalledWith(expect.stringContaining("Vector path: /opt/sqlite-vec.dylib"));
244248expect(log).toHaveBeenCalledWith(expect.stringContaining("FTS: ready"));
@@ -274,7 +278,7 @@ describe("memory cli", () => {
274278expect(probeVectorAvailability).not.toHaveBeenCalled();
275279expect(probeEmbeddingAvailability).not.toHaveBeenCalled();
276280expect(log).toHaveBeenCalledWith(expect.stringContaining("Provider: auto"));
277-expect(log).toHaveBeenCalledWith(expect.stringContaining("Vector: unknown"));
281+expect(log).toHaveBeenCalledWith(expect.stringContaining("Vector store: unknown"));
278282expect(close).toHaveBeenCalled();
279283});
280284@@ -350,6 +354,8 @@ describe("memory cli", () => {
350354dirty: true,
351355vector: {
352356enabled: true,
357+storeAvailable: false,
358+semanticAvailable: false,
353359available: false,
354360loadError: "load failed",
355361},
@@ -360,16 +366,19 @@ describe("memory cli", () => {
360366const log = spyRuntimeLogs(defaultRuntime);
361367await runMemoryCli(["status", "--agent", "main"]);
362368363-expect(log).toHaveBeenCalledWith(expect.stringContaining("Vector: unavailable"));
369+expect(log).toHaveBeenCalledWith(expect.stringContaining("Vector store: unavailable"));
370+expect(log).toHaveBeenCalledWith(expect.stringContaining("Semantic vectors: unavailable"));
364371expect(log).toHaveBeenCalledWith(expect.stringContaining("Vector error: load failed"));
365372expect(close).toHaveBeenCalled();
366373});
367374368375it("prints embeddings status when deep", async () => {
369376const close = vi.fn(async () => {});
377+const probeVectorStoreAvailability = vi.fn(async () => true);
370378const probeVectorAvailability = vi.fn(async () => true);
371379const probeEmbeddingAvailability = vi.fn(async () => ({ ok: true }));
372380mockManager({
381+ probeVectorStoreAvailability,
373382 probeVectorAvailability,
374383 probeEmbeddingAvailability,
375384status: () => makeMemoryStatus({ files: 1, chunks: 1 }),
@@ -379,12 +388,89 @@ describe("memory cli", () => {
379388const log = spyRuntimeLogs(defaultRuntime);
380389await runMemoryCli(["status", "--deep"]);
381390391+expect(probeVectorStoreAvailability).toHaveBeenCalled();
382392expect(probeVectorAvailability).toHaveBeenCalled();
383393expect(probeEmbeddingAvailability).toHaveBeenCalled();
384394expect(log).toHaveBeenCalledWith(expect.stringContaining("Embeddings: ready"));
385395expect(close).toHaveBeenCalled();
386396});
387397398+it("prints vector store separately from embedding readiness when deep", async () => {
399+const close = vi.fn(async () => {});
400+const probeVectorStoreAvailability = vi.fn(async () => true);
401+const probeVectorAvailability = vi.fn(async () => false);
402+const probeEmbeddingAvailability = vi.fn(async () => ({
403+ok: false,
404+error: "No embedding provider available",
405+}));
406+mockManager({
407+ probeVectorStoreAvailability,
408+ probeVectorAvailability,
409+ probeEmbeddingAvailability,
410+status: () =>
411+makeMemoryStatus({
412+provider: "none",
413+requestedProvider: "auto",
414+vector: {
415+enabled: true,
416+storeAvailable: true,
417+semanticAvailable: false,
418+available: false,
419+},
420+}),
421+ close,
422+});
423+424+const log = spyRuntimeLogs(defaultRuntime);
425+await runMemoryCli(["status", "--deep"]);
426+427+expect(probeVectorStoreAvailability).toHaveBeenCalled();
428+expect(probeEmbeddingAvailability).toHaveBeenCalled();
429+expect(probeVectorAvailability).toHaveBeenCalled();
430+expect(log).toHaveBeenCalledWith(expect.stringContaining("Vector store: ready"));
431+expect(log).toHaveBeenCalledWith(expect.stringContaining("Semantic vectors: unavailable"));
432+expect(log).toHaveBeenCalledWith(expect.stringContaining("Embeddings: unavailable"));
433+expect(log).toHaveBeenCalledWith(
434+expect.stringContaining("Embeddings error: No embedding provider available"),
435+);
436+expect(close).toHaveBeenCalled();
437+});
438+439+it("keeps non-builtin deep status on the semantic vector probe", async () => {
440+const close = vi.fn(async () => {});
441+const probeVectorStoreAvailability = vi.fn(async () => true);
442+const probeVectorAvailability = vi.fn(async () => true);
443+const probeEmbeddingAvailability = vi.fn(async () => ({ ok: true }));
444+mockManager({
445+ probeVectorStoreAvailability,
446+ probeVectorAvailability,
447+ probeEmbeddingAvailability,
448+status: () =>
449+makeMemoryStatus({
450+backend: "qmd",
451+provider: "qmd",
452+model: "qmd",
453+requestedProvider: "qmd",
454+vector: {
455+enabled: true,
456+semanticAvailable: true,
457+available: true,
458+},
459+}),
460+ close,
461+});
462+463+const log = spyRuntimeLogs(defaultRuntime);
464+await runMemoryCli(["status", "--deep"]);
465+466+expect(probeVectorStoreAvailability).not.toHaveBeenCalled();
467+expect(probeVectorAvailability).toHaveBeenCalled();
468+expect(probeEmbeddingAvailability).toHaveBeenCalled();
469+expect(log).toHaveBeenCalledWith(expect.stringContaining("Vector: ready"));
470+expect(log).not.toHaveBeenCalledWith(expect.stringContaining("Vector store:"));
471+expect(close).toHaveBeenCalled();
472+});
473+388474it("prints recall-store audit details during status", async () => {
389475await withTempWorkspace(async (workspaceDir) => {
390476await recordShortTermRecalls({
@@ -578,9 +664,11 @@ describe("memory cli", () => {
578664it("reindexes on status --index", async () => {
579665const close = vi.fn(async () => {});
580666const sync = vi.fn(async () => {});
667+const probeVectorStoreAvailability = vi.fn(async () => true);
581668const probeVectorAvailability = vi.fn(async () => true);
582669const probeEmbeddingAvailability = vi.fn(async () => ({ ok: true }));
583670mockManager({
671+ probeVectorStoreAvailability,
584672 probeVectorAvailability,
585673 probeEmbeddingAvailability,
586674 sync,
@@ -592,6 +680,7 @@ describe("memory cli", () => {
592680await runMemoryCli(["status", "--index"]);
593681594682expectCliSync(sync);
683+expect(probeVectorStoreAvailability).toHaveBeenCalled();
595684expect(probeVectorAvailability).toHaveBeenCalled();
596685expect(probeEmbeddingAvailability).toHaveBeenCalled();
597686expect(getMemorySearchManager).toHaveBeenCalledWith({
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。