Skip to content

feat(project): sync vended CDK dependencies on build and deploy - #2861

Merged
jariy17 merged 8 commits into
v1.xfrom
feat/sync-vended-cdk-dependencies
Nov 20, 2026
Merged

jariy17 merged 8 commits into
v1.xfrom
feat/sync-vended-cdk-dependencies

Conversation

@jariy17

@jariy17 jariy17 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Description

agentcore create is the only place that writes agentcore/cdk/package.json, so a v1 project keeps the @aws/agentcore-cdk it was created with across CLI upgrades. When a newer CLI writes a field to agentcore.json that the project's older library does not know, the library's schema drops it at synth and the deploy succeeds without it. For example, a project created with CLI 1.1.0 that later runs agentcore add runtime --platform-version V2 (#2827) deploys the runtime on V1 with no error.

v0 solved this in #1777. This PR ports that behavior to v1.

Before synth, agentcore build and agentcore deploy (command line and TUI) now compare agentcore/cdk/package.json with the package.json this CLI vends:

  • Every dependency the vended package.json names is managed. It is rewritten to the vended specifier: exact for @aws/agentcore-cdk, tilde for the rest. Caret ranges from older projects are migrated, and a managed dependency the user deleted is restored.
  • Dependencies the user added are left untouched. The parsed manifest is edited in place, so key order and unknown fields survive.
  • When anything changed, npm install --no-audit --no-fund runs in agentcore/cdk, as migrate does. If it fails, the original package.json is restored so the next run plans the same changes and retries; if the restore itself fails, that is reported as a warning.
  • A missing agentcore/cdk/node_modules (for example after create --skip-install) is installed with npm install even when the pins already match, before any AWS call on deploy. A failed install raises an error that names the directory and includes npm's output. With disableDependencyManagement set, the existing "Run 'npm install'" error is kept.
  • A managed pin newer than this CLI fails the build or deploy instead of being downgraded. A newer patch on a tilde range is not treated as newer. The message depends on which pin it is:
    • @aws/agentcore-cdk: agentcore/cdk/package.json declares @aws/agentcore-cdk 1.2.0, newer than this AgentCore CLI supports (1.1.0). Run 'agentcore update', then try again.
    • Any other managed dependency: the message names it, lists every CDK dependency the CLI manages (read from the vended package.json), and says to set it back or run agentcore config disableDependencyManagement true.
    • If both happen, the L3 message comes first.
  • Specifiers that are not versions (file:, git:, tags) are never rewritten and produce a warning, so a local tarball under test keeps working.
  • A deploy of a project that declares nothing (declaresNothingDeployable, the same check the deploy handler uses to ask about a teardown, now in src/core/project/spec.ts), which removes the stack, downgrades every sync failure to a warning so it is never blocked.
  • agentcore config disableDependencyManagement true turns the sync off. A newer pin then only warns. The key name matches v0, so a v0 user's existing opt-out carries over.

Deviations from #1777:

  • A project without agentcore/cdk/package.json is left alone; synth reports that on its own.
  • v1 deploy has no --dry-run/--diff, so there is no check-only mode.
  • No new telemetry attributes.

MINIMUM_COMPATIBLE_CDK_VERSION stays. It reads the installed library after the sync, so it still covers opted-out projects and non-version specifiers.

Related Issue

None. No issue was filed for this change.

Documentation PR

Not applicable. The behavior reports itself on each build or deploy through the updating CDK dependencies: <name> <old> -> <new> step and the warnings above.

Type of Change

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

Testing

How have you tested the change?

  • I ran bun test (4934 pass, 6 skip, 0 fail)
  • I ran the relevant end-to-end tests with bun run test:e2e, or explained why they are not applicable
    (CI does not run them for you). The e2e suite was not run. The upgrade path was verified by hand against a real account, as below.
  • I ran bun run typecheck
  • I ran bun run lint:check
  • I ran bun run format:check
  • I ran bun run audit
  • I ran bun run secrets:check
  • I ran bun run build
  • If I modified src/assets/, I updated affected snapshots with bun test <test-file> --update-snapshots and committed them (not applicable)
  • If I re-recorded fixtures or golden files, every change beyond account identifiers is explained
    by this PR (not applicable)
  • This PR does not change command.md (the release workflow regenerates it)

New unit tests are in src/core/project/backends/cdk/dependencies.test.ts (plan and sync) and src/core/project/backends/cdk.test.ts. The cdk.test.ts cases cover the sync running before synth, the opt-out, a teardown that is not blocked by a newer pin, and a missing node_modules installed before credentials are provisioned. manager.test.ts and project.test.ts now assert the install runs instead of the old error, and the opt-out still gets the error. The build and deploy handler and screen tests check that disableDependencyManagement from the global config reaches the backend.

Upgrade happy path, with the account ID redacted:

# 1. Project created with the published CLI 1.0.3, which vends @aws/agentcore-cdk 1.0.3
$ npx -y @aws/[email protected] create --name cdksyncdemo --template agent-python-minimal --skip-git
created project 'cdksyncdemo' in ./cdksyncdemo
$ (cd agentcore/cdk && npm install --save-exact [email protected])   # a user-added dependency

# 2. Build with this branch
$ node <branch>/dist/index.js build
updating CDK dependencies: @aws/agentcore-cdk 1.0.3 -> 1.1.0
synthesizing CloudFormation templates
built project 'cdksyncdemo'

$ diff -u package.json.before agentcore/cdk/package.json
   "dependencies": {
-    "@aws/agentcore-cdk": "1.0.3",
+    "@aws/agentcore-cdk": "1.1.0",
     "aws-cdk-lib": "~2.269.0",
     "constructs": "~10.7.0",
     "left-pad": "1.3.0"
$ grep '"version"' agentcore/cdk/node_modules/@aws/agentcore-cdk/package.json agentcore/cdk/node_modules/left-pad/package.json
node_modules/@aws/agentcore-cdk/package.json:  "version": "1.1.0",
node_modules/left-pad/package.json:  "version": "1.3.0",

# 3. Second build is a no-op (no update step, no install, lockfile untouched)
$ node <branch>/dist/index.js build
synthesizing CloudFormation templates
built project 'cdksyncdemo'

# 4. Old project with node_modules deleted: one build installs and synthesizes
$ npx -y @aws/[email protected] create --name cdksyncheal --template agent-python-minimal --skip-git
$ rm -rf agentcore/cdk/node_modules
$ node <branch>/dist/index.js build
updating CDK dependencies: @aws/agentcore-cdk 1.0.3 -> 1.1.0
synthesizing CloudFormation templates
built project 'cdksyncheal'
$ rm -rf agentcore/cdk/node_modules && node <branch>/dist/index.js build   # pins already match
installing CDK dependencies (node_modules missing)
synthesizing CloudFormation templates
built project 'cdksyncheal'
$ agentcore config disableDependencyManagement true; rm -rf agentcore/cdk/node_modules
$ node <branch>/dist/index.js build
Error: CDK dependencies are missing for project 'cdksyncheal'. Run 'npm install' in <project>/agentcore/cdk.

# 5. Real deploy and teardown (us-east-1)
$ node <branch>/dist/index.js deploy --region us-east-1 --yes
deploying AgentCore-cdksyncdemo-default (usually takes a few minutes)
deployed project 'cdksyncdemo' to target 'default'
$ node <branch>/dist/index.js status --json   # runtime "agent": deploymentState "deployed"
$ node <branch>/dist/index.js remove all --yes && node <branch>/dist/index.js deploy --region us-east-1 --yes
removing stack AgentCore-cdksyncdemo-default
removed project 'cdksyncdemo' from target 'default'

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.

@github-actions github-actions Bot added the size/l PR size: L label Nov 19, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress claude-security-reviewing Claude Code /security-review in progress labels Nov 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Package Tarball

aws-agentcore-1.1.0.tgz

How to install

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

@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 Nov 19, 2026
@codecov-commenter

codecov-commenter commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.11504% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.57%. Comparing base (941a6b1) to head (476ace7).
⚠️ Report is 2 commits behind head on v1.x.

Files with missing lines Patch % Lines
src/core/project/backends/cdk/dependencies.ts 98.54% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             v1.x    #2861      +/-   ##
==========================================
+ Coverage   96.55%   96.57%   +0.02%     
==========================================
  Files         732      734       +2     
  Lines       60548    60950     +402     
==========================================
+ Hits        58462    58863     +401     
- Misses       2086     2087       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Nov 19, 2026
@github-actions github-actions Bot added size/l PR size: L and removed size/l PR size: L labels Nov 19, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Nov 19, 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 Nov 19, 2026
@github-actions github-actions Bot added size/l PR size: L and removed size/l PR size: L labels Nov 19, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Nov 19, 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 Nov 19, 2026
@github-actions github-actions Bot added size/l PR size: L and removed size/l PR size: L labels Nov 19, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Nov 19, 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 Nov 19, 2026
@github-actions github-actions Bot removed the size/l PR size: L label Nov 20, 2026
@github-actions github-actions Bot added the size/l PR size: L label Nov 20, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Nov 20, 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 Nov 20, 2026
@jariy17
jariy17 marked this pull request as ready for review November 20, 2026 19:11
@jariy17
jariy17 requested a review from a team November 20, 2026 19:11

@tejaskash tejaskash 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.

The sync decides from package.json and never looks at what is installed, so the stale-library case this PR sets out to fix still happens after a teammate commits the rewritten manifest. That one and the teardown write failure need fixing before merge. The rest are smaller and inline.

Not tied to a line:

  • Missing tests: manifest matches but the installed library is older, the opt-out with a newer pin, the skipped-specifier warning from syncCdkDependencies, a malformed package.json, and unknown top-level fields surviving the rewrite.
  • Build and deploy now rewrite agentcore/cdk/package.json and need network access. The opt-out is only discoverable from one error message. A short paragraph under "Extending the CDK app" in the README would cover it.
  • AGENTS.md asks for a linked issue and the PR has none.

jariy17 added 8 commits November 20, 2026 19:55
agentcore create is the only writer of agentcore/cdk/package.json, so a
project kept the @aws/agentcore-cdk it was created with across CLI
upgrades. Fields a newer CLI writes to agentcore.json that the old
library does not know were dropped at synth without an error.

Before synth, build and deploy now rewrite every dependency the vended
package.json names to the specifier this CLI vends and run npm install,
leaving dependencies the user added alone. A pin newer than this CLI
fails with an upgrade hint, non-version specifiers are skipped with a
warning, and a failed install restores package.json. A deploy that
removes the stack only warns. Opt out with
'agentcore config disableDependencyManagement true'.

Ports the v0 behavior from #1777.
When agentcore/cdk/node_modules is missing, build and deploy now run npm
install in agentcore/cdk before synth (and before any AWS mutation on
deploy), even when the pins already match, instead of failing with
"Run 'npm install'". A failed install raises a ProjectStateError that
names the directory and carries npm's error; a teardown only warns.
With disableDependencyManagement set, the existing error is kept.
…aded

A newer @aws/agentcore-cdk now points at 'agentcore update'. A newer
toolchain pin lists every CDK dependency the CLI manages, read from the
vended package.json, and says to set it back or opt out with
disableDependencyManagement. Blocking behavior is unchanged.
…dency sync

Move declaresNothingDeployable to src/core/project/spec.ts so the CDK
backend uses it to decide whether a dependency problem only warns, in
place of its own inline check. Warn when package.json cannot be
restored after a failed install, run npm install with --no-audit
--no-fund as migrate does, correct the writers named in the sync's doc
comment, and stop exporting types nothing else uses. Add tests that the
build and deploy handlers and screens pass disableDependencyManagement
to the backend.
parseSpecifier returns the base version and isNewer takes whether the
vended pin is exact, since only that distinction was ever read.
BuildBackendInput duplicated BuildProjectInput and is removed. The build
and deploy handler tests seed the global config with applyOverrides.
Address review feedback on the CDK dependency sync:

- Install when the installed @aws/agentcore-cdk is missing or does not
  satisfy the declared pin, so a pulled manifest or an interrupted
  install no longer leaves a stale library. The restore-on-failure path
  is gone and npm's ProcessFailedError propagates unwrapped.
- Leave a tilde or caret pin alone when major.minor match and its patch
  is at or above the vended one, so two CLI releases do not flip it.
- With dependency management disabled, skip the newer-pin warning and
  warn about an older L3 pin instead.
- Compare against the version this CLI vends, name both 'agentcore
  update' and the opt-out, give one sentence per newer pin, and show only
  the L3 pin when it is newer.
- Validate the manifest with zod through ReadWriteJson so a malformed
  shape is a ProjectStateError, share the specifier parse with
  declaredCdkDependency, and keep the file's indent and line endings.
@jariy17
jariy17 force-pushed the feat/sync-vended-cdk-dependencies branch from 747ff26 to 476ace7 Compare November 20, 2026 20:20
@github-actions github-actions Bot added size/xl PR size: XL and removed size/l PR size: L labels Nov 20, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Nov 20, 2026
@jariy17
jariy17 merged commit bde9a77 into v1.x Nov 20, 2026
21 checks passed
@jariy17
jariy17 deleted the feat/sync-vended-cdk-dependencies branch November 20, 2026 20:22
@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 Nov 20, 2026
@jariy17

jariy17 commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. For the items in the summary: I added tests for an installed library older than the manifest, the opt-out with newer and older pins, the skipped-specifier warning, a malformed package.json, and unknown top-level fields surviving a rewrite. I added a README paragraph under "Extending the CDK app" covering the sync, npm network access, and agentcore config disableDependencyManagement true. There's no tracking issue for this one.

tejaskash added a commit that referenced this pull request Nov 24, 2026
* feat(build): add ContainerLocal build mode (re-land #2814) (#2855)

Adds a ContainerLocal build type for runtimes and harnesses: images are built
locally with Docker, Finch, or Podman and published through CDK.

- --build-config <JSON> (Advanced: group) on add runtime / add harness
- agentcore build builds (does not push) ContainerLocal images from the
  synthesized assembly
- deploy rejects switching a deployed workload between Container and
  ContainerLocal; without CloudFormation read access it warns, or fails when a
  workload uses ContainerLocal
- deploy checks that the detected builder can build Linux ARM64 images and
  passes it to CDK as CDK_DOCKER
- deploy telemetry counts runtimes and harnesses by build type

Co-authored-by: gitikavj <[email protected]>

* fix(build): address ContainerLocal bug bash findings (#2856)

- K08/K09: the deploy guard rejects any change into or out of ContainerLocal
  for a deployed workload (CodeZip, Managed, Container <-> ContainerLocal).
  The service rejects artifact-type changes in place ("Agent artifact type
  cannot be updated"), so only a new workload may use ContainerLocal. A
  pre-feature (legacy) template's workload is never ContainerLocal, so it is
  rejected too. ContainerUri transitions are unchanged.
- Item 3 (#2856): the guard also rejects a deployed Runtime changing between
  CodeZip and Container, both ways. The CLI flips a CodeZip Runtime to
  Container itself when a Dockerfile appears; on a deployed Runtime that ran a
  full CodeBuild, then the service failed the update ("Agent artifact type
  cannot be updated", UPDATE_ROLLBACK_COMPLETE) and agentcore.json stayed
  flipped, so every later deploy failed the same way. A pre-feature template's
  Runtime counts as CodeZip without a ContainerConfiguration, otherwise as
  Container. The error says to add a Runtime with a new name or keep the
  deployed build. Harness Managed <-> Container is unchanged.
- A04/A06: the rejection says to keep the deployed build mode or add a
  workload with a new name, and, after a remove + re-add under the same name,
  to deploy the removal first, then add it again. The CodeZip -> Container
  auto-flip message says ContainerLocal can only be chosen when adding a
  workload.
- I21/I22: the ARM64 execution probe always runs on a non-ARM64 daemon, even
  when `buildx inspect` lists linux/arm64; native ARM64 daemons still skip it.
  The error says when the builder lists linux/arm64 but cannot run ARM64 code.
- I23: deploy chooses the builder first. When the executable is Docker and
  the active buildx builder's driver is not `docker`, the target is the
  docker-driver builder of the active Docker context (`docker context show`;
  each context has one under its own name). `default` would select the
  `default` context's builder, a different daemon on Docker Desktop, Colima,
  Rancher Desktop, or an ssh context. The buildx inspect and ARM64 probe run
  with that BUILDX_BUILDER, and the CDK operation gets the same value (set and
  restored like CDK_DOCKER). If `docker context show` fails, nothing is
  redirected and the warning says so.
- I24: a relative CDK_DOCKER (one with a path separator) resolves against the
  current directory, like --build-config paths, before the builder check and
  before it reaches CDK.
- K06: deploy warns when a ContainerLocal runtime or harness uses its own
  executionRoleArn: the role needs ecr:GetAuthorizationToken on * and
  ecr:BatchGetImage / ecr:GetDownloadUrlForLayer on
  cdk-<qualifier>-container-assets-<account>-<region>, otherwise the service
  fails at first invoke.
- A01/A02: a failed `agentcore build` image build names the build context and
  Dockerfile it uses; add says it copied the Dockerfile to
  app/<name>/Dockerfile and that later edits to the original are not used.
- A08: add runtime refuses when app/<name>/Dockerfile (or its .dockerignore)
  already exists and differs from the requested file; identical files proceed.
- A07: --build-config rejects an absolute buildContextPath; dev resolves the
  build context instead of joining it, so it never double-prefixes.
- A14: --build-config errors are reported against --build-config at parse
  time: dockerfile must be relative to buildContextPath, and the runtime and
  harness "requires a Dockerfile" rules.
- A15: --build-config help states how dockerfile resolves with and without
  buildContextPath.
- A13: the CodeBuild reserved build-arg rule (AWS_*, CODEBUILD_*, ...) no longer
  applies to ContainerLocal in the CLI schemas or --build-config; it stays for
  Container. The @aws/agentcore-cdk (L3) schema must match; that change is in
  a separate L3 PR.
- H11: a ContainerLocal harness.yaml no longer suggests networkConfig.vpcId.

Review follow-ups (#2855, #2856):

- An invalid harness.yaml fails with InputValidationError naming the file
  (z.prettifyError), not a raw ZodError.
- Harness builds are keyed by the agentcore.json entry name, as L3 keys its
  metadata, not by the name inside harness.yaml.
- Local image tags trim separators from both ends of the name, so a name
  ending in `_` gives a valid reference.
- harness.yaml: dockerfile with containerUri is reported once.
- projectRoot is required by the harness and runtime docs templates; the
  runtime "is required" guards are gone.
- The ContainerLocal capability check reports only a missing package as
  "update the dependency"; other load errors surface with their message.
- Tests: Windows-safe CDK_DOCKER paths, a missing build context in the asset
  manifest, and an invalid harness.yaml in resolveWorkloads.

I23 local evidence (x86_64, Docker 25.0.18, buildx 0.12.2; builder
multiarch-builder uses the docker-container driver; restored to default after):

  $ BUILDX_BUILDER=multiarch-builder docker build --platform linux/arm64 -t i23-c .
  WARNING: No output specified with docker-container driver. Build result will
  only remain in the build cache. ...
  $ docker image inspect i23-c
  Error response from daemon: No such image: i23-c:latest
  $ BUILDX_BUILDER=default docker build --platform linux/arm64 -t i23-d .
  #3 naming to docker.io/library/i23-d done
  $ docker image inspect i23-d --format '{{.Id}}'
  sha256:3bb32867...

This is the plain `docker build` cdk-assets runs (no --load), with the builder
selected the way docker/setup-buildx-action selects it (BUILDX_BUILDER). On
this host `docker buildx use multiarch-builder` alone did not redirect plain
`docker build` (only `docker buildx build`, which then hit the same "No such
image"), so the env var is the case that matters, and BUILDX_BUILDER=default
overrides it. This host's active Docker context is `default`, so `default` is
the context builder the deploy now selects.

Co-authored-by: gitikavj <[email protected]>

* feat(project): sync vended CDK dependencies on build and deploy (#2861)

* feat(project): sync vended CDK dependencies on build and deploy

agentcore create is the only writer of agentcore/cdk/package.json, so a
project kept the @aws/agentcore-cdk it was created with across CLI
upgrades. Fields a newer CLI writes to agentcore.json that the old
library does not know were dropped at synth without an error.

Before synth, build and deploy now rewrite every dependency the vended
package.json names to the specifier this CLI vends and run npm install,
leaving dependencies the user added alone. A pin newer than this CLI
fails with an upgrade hint, non-version specifiers are skipped with a
warning, and a failed install restores package.json. A deploy that
removes the stack only warns. Opt out with
'agentcore config disableDependencyManagement true'.

Ports the v0 behavior from #1777.

* feat(project): install CDK dependencies when node_modules is missing

When agentcore/cdk/node_modules is missing, build and deploy now run npm
install in agentcore/cdk before synth (and before any AWS mutation on
deploy), even when the pins already match, instead of failing with
"Run 'npm install'". A failed install raises a ProjectStateError that
names the directory and carries npm's error; a teardown only warns.
With disableDependencyManagement set, the existing error is kept.

* fix(project): explain that CLI-managed CDK dependencies can't be upgraded

A newer @aws/agentcore-cdk now points at 'agentcore update'. A newer
toolchain pin lists every CDK dependency the CLI manages, read from the
vended package.json, and says to set it back or opt out with
disableDependencyManagement. Blocking behavior is unchanged.

* refactor(project): reuse declaresNothingDeployable and tidy CDK dependency sync

Move declaresNothingDeployable to src/core/project/spec.ts so the CDK
backend uses it to decide whether a dependency problem only warns, in
place of its own inline check. Warn when package.json cannot be
restored after a failed install, run npm install with --no-audit
--no-fund as migrate does, correct the writers named in the sync's doc
comment, and stop exporting types nothing else uses. Add tests that the
build and deploy handlers and screens pass disableDependencyManagement
to the backend.

* refactor(project): simplify CDK dependency sync types and test setup

parseSpecifier returns the base version and isNewer takes whether the
vended pin is exact, since only that distinction was ever read.
BuildBackendInput duplicated BuildProjectInput and is removed. The build
and deploy handler tests seed the global config with applyOverrides.

* test(project): drop CDK dependency sync tests covered by the backend suite

* fix(project): decide CDK dependency installs from what is installed

Address review feedback on the CDK dependency sync:

- Install when the installed @aws/agentcore-cdk is missing or does not
  satisfy the declared pin, so a pulled manifest or an interrupted
  install no longer leaves a stale library. The restore-on-failure path
  is gone and npm's ProcessFailedError propagates unwrapped.
- Leave a tilde or caret pin alone when major.minor match and its patch
  is at or above the vended one, so two CLI releases do not flip it.
- With dependency management disabled, skip the newer-pin warning and
  warn about an older L3 pin instead.
- Compare against the version this CLI vends, name both 'agentcore
  update' and the opt-out, give one sentence per newer pin, and show only
  the L3 pin when it is newer.
- Validate the manifest with zod through ReadWriteJson so a malformed
  shape is a ProjectStateError, share the specifier parse with
  declaredCdkDependency, and keep the file's indent and line endings.

* docs(readme): explain CDK dependency management on build and deploy

---------

Co-authored-by: jariy17 <[email protected]>

* chore(release): v1.2.0 (#2881)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* ci: bump open-PR digest workflow pin to list every open PR (#2891)

Picks up aws/agentcore-devx-devtools#24, which paginates the open-PR list instead of stopping at GitHub's default first page of 30.

Co-authored-by: jariy17 <[email protected]>

* ci: run non-E2E jobs on GitHub-hosted runners (#2896)

* ci: run E2E and canaries on GitHub-hosted runners (#2901)

The agentcore-e2e CodeBuild runner can't register with GitHub (its
credential lacks runner-registration permission since 2026-11-23), so
E2E and canary jobs never start. Run them on GitHub-hosted runners until
the CodeBuild runner is fixed.

Co-authored-by: jariy17 <[email protected]>

* test: give the real Toolkit loading test 30s (#2900)

Since verify moved to GitHub-hosted runners, the cold import of
@aws-cdk/toolkit-lib in this test exceeds bun's 5s default on Windows
(5015ms), failing verify / Windows on every PR.

Co-authored-by: jariy17 <[email protected]>

---------

Co-authored-by: Gitika <[email protected]>
Co-authored-by: gitikavj <[email protected]>
Co-authored-by: Trirmadura J Ariyawansa <[email protected]>
Co-authored-by: jariy17 <[email protected]>
Co-authored-by: agentcore-devx-automation[bot] <282717993+agentcore-devx-automation[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
vvargu pushed a commit to SaiAbhishek98/agentcore-cli that referenced this pull request Nov 24, 2026
Brings in ContainerLocal builds (aws#2855, aws#2856), CDK dependency sync on build and deploy (aws#2861), the v1.2.0 release (aws#2881), and CI changes (aws#2891, aws#2896).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xl PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants