Skip to content

Deploy TUI appears frozen between preflight and publish assets (silent diff phase) #781

@jariy17

Description

@jariy17

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:

  1. All preflight steps are success
  2. publishAssetsStep is still pending (not yet running)
  3. No step has status: 'running'
  4. 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

  1. Create any AgentCore project with resources
  2. Run agentcore deploy (interactive TUI)
  3. Watch the preflight steps complete (validate, build, synthesize, etc.)
  4. After the last preflight step shows ✓, the screen freezes for 5-15 seconds
  5. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions