From 73f54eb386e7156dc8ce06a8140245d0a815958d Mon Sep 17 00:00:00 2001 From: gethin Date: Fri, 31 Jul 2026 22:22:05 +0100 Subject: [PATCH] test(e2e): update bootstrap call-count assertions for semantic fan-out PR #117 (issue #109) changed session_bootstrap to fan out the semantic count over both the project and general namespaces, taking the ListMemoryRecords call count from 3 to 4. It updated the unit test in test_agentcore_unit.py but missed the hard-coded counts in the J2 journey test, leaving main red. The 4-call shape is the intended behaviour, so this updates the stale assertions rather than the code: total calls 3 -> 4, and the semantic leg 1 -> 2 (project + general). The episodic leg stays at 2. CI did not catch this because no workflow runs tests/e2e -- only bugbot, docs, typecheck and ui-tests. Worth a follow-up. Co-Authored-By: Claude Opus 5 --- tests/e2e/test_agentcore_journey.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/e2e/test_agentcore_journey.py b/tests/e2e/test_agentcore_journey.py index e145f54..16a2450 100644 --- a/tests/e2e/test_agentcore_journey.py +++ b/tests/e2e/test_agentcore_journey.py @@ -271,10 +271,14 @@ def test_j2_session_bootstrap_hook_reaches_agentcore( assert "Semantic memories:" in ctx lists = fake.requests_for("ListMemoryRecords") - assert len(lists) == 3 - assert len(fake.requests) == 3 + # 4 calls: 2 episodic (project + general reflections) and 2 semantic + # (project + general). The semantic leg fans out over both namespaces + # so general-scope memories are counted and the count is not clamped + # to one capped page — see #109 / PR #117. + assert len(lists) == 4 + assert len(fake.requests) == 4 assert sum("EPI-FAKE-0001" in r.path for r in lists) == 2 - assert sum("SEM-FAKE-0001" in r.path for r in lists) == 1 + assert sum("SEM-FAKE-0001" in r.path for r in lists) == 2 # No metadataFilters anywhere — polarity is not a legal filter key # on real AWS (the fake 400s it) and status is client-side. assert all("metadataFilters" not in r.body for r in lists)