Skip to content

fix(bedrock-agentcore-alpha): self-managed memory strategy validation throws on unresolved tokens#37691

Merged
mergify[bot] merged 4 commits into
aws:mainfrom
mazyu36:fix/agentcore-memory-token-validation
Apr 30, 2026
Merged

fix(bedrock-agentcore-alpha): self-managed memory strategy validation throws on unresolved tokens#37691
mergify[bot] merged 4 commits into
aws:mainfrom
mazyu36:fix/agentcore-memory-token-validation

Conversation

@mazyu36

@mazyu36 mazyu36 commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Issue # (if applicable)

None

Reason for this change

The validation in SelfManagedMemoryStrategy throws when unresolved CDK tokens (e.g. CfnParameter.valueAsNumber) are passed for historicalContextWindowSize or the triggerConditions fields. These values can't be checked at synth time and should be skipped.

Description of changes

Added Token.isUnresolved() / Duration.isUnresolved() guards in self-managed-strategy.ts, following the same pattern as _validateMemoryExpirationDays (memory.ts) and validateLifecycleConfiguration (runtime.ts). Same approach as #37197.

Describe any new or updated permissions being added

None.

Description of how you validated changes

Added unit tests.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions Bot added the p2 label Apr 26, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team April 26, 2026 00:40
@github-actions github-actions Bot added the distinguished-contributor [Pilot] contributed 50+ PRs to the CDK label Apr 26, 2026
@mazyu36

mazyu36 commented Apr 26, 2026

Copy link
Copy Markdown
Contributor Author

Exemption Request: This change only adds synth-time token guards to existing validation logic; the runtime behavior and generated CloudFormation are unchanged, so an integration test would not exercise anything that unit tests don't already cover.

@aws-cdk-automation aws-cdk-automation added the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Apr 26, 2026

@aws-cdk-automation aws-cdk-automation left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Apr 26, 2026
@leonmk-aws leonmk-aws self-assigned this Apr 28, 2026
leonmk-aws
leonmk-aws previously approved these changes Apr 28, 2026

@leonmk-aws leonmk-aws left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Apr 28, 2026
@leonmk-aws leonmk-aws added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Apr 28, 2026
@aws-cdk-automation aws-cdk-automation dismissed their stale review April 28, 2026 16:03

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@mergify

mergify Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify

mergify Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-04-28 16:03 UTC · Rule: default-squash
  • 🚫 Left the queue2026-04-28 16:04 UTC · at 9682c71f8dff0ac5f1f8a1ac10c493436b8f769c

This pull request spent 11 seconds in the queue, with no time running CI.

Reason

The pull request can't be updated

For security reasons, Mergify can't update this pull request. Try updating locally.
GitHub response: refusing to allow a GitHub App to create or update workflow .github/workflows/pr-issue-check.yml without workflows permission

Hint

You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

@mazyu36

mazyu36 commented Apr 29, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio update

@mergify

mergify Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

update

❌ Mergify doesn't have permission to update

Details

For security reasons, Mergify can't update this pull request. Try updating locally.
GitHub response: refusing to allow a GitHub App to create or update workflow .github/workflows/pr-issue-check.yml without workflows permission

@mazyu36

mazyu36 commented Apr 29, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio requeue

@mergify

mergify Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

requeue

☑️ Command disallowed due to command restrictions in the Mergify configuration.

Details
  • sender-permission >= write

@mergify mergify Bot dismissed leonmk-aws’s stale review April 29, 2026 08:57

Pull request has been modified.

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Apr 29, 2026
@mazyu36

mazyu36 commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

@leonmk-aws
Thanks. Could you approve again?

@mazyu36 mazyu36 requested a review from leonmk-aws April 30, 2026 06:16
@mergify

mergify Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify

mergify Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-04-30 08:23 UTC · Rule: default-squash
  • Checks passed · in-place
  • Merged2026-04-30 08:52 UTC · at b2c29a6eebd348ed45490fdda5be48b915a28227 · squash

This pull request spent 29 minutes 11 seconds in the queue, including 28 minutes 53 seconds running CI.

Required conditions to merge

@mergify

mergify Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify Bot merged commit 7956537 into aws:main Apr 30, 2026
18 of 19 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 30, 2026
@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Apr 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

distinguished-contributor [Pilot] contributed 50+ PRs to the CDK p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants