From ac693a1baf8e13ac1312d0b81e87a40a400eea27 Mon Sep 17 00:00:00 2001 From: Jesse Turner Date: Wed, 27 May 2026 14:19:44 -0400 Subject: [PATCH] fix(dev): skip redundant deploy when TUI deploy already succeeded MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/cli/tui/screens/deploy/useDeployFlow.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/cli/tui/screens/deploy/useDeployFlow.ts b/src/cli/tui/screens/deploy/useDeployFlow.ts index 8b0295744..21bf95696 100644 --- a/src/cli/tui/screens/deploy/useDeployFlow.ts +++ b/src/cli/tui/screens/deploy/useDeployFlow.ts @@ -16,6 +16,7 @@ import { DEFAULT_DEPLOY_ATTRS, computeDeployAttrs } from '../../../commands/depl import { getErrorMessage, isChangesetInProgressError, isExpiredTokenError } from '../../../errors'; import { ExecLogger } from '../../../logging'; import { performStackTeardown, setupTransactionSearch } from '../../../operations/deploy'; +import { computeProjectDeployHash } from '../../../operations/deploy/change-detection'; import { getGatewayTargetStatuses } from '../../../operations/deploy/gateway-status'; import { deleteOrphanedABTests, setupABTests } from '../../../operations/deploy/post-deploy-ab-tests'; import { @@ -334,6 +335,17 @@ export function useDeployFlow(options: DeployFlowOptions = {}): DeployFlowState policies, datasets, }); + + try { + const deployHash = await computeProjectDeployHash(configIO); + const targetState = deployedState.targets[target.name]; + if (targetState?.resources) { + targetState.resources.deployHash = deployHash; + } + } catch { + // hash computation is best-effort + } + await configIO.writeDeployedState(deployedState); // Post-deploy: Sync dataset examples from local JSONL to service DRAFT.