Problem
When running agentcore deploy in interactive TUI mode, the screen appears frozen for several seconds between the preflight checks completing and the "Publish assets" step starting. All preflight steps show SUCCESS checkmarks, but no step is highlighted/running — the user thinks the CLI is hung.
Root Cause
In useDeployFlow.ts (lines 360–383), after preflight completes and before the deploy begins, the flow runs cdkToolkitWrapper.diff() to capture pre-deploy differences. During this diff:
- All preflight steps are
success ✓
publishAssetsStep is still pending (not yet running)
- No step has
status: 'running'
- The
StepProgress component has nothing to highlight — screen appears frozen
The diff can take several seconds (synthesizing and comparing stacks). Only after it completes does setPublishAssetsStep({ status: 'running' }) execute at line 385.
// Line 360-385 — the silent gap
const run = async () => {
// This diff runs with NO progress indication in the TUI
if (!isDiffRunningRef.current) {
isDiffRunningRef.current = true;
setIsDiffLoading(true);
// ... runs diff silently ...
await cdkToolkitWrapper.diff(); // <-- user sees nothing during this
// ... cleanup ...
}
// Only NOW does the first deploy step become visible
setPublishAssetsStep(prev => ({ ...prev, status: 'running' })); // line 385
};
Reproduction
- Create any AgentCore project with resources
- Run
agentcore deploy (interactive TUI)
- Watch the preflight steps complete (validate, build, synthesize, etc.)
- After the last preflight step shows ✓, the screen freezes for 5-15 seconds
- Then "Publish assets" starts running
Suggested Fix
Set "Publish assets" to running before the diff, or add a "Computing changes..." step:
// Option A: Start publish step immediately, run diff in parallel
setPublishAssetsStep(prev => ({ ...prev, status: 'running' }));
await cdkToolkitWrapper.diff(); // runs during "Publish assets" phase
// Option B: Add a visible diff step
setDiffStep(prev => ({ ...prev, status: 'running' }));
await cdkToolkitWrapper.diff();
setDiffStep(prev => ({ ...prev, status: 'success' }));
setPublishAssetsStep(prev => ({ ...prev, status: 'running' }));
Affected Files
src/cli/tui/screens/deploy/useDeployFlow.ts (lines 360–385)
Problem
When running
agentcore deployin interactive TUI mode, the screen appears frozen for several seconds between the preflight checks completing and the "Publish assets" step starting. All preflight steps show SUCCESS checkmarks, but no step is highlighted/running — the user thinks the CLI is hung.Root Cause
In
useDeployFlow.ts(lines 360–383), after preflight completes and before the deploy begins, the flow runscdkToolkitWrapper.diff()to capture pre-deploy differences. During this diff:success✓publishAssetsStepis stillpending(not yetrunning)status: 'running'StepProgresscomponent has nothing to highlight — screen appears frozenThe diff can take several seconds (synthesizing and comparing stacks). Only after it completes does
setPublishAssetsStep({ status: 'running' })execute at line 385.Reproduction
agentcore deploy(interactive TUI)Suggested Fix
Set "Publish assets" to
runningbefore the diff, or add a "Computing changes..." step:Affected Files
src/cli/tui/screens/deploy/useDeployFlow.ts(lines 360–385)