refactor: fix webhook create/update serialization, add payload types, and MEMORY_CATEGORIZED event (#4429)

Co-authored-by: Saket Aryan <saketaryan2002@gmail.com>
This commit is contained in:
Kartik
2026-03-19 22:26:17 +05:30
committed by GitHub
co-authored by Saket Aryan
parent 88abb29de9
commit 6663b738d5
11 changed files with 362 additions and 128 deletions
@@ -177,23 +177,6 @@ describeIntegration("MemoryClient Integration — CRUD", () => {
});
});
// ─── Delete single ────────────────────────────────────────
describe("delete memory", () => {
test("deletes a single memory by ID", async () => {
const memoryId = memoryIds[0];
expect(memoryId).toBeDefined();
const result = await client.delete(memoryId);
expect(result).toBeDefined();
expect(typeof result.message).toBe("string");
});
test("getting deleted memory throws MemoryError", async () => {
const memoryId = memoryIds[0];
await expect(client.get(memoryId)).rejects.toThrow(MemoryError);
});
});
// ─── Edge cases ──────────────────────────────────────────
describe("edge cases", () => {
test("add with metadata attaches metadata to the memory", async () => {
@@ -234,6 +217,25 @@ describeIntegration("MemoryClient Integration — CRUD", () => {
});
});
// ─── Delete single ────────────────────────────────────────
// NOTE: Delete tests run last to avoid race conditions with
// other tests that depend on the seeded memories.
describe("delete memory", () => {
test("deletes a single memory by ID", async () => {
const memoryId = memoryIds[0];
expect(memoryId).toBeDefined();
const result = await client.delete(memoryId);
expect(result).toBeDefined();
expect(typeof result.message).toBe("string");
});
test("getting deleted memory throws MemoryError", async () => {
const memoryId = memoryIds[0];
await expect(client.get(memoryId)).rejects.toThrow(MemoryError);
});
});
// ─── Delete all + delete user ─────────────────────────────
describe("cleanup operations", () => {
test("deletes all memories for test user", async () => {