fix(deploy): select the auto-detected target so a fresh project's first deploy isn't scoped to zero stacks#1753
Merged
Conversation
…st deploy isn't scoped to zero stacks Fixes #1752
jesseturner21
temporarily deployed
to
e2e-testing
July 13, 2026 18:39 — with
GitHub Actions
Inactive
Contributor
|
Claude Security Review: no high-confidence findings. (run) |
Contributor
Package TarballHow to installgh release download pr-1753-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.24.0.tgz |
Contributor
Coverage Report
|
tejaskash
approved these changes
Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The very first interactive
agentcore deployon a freshly created project failed with:Root cause: regression from the #1267 fix (#1659). The TUI deploy flow scopes its stack selector to the target picker's selection (
PATTERN_MUST_MATCHoverselectedTargets), and deliberately treats an empty selection as "deploy nothing" so the deploy-everything bug can't re-latent.A fresh project has an empty
aws-targets.json, souseAwsTargetConfigtakes the auto-detect path: it detects the AWS account/region and saves adefaulttarget — but unlike the single-pre-configured-target and multi-target-picker paths, it never populatedselectedTargetIndices.DeployScreenthen passedselectedTargets = []into the deploy flow, producing a pattern selector with zero patterns, and toolkit-lib threwNoStacksMatched. Second deploys worked (the target file was populated by then), so every first deploy of a new project was broken.Fix:
saveTarget()now also registers and selects the just-saved target, mirroring the existing single-target path:Related Issue
Closes #1752
Documentation PR
N/A — bug fix, no doc changes needed.
Type of Change
Testing
How have you tested the change?
npm run test:unitandnpm run test:integnpm run typechecknpm run lintsrc/assets/, I rannpm run test:update-snapshotsand committed the updated snapshotsAdditional verification:
npm run bundle, installed it fresh, ranagentcore create --name clitest→agentcore deploy(interactive) — failed with the exact error above.src/cli/tui/hooks/__tests__/useAwsTargetConfig.test.tsxcovering all three configuration paths (fresh-project auto-detect, lone pre-configured target, multi-target picker). The auto-detect case fails on the unfixed code and passes with the fix.CREATE_COMPLETE, harnessREADY, deployed state persisted). Test stack cleaned up afterwards.Checklist