fix: probe memory vector availability
This commit is contained in:
@@ -86,6 +86,32 @@ describe("memory index", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("reports vector availability after probe", async () => {
|
||||
const cfg = {
|
||||
agents: {
|
||||
defaults: {
|
||||
workspace: workspaceDir,
|
||||
memorySearch: {
|
||||
provider: "openai",
|
||||
model: "mock-embed",
|
||||
store: { path: indexPath },
|
||||
sync: { watch: false, onSessionStart: false, onSearch: false },
|
||||
},
|
||||
},
|
||||
list: [{ id: "main", default: true }],
|
||||
},
|
||||
};
|
||||
const result = await getMemorySearchManager({ cfg, agentId: "main" });
|
||||
expect(result.manager).not.toBeNull();
|
||||
if (!result.manager) throw new Error("manager missing");
|
||||
manager = result.manager;
|
||||
const available = await result.manager.probeVectorAvailability();
|
||||
const status = result.manager.status();
|
||||
expect(status.vector?.enabled).toBe(true);
|
||||
expect(typeof status.vector?.available).toBe("boolean");
|
||||
expect(status.vector?.available).toBe(available);
|
||||
});
|
||||
|
||||
it("rejects reading non-memory paths", async () => {
|
||||
const cfg = {
|
||||
agents: {
|
||||
|
||||
Reference in New Issue
Block a user