chore: merge origin/main into mintlify/af82bda4 and resolve conflicts

This commit is contained in:
mintlify[bot]
2026-09-16 11:46:52 +00:00
committed by GitHub
parent b5ae772eae
commit 08d9636491
693 changed files with 55668 additions and 22676 deletions
@@ -6,6 +6,7 @@ const mockMem0 = {
search: vi.fn(),
add: vi.fn(),
getAll: vi.fn(),
update: vi.fn(),
delete: vi.fn(),
deleteAll: vi.fn(),
};
@@ -38,11 +39,13 @@ describe("buildToolExecute", () => {
expect(call[1].customCategories.length).toBe(10);
});
it("search with scope=global filters by user_id with app_id wildcard", async () => {
it("search uses global scope only after the user selects it", async () => {
mockMem0.search.mockResolvedValue({ results: [] });
await execute({ action: "search", query: "preferences", scope: "global" });
await expect(execute({ action: "search", query: "preferences", scope: "global" })).rejects.toThrow(/Select global/);
const globalExecute = buildToolExecute(mockMem0 as any, scopeCtx, "global");
await globalExecute({ action: "search", query: "preferences", scope: "global" });
expect(mockMem0.search).toHaveBeenCalledWith("preferences", {
filters: { user_id: "testuser", app_id: "*" },
filters: { user_id: "testuser" },
});
});
@@ -58,4 +61,19 @@ describe("buildToolExecute", () => {
await execute({ action: "delete", memory_id: fullId });
expect(mockMem0.delete).toHaveBeenCalledWith(fullId);
});
it("write actions accept the citation ID returned by search", async () => {
mockMem0.update.mockResolvedValue({ status: "updated" });
mockMem0.delete.mockResolvedValue({ message: "deleted" });
await execute({
action: "update",
memory_id: "[mem0:956e3d68-b420-4e07-a4e3-3019e7cebe6f]",
content: "updated memory",
});
await execute({ action: "delete", memory_id: "mem0:956e3d68-b420-4e07-a4e3-3019e7cebe6f" });
expect(mockMem0.update).toHaveBeenLastCalledWith("956e3d68-b420-4e07-a4e3-3019e7cebe6f", {
text: "updated memory",
});
expect(mockMem0.delete).toHaveBeenLastCalledWith("956e3d68-b420-4e07-a4e3-3019e7cebe6f");
});
});