Skip to content

fix: dont show deploy screen when deploy is skipped#1585

Merged
avi-alpert merged 1 commit into
aws:mainfrom
avi-alpert:aalpert/fix-dev-bugs
Jun 19, 2026
Merged

fix: dont show deploy screen when deploy is skipped#1585
avi-alpert merged 1 commit into
aws:mainfrom
avi-alpert:aalpert/fix-dev-bugs

Conversation

@avi-alpert

@avi-alpert avi-alpert commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Problems

  1. agentcore dev --skip-deploy still shows "Deploying project resources..." TUI — The --skip-deploy flag was passed to the deploy hook, which skipped the actual deploy but still rendered the deploy screen for a frame before resolving.

  2. agentcore dev on an already-deployed harness project briefly flashes the TUI — Browser mode always entered the alt-screen TUI (launchTuiDevScreenWithPicker) even when there was nothing to deploy, causing a visible terminal flicker before the browser opened.

  3. Mixed projects (agent + harness) auto-deployed on agentcore dev — The launchBrowserDev() path (TUI → dev) unconditionally called runCliDeploy() whenever harnesses existed, regardless of whether the project also had agents.

  4. Terminal harness chooser appeared in browser mode — When a project had multiple agents or harnesses, the terminal selection list appeared even in browser mode (default agentcore dev), where the web UI should handle selection.

  5. Multi-harness projects only supported single-harness auto-deploy — The harness-only branch in DevScreen required exactly 1 harness (harnesses.length === 1), so projects with 2+ harnesses fell through to the chooser without deploying.

Solutions

  1. Check isDeploySkippable() before entering deploy mode — Both command.tsx (browser mode) and DevScreen.tsx (terminal mode) now call isDeploySkippable() before setting mode = 'deploying'. If the flag is set or no CDK changes exist, deploy UI is never rendered.

  2. Gate TUI entry on whether deploy is actually needed — In command.tsx, the preview browser path now checks isDeploySkippable() first. Only when deploy is genuinely needed does it enter launchTuiDevScreenWithPicker. Otherwise it goes straight to runBrowserMode() — no alt-screen, no flicker.

  3. Only auto-deploy for harness-only projectslaunchBrowserDev() now checks hasHarnesses && !hasRuntimes before deploying. Mixed projects skip deploy entirely and let the web UI handle everything.

  4. Browser mode skips the terminal chooser for all project types — The onLaunchBrowser auto-launch condition is widened from agents.length === 1 to agents.length > 0. Multi-agent and mixed projects immediately launch the browser, passing no pre-selection so the web UI shows the picker.

  5. Harness-only branch handles any number of harnesses — Changed from harnesses.length === 1 && agents.length === 0 to harnesses.length > 0 && agents.length === 0. Single-harness is pre-selected; multi-harness defers selection to post-deploy (terminal chooser or web UI).

Shared utility: isDeploySkippable()

Extracted to src/cli/operations/deploy/change-detection.ts. Bundles the repeated pattern of new ConfigIO()ensureDefaultDeploymentTarget()canSkipDeploy(). Used by:

  • command.tsx — gates whether to enter the TUI at all (browser mode)
  • DevScreen.tsx — gates whether to show deploy UI (terminal mode)
  • browser-mode.ts — gates whether launchBrowserDev() (TUI → dev) runs deploy

Before / After

Browser mode (agentcore dev) on deployed harness project (no changes)

Before: Alt-screen enters → "Deploying project resources..." flashes → resolves instantly → exits → browser opens

After: Browser opens immediately. No terminal flicker.

agentcore dev --skip-deploy on harness project

Before: Alt-screen enters → "Deploying project resources..." appears for one frame → skips → exits → browser opens

After: Browser opens immediately. No deploy UI rendered at all.

agentcore dev on mixed project (agent + harness)

Before: TUI chooser appears in terminal, user must select before browser opens. If harness selected, deploy runs.

After: Browser opens immediately with no chooser. Web UI shows both agent and harness options. No auto-deploy.

agentcore dev --no-browser on multi-harness project (needs deploy)

Before: Chooser appeared immediately (user had to pick before deploy started, only single-harness was supported)

After: Deploy runs first (for all harnesses), then chooser appears so user can pick which to invoke.

Test Plan

  • One agent project: agentcore dev opens browser immediately, no flash
  • Mixed project: agentcore dev opens browser, no deploy, no chooser
  • Deployed harness: agentcore dev opens browser, no flash, no "Deploying" UI
  • Fresh harness (first deploy): agentcore dev shows deploy progress, then opens browser
  • --skip-deploy on any harness project: no deploy UI ever rendered
  • --no-browser on multi-harness: deploys first, then shows terminal chooser
  • TUI → dev on mixed project: no auto-deploy

@avi-alpert avi-alpert requested a review from a team June 18, 2026 16:55
@github-actions github-actions Bot added the size/m PR size: M label Jun 18, 2026
@github-actions github-actions Bot added the agentcore-harness-reviewing AgentCore Harness review in progress label Jun 18, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Jun 18, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Jun 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Package Tarball

aws-agentcore-0.20.1.tgz

How to install

gh release download pr-1585-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.20.1.tgz

@avi-alpert avi-alpert changed the title fix: dont show deploy screen when deploy is skipped fix(dev): deploy gating, chooser visibility, and multi-harness support Jun 18, 2026
@avi-alpert avi-alpert changed the title fix(dev): deploy gating, chooser visibility, and multi-harness support fix: dont show deploy screen when deploy is skipped Jun 18, 2026

@agentcore-cli-automation agentcore-cli-automation left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup — eliminating the alt-screen flash for harness-only projects with no pending changes is a real UX win. Two issues worth addressing before merging, plus a note about test coverage.

otelEnvVars,
collector,
}),
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Behavior change: harness pre-selection is lost on the new fast path.

For a harness-only project with a single harness and an up-to-date deploy, the previous flow rendered DevScreen, which set selectedHarness = harnesses[0] and called onLaunchBrowser({ harnessName }), so runBrowserMode was invoked with harnessName: harnesses[0] and the web UI opened with that harness pre-selected.

This new branch (needsTuiDeploy === false) bypasses the TUI entirely and calls runBrowserMode with no harnessName and agentName: opts.runtime (which is undefined for harness-only projects). End result: the user lands in the web UI without anything pre-selected, even though we know exactly which harness they want.

This also affects --skip-deploy for harness-only projects, which now follows this same fast path.

Two ways to fix:

  1. Resolve the harness name here in command.tsx before calling runBrowserMode (mirror DevScreen's logic: when isHarnessOnly && project.harnesses?.length === 1, pass harnessName: project.harnesses[0].name).
  2. Keep the gate but plumb the resolution through — e.g., still compute pickerResult-like selection here so both branches converge on the same runBrowserMode call.

Option 1 is the smaller change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed. web ui auto-selects the first option in dropdown if nothing is supplied

} catch {
return false;
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isDeploySkippable() constructs a fresh new ConfigIO() with no arguments, which auto-discovers from process.cwd(). The two new callers (command.tsx and DevScreen.tsx) both already have a workingDir in scope, and DevScreen in particular receives it as a prop that may not equal cwd.

In practice these are usually the same, but it's a footgun for any future caller and means this helper silently ignores the workingDir that DevScreen was explicitly given. Suggest taking an optional baseDir (or configIO) parameter and threading workingDir through from the call sites. The existing canSkipDeploy(configIO) signature is a good model.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had initially passed in workingDir but it didnt work because config lives in agentcore folder, so ConfigIO wasnt able to find config in the project root. calling new ConfigIO() with no arguments is fine since the cdk package calls findConfigRoot

} catch {
return false;
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing test coverage. No tests were added for isDeploySkippable or for the two new branching paths in command.tsx / DevScreen.tsx. Given that this is a fix for buggy UX behavior and the surrounding logic is non-trivial (multiple skipDeploy sources, harness-only vs mixed projects, browser vs terminal mode), please add at least:

  • Unit tests for isDeploySkippable covering the happy path, the ensureDefaultDeploymentTarget failure path, and the canSkipDeploy error path (all should fall through to false).
  • A test that exercises the DevScreen harness-only branch when skipDeploy=true vs when changes are detected, since that branch is the last line of defense for the terminal mode.

@github-actions github-actions Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Jun 18, 2026
@avi-alpert avi-alpert merged commit 692103c into aws:main Jun 19, 2026
36 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants