fix(memory): Phase 0.2 AgentCore Memory fixes from the baseline audit - #1292
Merged
Merged
Conversation
- Relevance cut 0.7 -> 0.5 (constants default). In dev, questions about a stored fact scored 0.57-0.67 and unrelated records <= 0.40, so 0.7 dropped every realistic hit and no turn ever received memory context. - Session delete also purges that session's SUMMARIZATION records (exact per-session namespace, batches of 100), even after its events expired. Semantic facts/preferences carry no source session and are left alone. - Share-fork writes events with extractionMode="SKIP", so another user's messages stay in the fork's history but never feed the forker's long-term extraction. - Runtime role: both memory statements share RUNTIME_MEMORY_ACTIONS (the scoped one lacked GetMemory under a wrong comment). - Stale "write-only" lines corrected in two specs and the app_context_dispatch docstring (which cited a deleted analysis doc). - CDK test pins strategy names, no custom namespaces, 90-day expiry and identical Runtime memory action sets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Shared Projects Phase 0.2: the fixes found by the AgentCore Memory baseline audit (#1291,
docs/specs/memory-baseline-decision.md).agents/main_agent/config/constants.pysessions/services/session_service.pyextractionMode="SKIP"). The owner's messages stay in the fork's history but no longer become the forker's "memories".shares/service.pyRUNTIME_MEMORY_ACTIONS. The scoped statement lackedGetMemory, under a comment wrongly saying it was not a real IAM action.inference-api-iam-roles.ts,inference-agentcore-construct.tsapp_context_dispatch.pydocstring, which cited a deleted analysis doc.namespaces, 90-day expiry, and identical Runtime memory action sets.infrastructure/test/agentcore-memory.test.tsWorth a careful look
<user_context>block on the user message. It sits after the prompt-cache point, so the cached system prefix is untouched.AGENTCORE_MEMORY_RELEVANCE_SCOREalready overrides it per environment when set.create_messagehas no extraction argument. A test drives the pinned SDK's realMemoryClient.create_event, so an upgrade that bypasses the wrapper fails CI.Test plan
test_session_delete_memory_purge.py(5) and fork-extraction tests intest_share_export.py(3);test_session_factory.pydefault updatedtsc --noEmit, full jest (932 passed, incl. 4 new)tests/supply_chain/(31 passed; the audit's copy of the relevance cut now pins 0.5)Retrieved N customer context items)🤖 Generated with Claude Code