Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
test(decide): the late-answer think test settles its receipts before returning
garrytan3cfed54206d0
diff --git a/docs/fix-wave-notes/capy-foundations-2.md b/docs/fix-wave-notes/capy-foundations-2.mdindex e975c1e8f4..a7dfc9b49a 100644--- a/docs/fix-wave-notes/capy-foundations-2.md+++ b/docs/fix-wave-notes/capy-foundations-2.md@@ -85,6 +85,9 @@ Every P0 item shipped. Nothing was cut.home: snapshot brains share one `brain_id`, so the maintenance principallookup found and verified that registration. The test now runs with its own`GBRAIN_HOME`.+- `test/decide/retrieval-think.serial.test.ts` (from #5797): the late-answer+ test now waits for both of its intent receipts before returning, so the+ late `fallback_regex` receipt no longer lands in the next test's count.- PR-budget coverage cut: the 150 s pull-request robot run on Postgres skipsthe seams and the fault that can wait out a dead owner's 2-minute claimlease (`effect:*`, `consumer:prepared`, `publication:prepared`,diff --git a/test/decide/retrieval-think.serial.test.ts b/test/decide/retrieval-think.serial.test.tsindex a7e4d49f2e..78fa71f0c7 100644--- a/test/decide/retrieval-think.serial.test.ts+++ b/test/decide/retrieval-think.serial.test.ts@@ -159,6 +159,14 @@ describe('S2 in think', () => {__setDecideTransportForTests(async () => new Response('x', { status: 503 }));const failed = await startThinkDecide(engine, { question: 'alpha keyword', remote: false }, 'temporal');expect(await failed!.trajectoryIntent('temporal')).toBe('temporal');+ // The late answer lands after the wait; settle it here so its receipt never reaches the next test.+ let rows: Array<{ outcome: string }> = [];+ for (const deadline = Date.now() + 5000; Date.now() < deadline; await new Promise((r) => setTimeout(r, 20))) {+ await flushDecideWrites();+ rows = await engine.executeRaw<{ outcome: string }>(`SELECT outcome FROM decision_receipts WHERE slot = 'intent' AND call_site = 'think' ORDER BY outcome`);+ if (rows.length >= 2) break;+ }+ expect(rows.map((r) => r.outcome)).toEqual(['error', 'fallback_regex']);});test('all-off: no decide work at all', async () => {