Skip to content

fix(unit-only): see the_fix field (#1610)#58

Draft
aidandaly24 wants to merge 1 commit into
mainfrom
fix/1610
Draft

fix(unit-only): see the_fix field (#1610)#58
aidandaly24 wants to merge 1 commit into
mainfrom
fix/1610

Conversation

@aidandaly24

Copy link
Copy Markdown
Owner

Refs aws#1610

Issues

  • agentcore deploy gets stuck when stack goes into ROLLBACK_FAILED aws/agentcore-cli#1610 — During a agentcore deploy (bare TUI path, isInteractive:false) where CloudFormation enters ROLLBACK_IN_PROGRESS and then the terminal ROLLBACK_FAILED state, the TUI keeps showing the frozen "Deploying to AWS" banner with a static/bouncing progress bar for minutes, giving the impression that the deploy has hung. It is not a permanent hang: once CFN reaches the terminal ROLLBACK_FAILED state, toolkit-lib throws, the CLI catches it, marks the step errored, and exits. The user just gets no feedback that a rollback is happening, then the screen looks stuck until the (possibly long) rollback completes/fails.

Root cause

see root_cause field

The fix

see the_fix field

Files touched: src/cli/tui/components/DeployStatus.tsx (ResourceStatus union ~60-69, parseResourceMessage regex ~104-108, getStatusColor ~79-84, banner label ~195); src/cli/cdk/toolkit-lib/types.ts (DEPLOY_MESSAGE_CODES / extractProgressFromMessage ~64-86 if rollback events need richer surfacing); src/cli/tui/screens/deploy/useDeployFlow.ts (onMessage handler ~761-776 to detect first rollback event and set a notice). No change needed in node_modules toolkit-lib (its stack-status.js already classifies ROLLBACK_FAILED correctly) or the error/exit chain (useDeployFlow.ts:881-912, DeployScreen.tsx:183-187 already work).

Validation evidence

The fix was verified by reproducing the original symptom and re-running after the change:

BEFORE (fix reverted to main source in src/cli/tui/components/DeployStatus.tsx, new test kept): rollback test FAILED. Rendered frame for I5502 ROLLBACK events was the bare banner only — received frame literally: '╭──...──╮ / │ Deploying to AWS │ / ╰──...──╯' with NO 'ROLLBACK_IN_PROGRESS' text. ROLLBACK_* events were parsed to null and dropped, leaving the box frozen on the in-progress banner during rollback. AssertionError: expected '╭──...' to contain 'ROLLBACK_IN_PROGRESS'. This is the exact reported hang symptom. AFTER (fix restored): same test PASSES — frame contains 'ROLLBACK_IN_PROGRESS', 'UPDATE_ROLLBACK_IN_PROGRESS', and 'ROLLBACK_FAILED' resource lines, so the box visibly updates during rollback. Full DeployStatus.test.tsx: 20/20 pass. Diff surgical: only DeployStatus.tsx (added 6 ROLLBACK statuses to ResourceStatus union + prepended them longest-match-first to the status regex so UPDATE_ROLLBACK_* matches before ROLLBACK_*) and its test. Rollback lines reuse the unchanged ResourceLine->getStatusColor suffix logic (_FAILED->red, _IN_PROGRESS->cyan, _COMPLETE->green), so color-coding works with no color-specific change.

Test suite: green.


Staged on the fork as a draft for human review. Promote to aws/agentcore-cli after vetting.

@github-actions github-actions Bot added the size/s PR size: S label Jun 25, 2026
@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 37.16% 13593 / 36577
🔵 Statements 36.43% 14452 / 39667
🔵 Functions 31.8% 2333 / 7336
🔵 Branches 31.1% 9000 / 28932
Generated in workflow #112 for commit 7e97f90 by the Vitest Coverage Report Action

@github-actions github-actions Bot added agentcore-harness-reviewing AgentCore Harness review in progress and removed agentcore-harness-reviewing AgentCore Harness review in progress labels Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant