mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-08 02:52:15 +00:00
fix(memory): treat qmd lexical status as ready
This commit is contained in:
@@ -677,6 +677,42 @@ describe("memory cli", () => {
|
||||
expect(close).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("does not report qmd lexical search mode as embedding unavailable", async () => {
|
||||
const close = vi.fn(async () => {});
|
||||
const probeVectorStoreAvailability = vi.fn(async () => true);
|
||||
const probeVectorAvailability = vi.fn(async () => false);
|
||||
const probeEmbeddingAvailability = vi.fn(async () => ({ ok: true, checked: false }));
|
||||
mockManager({
|
||||
probeVectorStoreAvailability,
|
||||
probeVectorAvailability,
|
||||
probeEmbeddingAvailability,
|
||||
status: () =>
|
||||
makeMemoryStatus({
|
||||
backend: "qmd",
|
||||
provider: "qmd",
|
||||
model: "qmd",
|
||||
requestedProvider: "qmd",
|
||||
vector: {
|
||||
enabled: false,
|
||||
semanticAvailable: false,
|
||||
available: false,
|
||||
},
|
||||
}),
|
||||
close,
|
||||
});
|
||||
|
||||
const log = spyRuntimeLogs(defaultRuntime);
|
||||
await runMemoryCli(["status", "--deep"]);
|
||||
|
||||
expect(probeVectorStoreAvailability).not.toHaveBeenCalled();
|
||||
expect(probeVectorAvailability).toHaveBeenCalled();
|
||||
expect(probeEmbeddingAvailability).toHaveBeenCalled();
|
||||
expectLogged(log, "Vector: disabled");
|
||||
expectLogged(log, "Embeddings: ready");
|
||||
expectNotLogged(log, "Embeddings error:");
|
||||
expect(close).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("prints recall-store audit details during status", async () => {
|
||||
await withTempWorkspace(async (workspaceDir) => {
|
||||
await recordShortTermRecalls({
|
||||
|
||||
@@ -6062,8 +6062,8 @@ describe("QmdMemoryManager", () => {
|
||||
|
||||
await expect(manager.probeVectorAvailability()).resolves.toBe(false);
|
||||
await expect(manager.probeEmbeddingAvailability()).resolves.toEqual({
|
||||
ok: false,
|
||||
error: "QMD semantic vectors are unavailable",
|
||||
ok: true,
|
||||
checked: false,
|
||||
});
|
||||
expect(spawnMock.mock.calls.length).toBe(baselineCalls);
|
||||
expect(manager.status().vector).toEqual({
|
||||
|
||||
@@ -1566,6 +1566,9 @@ export class QmdMemoryManager implements MemorySearchManager {
|
||||
}
|
||||
|
||||
async probeEmbeddingAvailability(): Promise<MemoryEmbeddingProbeResult> {
|
||||
if (!qmdUsesVectors(this.qmd.searchMode)) {
|
||||
return { ok: true, checked: false };
|
||||
}
|
||||
const ok = await this.probeVectorAvailability();
|
||||
return {
|
||||
ok,
|
||||
|
||||
Reference in New Issue
Block a user