fix(unit-only): Re-apply PR #1299's one-line change in all three Strands ... (#665)#31
Draft
aidandaly24 wants to merge 3 commits into
Draft
fix(unit-only): Re-apply PR #1299's one-line change in all three Strands ... (#665)#31aidandaly24 wants to merge 3 commits into
aidandaly24 wants to merge 3 commits into
Conversation
…mespace
Cross-session SUMMARIZATION recall was silently broken: the vended Strands
session.py templates retrieved summaries with a per-session namespace
(/summaries/{actor_id}/{session_id}), which only prefix-matches the current
session and never surfaces prior sessions' summaries. Re-apply PR aws#1299's
one-line fix to use an actor-scoped namespace (/summaries/{actor_id}) in all
three templates (http, agui, a2a), regenerate the asset snapshot, update
docs/memory.md, and add a regression test to prevent another silent revert
(reverted previously by squash release aws#1547).
Fixes aws#665
Coverage Report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs aws#665
Issues
--strategies SUMMARIZATIONwrite per-session conversation summaries correctly, but the generated session.py retrieves them with a per-session namespace, so a new session never sees prior sessions' summaries. Cross-session summary recall silently does nothing; the feature appears write-only to users.Root cause
PR aws#1299 (1402057) fixed the SUMMARIZATION retrieval namespace; squash release 845c1bd (aws#1547) reverted that exact line, re-shipping f"/summaries/{actor_id}/{session_id}" in v0.20.2's three vended session.py templates at line 31, which prefix-matches only the current session and never finds prior sessions' summaries (SDK retrieve_memories namespace_path is prefix-based, client.py:322-338).
The fix
Re-apply PR aws#1299's one-line change in all three Strands session.py templates: change the SUMMARIZATION retrieval line at line 31 from f"/summaries/{actor_id}/{session_id}" to f"/summaries/{actor_id}". Run
npm run test:update-snapshotsto refresh the 3 affected entries in assets.snapshot.test.ts.snap (lines 2264, 3286, 6554). Update docs/memory.md:95 (manual-wiring snippet) and the strategy table at docs/memory.md:160 to /summaries/{actorId} for SUMMARIZATION. Leave the write-side namespaceTemplate (memory.ts:26) and EPISODIC ({session_id} kept intentionally; the issue is scoped to SUMMARIZATION) unchanged. Add a regression test asserting the generated SUMMARIZATION retrieval namespace contains no {session_id}, so a future squash-merge cannot silently revert it again. No SDK or CDK change needed (SDK prefix-retrieval is correct; CDK owns nothing in this path).Files touched: src/assets/python/http/strands/capabilities/memory/session.py:31; src/assets/python/agui/strands/capabilities/memory/session.py:31; src/assets/python/a2a/strands/capabilities/memory/session.py:31; docs/memory.md:95 and :160; src/assets/tests/snapshots/assets.snapshot.test.ts.snap (regen, lines 2264/3286/6554); new regression test in src/assets/tests/
Validation evidence
The fix was verified by reproducing the original symptom and re-running after the change:
Test suite: green.
Staged on the fork as a draft for human review. Promote to aws/agentcore-cli after vetting.