Skip to content

feat(memory): add CUSTOM strategy type to agentcore-cli (#677)#22

Closed
aidandaly24 wants to merge 2 commits into
mainfrom
feat/custom-memory-strategy
Closed

feat(memory): add CUSTOM strategy type to agentcore-cli (#677)#22
aidandaly24 wants to merge 2 commits into
mainfrom
feat/custom-memory-strategy

Conversation

@aidandaly24

Copy link
Copy Markdown
Owner

Description

Adds CUSTOM as a 4th memory strategy type across schema, CLI, TUI, and documentation. This enables users to configure self-managed memory strategies with user-controlled extraction logic, closing the gap between the CDK (which already supported CUSTOM) and the CLI.

Changes:

  • Added CUSTOM to MemoryStrategyTypeSchema Zod enum
  • Added CUSTOM description to TUI strategy selection screen
  • Updated CLI validation and help text to derive from schema (eliminates source-of-truth drift)
  • CUSTOM intentionally has no default namespaces in DEFAULT_STRATEGY_NAMESPACES (uses Partial<Record> for type safety)
  • Updated docs (memory.md, commands.md, configuration.md) and AGENTS.md
  • Updated snapshot tests for asset changes
  • Added/updated unit, integration, and edge case tests

Related Issue

Closes aws#677

Documentation PR

N/A — docs updated inline in docs/ directory.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

How have you tested the change?

  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

Additional testing:

  • 16/16 schema unit tests pass (including CUSTOM acceptance, 4-option count, no default namespaces)
  • 110/110 validation tests pass (CUSTOM standalone, mixed with other strategies)
  • 8/8 add-memory integration tests pass (CUSTOM strategy creation)
  • 14/14 edge case scenarios verified (CUSTOM with namespaces, empty namespaces, max-length name, duplicate CUSTOM, CUSTOM+SEMANTIC side by side, etc.)
  • 3/3 manual CLI commands verified (--strategies CUSTOM produces {"type":"CUSTOM"} with no namespaces key)
  • TUI harness verified: 4 strategy options displayed with correct CUSTOM description, full wizard flow completes
  • Full project suite: 2912/2916 pass (4 failures are pre-existing OS-level posix_spawnp issues)

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

Enable self-managed (CUSTOM) memory strategy in the CLI, aligning
with the CDK constructs which already support customMemoryStrategy
via CloudFormation.

Changes:
- Add CUSTOM to MemoryStrategyTypeSchema enum and validation
- Add CUSTOM description to TUI wizard strategy picker
- Update CLI help text, LLM-compacted types, and AGENTS.md
- Add documentation for self-managed strategy in docs/
- Update tests: flip rejection tests to acceptance, add new cases
- Regenerate asset snapshots

Constraint: CDK already maps CUSTOM → customMemoryStrategy in CFN
Rejected: New SELF_MANAGED type | cross-layer naming inconsistency with CDK
Confidence: high
Scope-risk: narrow
Eliminates source-of-truth drift by deriving the valid strategies
array and CLI help text from MemoryStrategyTypeSchema.options
instead of maintaining hand-written duplicates.

Constraint: MemoryStrategyTypeSchema is the single source of truth
Confidence: high
Scope-risk: narrow
@github-actions github-actions Bot added the size/m PR size: M label Mar 27, 2026
@github-actions

Copy link
Copy Markdown

Package Tarball

aws-agentcore-0.3.0-preview.8.0.tgz

How to install

npm install https://github.com/aidandaly24/agentcore-cli/releases/download/pr-22-tarball/aws-agentcore-0.3.0-preview.8.0.tgz

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 44.71% 5977 / 13367
🔵 Statements 44.31% 6350 / 14328
🔵 Functions 44.01% 1117 / 2538
🔵 Branches 44.75% 3924 / 8768
Generated in workflow #57 for commit be2f877 by the Vitest Coverage Report Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Self-managed strategy in memory not yet supported

1 participant