Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test: count replay provider calls after the first remember's embedding effects settle

garrytan5c13c2cb5e84
diff --git a/test/persistence-memory-mutations.test.ts b/test/persistence-memory-mutations.test.ts
index 8ed1b4ee97..d559d1ea98 100644
--- a/test/persistence-memory-mutations.test.ts
+++ b/test/persistence-memory-mutations.test.ts
@@ -210,6 +210,9 @@ describe('journaled memory publication, both engines', () => {
const params = { fact: 'Left acme-example', provenance: 'test', entity: slug, request_id: randomUUID() };
const next = await submitRememberMutation(context(engine, true), params, 30_000);
expect(next.status).toBe('superseded');
+ await waitFor(async () => (await engine.executeRaw(`SELECT 1 FROM persistence_effects e JOIN persistence_requests r ON r.id=e.request_id
+ WHERE r.source_id=$1 AND r.slug=$2 AND e.state IN ('queued','running')`, [sourceId, slug])).length === 0,
+ { label: `${engine.kind}: ${slug} effects settled before the replay count` });
const callsBeforeReplay = providerCalls;
expect(await submitRememberMutation(context(engine, true), params)).toEqual(next);
expect(providerCalls).toBe(callsBeforeReplay);