fix(eve): scope forget, persist capture idempotency, and fail closed

Review findings: delete was not partitioned by scope.key, capture
replay after restart could double-write, and Mem0 errors were swallowed
as empty recall.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Himanshu-Sangshetti
2026-09-09 10:48:26 +08:00
co-authored by Cursor
parent 1d83bb0835
commit 10d6717068
24 changed files with 1013 additions and 165 deletions
@@ -29,4 +29,19 @@ describe("createIdempotencyGate", () => {
await once("op_1", work);
expect(calls).toBe(2);
});
it("evicts the oldest id after the cap", async () => {
const once = createIdempotencyGate(2);
let calls = 0;
const work = async () => {
calls += 1;
};
await once("op_1", work);
await once("op_2", work);
await once("op_3", work);
await once("op_1", work);
expect(calls).toBe(4);
});
});