Skip to content

fix(deploy): bump @aws-cdk/toolkit-lib to read cloud-assembly schema 54#1465

Merged
jariy17 merged 1 commit into
mainfrom
fix/cdk-toolkit-lib-schema54
Jun 5, 2026
Merged

fix(deploy): bump @aws-cdk/toolkit-lib to read cloud-assembly schema 54#1465
jariy17 merged 1 commit into
mainfrom
fix/cdk-toolkit-lib-schema54

Conversation

@aidandaly24
Copy link
Copy Markdown
Contributor

Description

agentcore deploy fails at the Synthesize CloudFormation step for freshly-created projects:

This AWS CDK Toolkit is not compatible with the AWS CDK library used by your application.
(Cloud assembly schema version mismatch: Maximum schema version supported is 53.x.x, but found 54.0.0.

Root cause — a frozen reader paired with a floating writer:

  • The generated CDK project pins aws-cdk-lib: ^2.248.0 (no lockfile), so npm install resolves the newest match.
  • On 2026-06-04, AWS published aws-cdk-lib@2.258.0, which bundles cloud-assembly-schema@^54.0.0. Fresh projects now write schema-54 manifests.
  • The CLI's bundled @aws-cdk/toolkit-lib@1.24.0 (frozen by npm-shrinkwrap.json) reads only up to schema 53.
  • Writer = 54, reader max = 53 → AssemblyVersionMismatch.

Registry-verified boundary:

Package Bundled cloud-assembly-schema Reads schema 54?
aws-cdk-lib@2.257.0 ^53.25.0 n/a (writes 53 ✅)
aws-cdk-lib@2.258.0 ^54.0.0 n/a (writes 54)
@aws-cdk/toolkit-lib@1.24.0 (current) max 53
@aws-cdk/toolkit-lib@1.27.0 >=53.28.0 (max 53)
@aws-cdk/toolkit-lib@1.28.0 >=54.2.0

This matches customer reports: aws-cdk-lib@2.257.0 deploys, 2.258.0 fails, same CLI (0.17.0).

Note: the error's "upgrade to CLI 2.1126.0" advice points at the standalone aws-cdk binary, which the deploy path never invokes — the CLI synthesizes programmatically via @aws-cdk/toolkit-lib. Bumping that library is the actual fix.

Changes

  • package.json: @aws-cdk/toolkit-lib ^1.16.0^1.28.0. Regenerating npm-shrinkwrap.json resolves the bundled reader to 1.28.0, whose nested cloud-assembly-schema is 54.2.0 (reads schema 54 + all of 53 — forward compatible). API-compatible drop-in: every toolkit-lib API the CLI uses (Toolkit, synth, fromCdkApp, deploy/destroy/bootstrap, StackSelectionStrategy) is byte-identical or only additively changed across 1.24.01.28.0, so no source changes.
  • src/assets/cdk/package.json: template aws-cdk devDep 2.1100.12.1126.0, so the manual npm run cdk escape hatch also reads schema 54.
  • assets.snapshot.test.ts.snap: updated for the template version bump.

No change needed to @aws/agentcore-cdk (L3 constructs) — it declares aws-cdk-lib only as a caret peer dependency and never reads/writes the cloud-assembly manifest.

Type of Change

  • Bug fix

Testing

Reproduced the customer scenario end-to-end against the patched CLI:

  1. agentcore create → generated CDK app resolves aws-cdk-lib@2.258.0, which writes a 54.0.0 manifest (cdk.out/manifest.json).
  2. agentcore deploy --dry-runSynthesize CloudFormation: SUCCESS (the exact step that previously threw AssemblyVersionMismatch), no schema errors in the deploy log.
  3. Confirmed at runtime resolution: the bundled toolkit-lib@1.28.0 loads cloud-assembly-schema@54.2.0 (reader 54.2.0 ≥ writer 54.0.0).
  • I ran npm run test:unit (240 deploy/cdk/error tests pass) and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint (0 errors)
  • I modified src/assets/, ran npm run test:update-snapshots, and committed the updated snapshot

Checklist

  • I have read the CONTRIBUTING document
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

aws-cdk-lib@2.258.0 (published 2026-06-04) bundles
cloud-assembly-schema ^54.0.0, so freshly-created CDK projects now write
schema-54 manifests. The CLI's bundled @aws-cdk/toolkit-lib@1.24.0 reads
only up to schema 53, so synth fails with AssemblyVersionMismatch
("Maximum schema version supported is 53.x.x, but found 54.0.0").

Bump @aws-cdk/toolkit-lib ^1.16.0 -> ^1.28.0 (resolves the bundled reader
to 1.28.0, whose nested cloud-assembly-schema is 54.2.0) and regenerate
npm-shrinkwrap.json. 1.28.0 reads schema 54 and all of 53 — forward
compatible — and is an API-compatible drop-in (no source changes).

Also bump the generated template's aws-cdk devDep 2.1100.1 -> 2.1126.0 so
the manual `npm run cdk` escape hatch can also read schema 54.

Verified by reproducing the customer scenario: a fresh project resolving
aws-cdk-lib@2.258.0 writes a 54.0.0 manifest, and `agentcore deploy
--dry-run` now synthesizes cleanly (Synthesize CloudFormation: SUCCESS).
@aidandaly24 aidandaly24 requested a review from a team June 5, 2026 18:51
@github-actions github-actions Bot added the size/s PR size: S label Jun 5, 2026
@github-actions github-actions Bot added the agentcore-harness-reviewing AgentCore Harness review in progress label Jun 5, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Jun 5, 2026
@agentcore-devx-automation
Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Jun 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

Package Tarball

aws-agentcore-0.17.0.tgz

How to install

gh release download pr-1465-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.17.0.tgz

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 35.54% 11183 / 31462
🔵 Statements 34.88% 11890 / 34086
🔵 Functions 30.27% 1880 / 6209
🔵 Branches 29.31% 7134 / 24334
Generated in workflow #3493 for commit 15906b7 by the Vitest Coverage Report Action

Copy link
Copy Markdown

@agentcore-cli-automation agentcore-cli-automation left a comment

Choose a reason for hiding this comment

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

Looks good to merge.

Verified the key claims independently:

  • Cross-checked the npm registry for @aws-cdk/toolkit-lib: 1.28.0 is indeed the first version whose @aws-cdk/cloud-assembly-schema peer/dep is >=54.x (1.27.0 and earlier all top out at >=53.x), so the bump is the minimal version that resolves the writer=54 / reader-max=53 mismatch.
  • The toolkit-lib API surface used in src/cli/cdk/toolkit-lib/wrapper.ts and src/cli/operations/deploy/teardown.ts (Toolkit, fromCdkApp, fromAssemblyDirectory, synth, deploy, destroy, bootstrap, BaseCredentials, BootstrapEnvironments, BootstrapStackParameters, StackSelectionStrategy, IIoHost, ICloudAssemblySource) is all stable across 1.24→1.28, so no source changes needed matches the diff.
  • Shrinkwrap update is internally consistent (toolkit-lib's nested cloud-assembly-schema@54.2.0, cloud-assembly-api@2.2.5, cdk-from-cfn and semver bumps; uuid removal is no longer a transitive dep of toolkit-lib at 1.28.0).
  • Template aws-cdk devDep bump (2.1100.12.1126.0) and the matching snapshot update are aligned.

Non-blocking observation (not for this PR): the structural ^2.248.0 caret on aws-cdk-lib in src/assets/cdk/package.json plus no committed lockfile in the template means the same writer/reader skew will recur the next time AWS bumps the assembly schema. Worth tracking separately (e.g. tighter pin in the template, ship a lockfile, or wire Dependabot to keep @aws-cdk/toolkit-lib rolling), but doesn't need to gate this fix.

@github-actions github-actions Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Jun 5, 2026
Copy link
Copy Markdown
Contributor

@jariy17 jariy17 left a comment

Choose a reason for hiding this comment

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

Verified the upgrading cloud assembly schema doesn't introduce breaking changes to the cli.

@jariy17 jariy17 merged commit c42c5b4 into main Jun 5, 2026
30 checks passed
@jariy17 jariy17 deleted the fix/cdk-toolkit-lib-schema54 branch June 5, 2026 19:16
jariy17 added a commit that referenced this pull request Jun 5, 2026
…ifests

PR #1465 fixed the synth-time reader (@aws-cdk/toolkit-lib 1.16 -> 1.28)
but the asset-publish phase uses a separate package, @aws-cdk/cdk-assets-lib,
that was still pinned to 1.4.2 in the shrinkwrap. 1.4.2's
@aws-cdk/cloud-assembly-schema floor is >=53.8.0 — it cannot read schema 54
asset manifests written by aws-cdk-lib@2.258.0+.

Symptom: e2e (main, 6/6) failed after the rerun of #1465 with
"Cannot read asset manifest 'cdk.out/...assets.json':
Cloud assembly schema version mismatch: Maximum schema version supported
is 53.x.x, but found 54.0.0" on byo-custom-jwt deploy. (Dataset tests passed
because dataset stacks have no file/zip/docker assets.)

Adding @aws-cdk/cdk-assets-lib as a direct dependency at ^1.4.10 forces the
shrinkwrap to resolve the asset-publisher reader to a version whose
cloud-assembly-schema floor is >=54.2.0. toolkit-lib's wide ^1 transitive
range was insufficient to upgrade past 1.4.2 during the previous regen.

Verified locally: end-to-end agentcore deploy of a BYO Strands agent against
aws-cdk-lib@2.258.0 (writes schema 54) now succeeds — synth, asset publish,
CFN deploy all pass.
jariy17 added a commit that referenced this pull request Jun 5, 2026
…ifests (#1468)

PR #1465 fixed the synth-time reader (@aws-cdk/toolkit-lib 1.16 -> 1.28)
but the asset-publish phase uses a separate package, @aws-cdk/cdk-assets-lib,
that was still pinned to 1.4.2 in the shrinkwrap. 1.4.2's
@aws-cdk/cloud-assembly-schema floor is >=53.8.0 — it cannot read schema 54
asset manifests written by aws-cdk-lib@2.258.0+.

Symptom: e2e (main, 6/6) failed after the rerun of #1465 with
"Cannot read asset manifest 'cdk.out/...assets.json':
Cloud assembly schema version mismatch: Maximum schema version supported
is 53.x.x, but found 54.0.0" on byo-custom-jwt deploy. (Dataset tests passed
because dataset stacks have no file/zip/docker assets.)

Adding @aws-cdk/cdk-assets-lib as a direct dependency at ^1.4.10 forces the
shrinkwrap to resolve the asset-publisher reader to a version whose
cloud-assembly-schema floor is >=54.2.0. toolkit-lib's wide ^1 transitive
range was insufficient to upgrade past 1.4.2 during the previous regen.

Verified locally: end-to-end agentcore deploy of a BYO Strands agent against
aws-cdk-lib@2.258.0 (writes schema 54) now succeeds — synth, asset publish,
CFN deploy all pass.
jariy17 added a commit that referenced this pull request Jun 5, 2026
…solution (#1469)

PRs #1465 and #1468 fixed the bundled CLI's readers (toolkit-lib + cdk-assets-lib)
to handle schema 54. Customer deploys via the global CLI install work correctly.

However, the e2e test `byo-custom-jwt.test.ts` uses `runLocalCLI`, which spawns
`node dist/cli/index.mjs` from the workspace root. From there, Node's module
resolution sees the workspace's own `aws-cdk-lib: ^2.248.0` (resolved to 2.257.0)
which has a peer-dep `cloud-assembly-schema: ^53.25.0`, hoisting schema 53.28.0
at the top level. `@aws-cdk/cloud-assembly-api` (also hoisted) binds to that
top-level schema rather than the nested 54.2.0 copies under toolkit-lib and
cdk-assets-lib — so synth still throws AssemblyVersionMismatch in CI.

Bumping aws-cdk-lib from ^2.248.0 to ^2.258.0 makes its peer-dep
`cloud-assembly-schema: ^54.0.0`, allowing schema 54.2.0 to hoist top-level
and cloud-assembly-api to bind to it.

Verified: byo-custom-jwt deploy assertion now passes locally against
aws-cdk-lib@2.258.0 (writes schema 54). End-user CLI behavior is unchanged
(global install resolution was already correct after #1465/#1468).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants