Skip to content

feat(compat): load v0 projects and delegate deployment - #2575

Merged
notgitika merged 8 commits into
aws:refactorfrom
notgitika:feat/v0-project-compatibility
Oct 13, 2026
Merged

notgitika merged 8 commits into
aws:refactorfrom
notgitika:feat/v0-project-compatibility

Conversation

@notgitika

@notgitika notgitika commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds compatibility mode for projects created by AgentCore CLI v0.31.1.

When v1 finds agentcore/agentcore.json with "version": 1, it validates the project with a frozen copy of the v0.31.1 schemas and translates it into the current in-memory model without modifying project files.

The translated model keeps the v1 CLI and TUI available for dev, invoke, status, logs, and traces. Deployment is the exception: both direct agentcore deploy and the deploy step nested inside harness agentcore dev run the pinned v0.31.1 deploy command from the project root. That preserves the complete v0 CDK application, prompts, validation, output, and exit code instead of wrapping the old project in v1 deployment logic.

add, remove, build, and export are blocked for v0 projects. Users can inspect and run the old project safely now, then use the separate migration workflow when it is available.

Most of the diff is frozen v0 schemas and validation fixtures; the detection, translation, gating, and deploy handoff are comparatively small.

Testing done on a v0 project with v1 CLI:

  1. blocked commands

testingcompatproj/agentcore master !? aws fable
❯ agentcore build
Error: 'build' isn't available for v0 projects because v0 did not expose a standalone build command. Run `agentcore migrate` to use the v1 build command.

testingcompatproj/agentcore master !? aws fable
❯ agentcore add runtime
Error: This project uses the v0 format (agentcore.json version 1). The v1 CLI cannot add or remove resources in it. Migrate the project to v1 in order to add/remove its resources.

testingcompatproj/agentcore master !? aws fable
❯ agentcore add
Error: This project uses the v0 format (agentcore.json version 1). The v1 CLI cannot add or remove resources in it. Migrate the project to v1 in order to add/remove its resources.

testingcompatproj/agentcore master !? aws fable
❯ agentcore export harness --name myharness --json
Error: 'export harness' isn't available for v0 projects yet. Use the v0 CLI for now: npx @aws/agentcore@0 export harness …


  1. dev command (runtime) ran agentcore dev in my project and this in the other terminal:
agentcore invoke \
  --runtime example \
  --local \
  --port 8080 \
  --payload `{"prompt":"hello"}'
image image

dev inspector mode

image
  1. deploy ing
image
  1. invoking deployed runtime:
image
  1. status
image
  1. agentcore logs runtime
 agentcore logs runtime --name MyAgent --target default --since 5m
2026-10-13T16:10:34.250Z  2026-10-13 16:10:34,250 WARNING [opentelemetry.instrumentation.logging] [__init__.py:231] [trace_id=0 span_id=0 resource.service.name=testingcompatproj_MyAgent.DEFAULT trace_sampled=False] - Skipping installation of LoggingHandler from `opentelemetry-instrumentation-logging` to avoid duplicate logs. The SDK's deprecated LoggingHandler is already active (OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true). To migrate, unset this environment variable. The SDK's handler will be removed in a future release.

Follow-ups:

Related Issue

Implements the compatibility execution model from the reviewed CLI v0-to-v1 proposal.

Documentation PR

Not applicable yet. Migration documentation will land with the migration workflow.

Type of Change

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

Testing

  • bun test — 4,003 passed
  • bun run typecheck
  • bun run lint:check
  • bun run format:check
  • bun run build
  • bun run secrets:check
  • Built-CLI smoke test delegates v0 deployment and blocks v0 build
  • src/assets/ was not modified

bun audit currently reports the repository's existing transitive braces@3.0.3 advisory. This PR does not change dependencies or bun.lock.

Checklist

  • I have read the CONTRIBUTING document
  • I added tests for detection, validation, translation, deploy delegation, aliases, project-root execution, blocked commands, and exit-code propagation
  • No public documentation example is needed in this PR
  • My changes generate no new warnings

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/xl PR size: XL label Oct 12, 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 Oct 12, 2026

@agentcore-devx-automation agentcore-devx-automation Bot 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.

AgentCore Harness Review

Verdict: Looks good

Nice slice. The read-only compatibility path is well-scoped: v0 detection is a tiny pure function, translateV0Spec is pure (verified by a test) and uses structuredClone, write operations are uniformly gated via assertV1Project, and aws-targets.json is dispatched to the right schema based on project.legacy. Tests use real temp directories and the vendored schemas are properly isolated from lint/prettier and documented as byte-identical to upstream.

A few small things I noticed but don't think block merging:

  • FsProjectManager.resolve now reads agentcore.json up to three times for a v0 project (v1 parse → header probe → v0 parse in loadLegacyProject). Harmless given file size, but if you want to tighten this, loadLegacyProject could accept the already-read raw object or you could parse the raw JSON once and dispatch.
  • In translate.ts, mcpRuntimeTools && { toolRuntimes: ... } treats [] as truthy, so an empty mcpRuntimeTools array becomes toolRuntimes: [] rather than being omitted. The dedicated test asserts omission only for the undefined case; if you want "no mcpRuntimeTools ⇒ no toolRuntimes" to also cover the empty-array case, switch to mcpRuntimeTools !== undefined (or mcpRuntimeTools?.length). Minor since downstream v1 code should treat the two identically.
  • The assertV1Project message hard-codes command strings like "remove all" and "export harness". Worth a quick confirmation that npx @aws/agentcore@0 remove all … and npx @aws/agentcore@0 export harness … are the exact invocations v0 users should type; otherwise the guidance will send people down the wrong path.

Nothing here needs changes before merging.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Oct 12, 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 Oct 12, 2026
@codecov-commenter

codecov-commenter commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.32%. Comparing base (8f38d29) to head (270aa63).
⚠️ Report is 2 commits behind head on refactor.

Additional details and impacted files
@@             Coverage Diff              @@
##           refactor    #2575      +/-   ##
============================================
- Coverage     97.50%   96.32%   -1.19%     
============================================
  Files           641      670      +29     
  Lines         47480    51173    +3693     
============================================
+ Hits          46297    49291    +2994     
- Misses         1183     1882     +699     

☔ 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.

@notgitika
notgitika force-pushed the feat/v0-project-compatibility branch from fb80c6a to e716259 Compare October 12, 2026 19:26
@github-actions github-actions Bot added size/xl PR size: XL and removed size/xl PR size: XL labels Oct 12, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Oct 12, 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 Oct 12, 2026
@github-actions github-actions Bot added size/xl PR size: XL and removed size/xl PR size: XL labels Oct 13, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Oct 13, 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 Oct 13, 2026
@github-actions github-actions Bot added size/xl PR size: XL and removed size/xl PR size: XL labels Oct 13, 2026
gitikavj added 4 commits October 13, 2026 03:13
A frozen copy of aws/agentcore-cli@v0.31.1 src/schema reads unmigrated v0
projects, so anything v0 accepted is still accepted. Lint and Prettier skip
it to keep it diffable against upstream. The schema-audit fixtures cover the
edge cases v0 accepts and v1 doesn't.
projectFormat tells v0 specs (version 1) from v1 ones, and translateV0Spec maps
a parsed v0 spec onto v1's shape: version 2, v0-only collections moved aside,
mcpRuntimeTools renamed to toolRuntimes, artifact renamed to build, and
capacityProviderVolume mounts dropped.
@notgitika
notgitika force-pushed the feat/v0-project-compatibility branch from 5ea4962 to 96e9ee3 Compare October 13, 2026 03:21
@github-actions github-actions Bot added size/xl PR size: XL and removed size/xl PR size: XL labels Oct 13, 2026
@notgitika notgitika changed the title feat(compat): delegate v0 project workflows to v0 CLI feat(compat): load v0 projects and delegate deployment Oct 13, 2026
@github-actions github-actions Bot added size/xl PR size: XL and removed size/xl PR size: XL labels Oct 13, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress and removed agentcore-harness-reviewing AgentCore Harness review in progress labels Oct 13, 2026
@github-actions github-actions Bot added size/xl PR size: XL and removed size/xl PR size: XL labels Oct 13, 2026
@notgitika

Copy link
Copy Markdown
Contributor Author

right now, if a user inputs a deprecated command, it shows the generic error:

 agentcore validate
Error: unknown command 'validate' for 'agentcore'. Available commands: create, dev, deploy, invoke, status, logs, traces, add, remove, export, build, migrate, harness, runtime, gateway, identity, memory, eval, payment, feedback, config, update

we could add guidance to the user to use other commands or guide them to AWS docs as a follow up

jariy17
jariy17 previously approved these changes Oct 13, 2026

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

We need to refactor this code a little by shifting legacy loose functions into the Project MAnager.


return {
spec,
extras: { abTests, datasets, capacityProviders, unassignedTargets } as LegacyExtras,

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.

First, abTests and unassignedTargets have been deprecated for a while. Let's just drop them. Also, what the is the goal of extras?

export type ProjectFormat = "v0" | "v1";

/** v0 CLIs write `version: 1`; anything else is validated as a v1 spec. */
export function projectFormat(raw: unknown): ProjectFormat {

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.

lets shift this into projectManager.

import type { Project } from "../../../handlers/project/types";

/** Guard operations whose implementation rewrites files using the v1 project shape. */
export function assertV1Project(project: Project, command: string): void {

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.

Follow Up: We should probably combine these loose functions into the ProjectManager if we can.

Comment on lines +33 to +35
env: {
...process.env,
AGENTCORE_SKIP_CONFLICT_CHECK: "1",

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 v0 deploy handoff drops --region. For example, agentcore deploy --region eu-west-1 --yes with AWS_REGION=us-east-1 still passes us-east-1 to the child. When no deployment targets exist, v0 uses that region to create the default target, so the first deployment can go to the wrong region. Existing targets use their saved region. Can we forward the resolved region to the child process and add a regression test for first deployment?

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

Few comments here.

@@ -0,0 +1,40 @@
import { runInheritedProcess, type InheritedProcessRunner } from "../../../io";

export const V0_CLI_VERSION = "0.31.1";

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.

Lets pin this to @0 so we're not stuck upgrading this pin.

@@ -0,0 +1,29 @@
import { readdirSync, readFileSync } from "node:fs";

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.

This looks like a test related file. Can we call it xxx.test.ts

@@ -0,0 +1,23 @@
import { ProjectStateError } from "../../../errors";

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.

Can we inject this as middleware somehow?

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.

can be done as a follow up?

@github-actions github-actions Bot added size/xl PR size: XL and removed size/xl PR size: XL labels Oct 13, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Oct 13, 2026
@notgitika

Copy link
Copy Markdown
Contributor Author

all comments will be addressed in a follow up

@notgitika
notgitika merged commit c901a82 into aws:refactor Oct 13, 2026
19 checks passed
@notgitika
notgitika deleted the feat/v0-project-compatibility branch October 13, 2026 17:49
@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 Oct 13, 2026
notgitika pushed a commit to notgitika/agentcore-cli that referenced this pull request Oct 13, 2026
aws#2575 and aws#2577

agentcore migrate replaces the preview and apply subcommands, following
the Terraform apply model: it checks the project and prints the plan, then
applies it. Applying lands next, so for now it prints the plan, says
applying isn't available yet, and exits 0 when the plan is ready and 1
when it isn't.

With aws#2575 merged, agentcore deploy deploys a v0 project with the v0 CLI,
so the steps the plan suggests use it instead of npx @aws/agentcore@0.
With aws#2577 merged, hyphenated target names are valid in v1, so they no
longer block a migration.
notgitika pushed a commit to notgitika/agentcore-cli that referenced this pull request Oct 13, 2026
aws#2575 and aws#2577

agentcore migrate replaces the preview and apply subcommands, following
the Terraform apply model: it checks the project and prints the plan, then
applies it. Applying lands next, so for now it prints the plan, says
applying isn't available yet, and exits 0 when the plan is ready and 1
when it isn't.

With aws#2575 merged, agentcore deploy deploys a v0 project with the v0 CLI,
so the steps the plan suggests use it instead of npx @aws/agentcore@0.
With aws#2577 merged, hyphenated target names are valid in v1, so they no
longer block a migration.
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.

4 participants