fix(dev): skip redundant deploy when TUI deploy already succeeded#1395
Merged
Conversation
The TUI deploy flow (useDeployFlow) wrote deployed state but never stored the deployHash. When `agentcore dev` subsequently called canSkipDeploy, the stored hash was undefined — causing it to always redeploy even with no changes. Constraint: computeProjectDeployHash must use the same ConfigIO as the deploy flow Rejected: Move hash storage into buildDeployedState | would change the shared utility's contract and require all callers to pass configIO Confidence: high Scope-risk: narrow
Contributor
|
Claude Security Review: no high-confidence findings. (run) |
Contributor
Package TarballHow to installgh release download pr-1395-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.15.0.tgz |
Contributor
Coverage Report
|
agentcore-cli-automation
approved these changes
May 27, 2026
agentcore-cli-automation
left a comment
There was a problem hiding this comment.
Reviewed the fix end-to-end against the existing actions.ts (CLI -y) path and the canSkipDeploy/computeProjectDeployHash implementations.
The change is small, focused, and correct:
- The deployHash is computed and assigned to
targetState.resources.deployHashbeforewriteDeployedState(line 349), mirroring the behavior insrc/cli/commands/deploy/actions.ts(lines 551–584). - All subsequent post-deploy
writeDeployedStatecalls inuseDeployFlow.ts(lines 368, 448, 507, 538, 579) use the read-modify-write pattern against the on-disk state, so they preserve thedeployHashwritten at line 349. buildDeployedStaterebuildstargetState.resourcesfresh and does not carry forwarddeployHashfromexistingState, so the explicit assignment afterbuildDeployedStateis necessary and correct.- The try/catch making hash computation best-effort matches the existing pattern in
actions.ts. canSkipDeployis gated onprojectSpec.runtimes.length === 0, so this only takes effect for harness-only projects, which is what the bug report describes.
Two non-blocking observations (not requesting changes):
useDeployFlow.tsstill has no unit/integration test file, so this fix isn't covered by an automated test. The new logic is small and structurally identical to the testedactions.tspath, so I don't think a test is required to land this — butuseDeployFlowis getting large and is now silently relied on by the dev-deploy skip behavior. Worth considering follow-up coverage.- Minor stylistic difference vs.
actions.ts: there, the hash is computed beforebuildDeployedState; here it's computed after. Functionally equivalent (buildDeployedStatedoesn't touch any of the hashed files), so not worth changing.
LGTM.
avi-alpert
approved these changes
May 28, 2026
jariy17
approved these changes
May 28, 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.
Summary
agentcore deploy), runningagentcore devwould always redeploy even with no changesuseDeployFlow.ts) wrote deployed state but never stored thedeployHash. Whenagentcore devcalledcanSkipDeploy, the stored hash wasundefined, so the hash comparison always failed.deployHashin the TUI deploy flow afterbuildDeployedState, matching the existing behavior inhandleDeploy(used by the CLI-ypath)Test plan
npm run buildpassesagentcore deploy(TUI) →agentcore dev→ verify "No changes detected — skipping deploy" message appearsagentcore deploy(TUI) → modifyharness.json→agentcore dev→ verify deploy triggers