Skip to content

fix(project): show the live progress list for project add on a TTY - #2247

Open
aidandaly24 wants to merge 2 commits into
aws:refactorfrom
aidandaly24:fix/project-add-spinners
Open

fix(project): show the live progress list for project add on a TTY#2247
aidandaly24 wants to merge 2 commits into
aws:refactorfrom
aidandaly24:fix/project-add-spinners

Conversation

@aidandaly24

@aidandaly24 aidandaly24 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Description

agentcore project add <resource> now renders the same live progress list as project create, build, and deploy when run in a terminal: a spinner on the running step, a scrolling tail of its output (for example uv sync during add runtime), and a ✓ on each completed step.

Screen.Recording.2026-09-08.at.12.27.19.PM.mov

Every add sub-command runs its generator through the shared helper in src/handlers/project/add/shared.ts. Since #2218 that helper called runWithProgress with interactive: false, which forces the plain line-per-step path even on a TTY. The comment there preserved the pre-#2218 behavior, where each add handler wrote its own plain lines and never used the progress driver. This change gates the plain path on --json only, the value every other project mutation already passes.

Behavior for project add:

Situation Before After
Interactive terminal plain lines spinner task list, ✓ per step
Piped or CI (no TTY) plain lines plain lines, unchanged
--json plain lines plain lines, unchanged

TaskList: keep the glyph when a step title is wider than the terminal

The new TTY test surfaced a pre-existing rendering bug on the Windows runner. Ink boxes shrink by default, so when a step title is wider than the row (a long path with no break opportunity, such as a Windows temp path), the one-column ✓/✕ glyph and spinner frame were squeezed to zero width and disappeared:

before (80 columns):
 Reading project spec file at 'C:\Users\ContainerAdministrator\AppData\Local\Temp
\agentcore-memory-aX9hjo\TestProject\agentcore\agentcore.json'

after:
✓ Reading project spec file at 'C:\Users\ContainerAdministrator\AppData\Local\Te
 mp\agentcore-memory-aX9hjo\TestProject\agentcore\agentcore.json'

TaskList and Spinner now wrap the glyph in <Box flexShrink={0}>. The title still wraps beneath itself. The same glitch showed in project create at exactly the terminal width, so this fixes it there too.

Related Issue

No upstream issue; reported internally as "agentcore project add missing nice spinners".

Documentation PR

N/A. Output shape for --json and non-TTY callers is unchanged.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

New tests:

  • src/handlers/project/add/memory/index.test.ts: a TTY run asserts the rendered frames contain ✓ Reading project spec file, ✓ Updating project spec file, and the success line, with nothing on stdout. A TTY run with --json asserts no escape sequences reach stderr and the mutation result lands on stdout.
  • src/components/ui/task-list/TaskList.test.tsx: at 40 columns, a title wider than the row keeps the ✓ on a done task and the spinner frame on a running task. Fails without the flexShrink change on every platform.

Manual checks against a scaffolded project:

  • Pseudo-TTY (script with stty cols 200): add memory shows both steps ✓; add runtime shows the spinner with the uv sync tail under the running step, then all four steps ✓.

  • 60-column terminal via the TUI harness: add runtime keeps every ✓ with the long paths wrapping beneath their titles.

  • Non-TTY and --json output is byte-identical to before.

  • bun test (3181 pass, 0 fail)

  • I ran bun run typecheck

  • I ran bun run lint:check and bun run format:check

  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots (not applicable)

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly (no docs change needed)
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

`project add` drove its generator through runWithProgress with
`interactive: false`, so every sub-resource printed plain step lines even
on a TTY while create, build, and deploy rendered the Ink task list with a
spinner. Gate the plain path on --json only, matching the other project
mutations, and cover both the TTY frames and the ANSI-free --json output.
@github-actions github-actions Bot added the size/s PR size: S label Sep 8, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress claude-security-reviewing Claude Code /security-review in progress labels Sep 8, 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 Sep 8, 2026

@agentcore-devx-automation agentcore-devx-automation Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AgentCore Harness Review

Verdict: Looks good

Small, focused bug fix. addProjectResource now gates the plain progress path on --json only, letting runWithProgress's TTY detection do its job — matching the exact pattern already used in project create, build, and deploy (interactive: ctx.require(JsonKey) ? false : undefined).

Verified:

  • The shared driver runWithProgress treats interactive: undefined as "fall back to io.stderr.isTTY", so the non-JSON branch correctly restores the live task list.
  • JsonKey is a global flag with .default(false), so ctx.require(JsonKey) is guaranteed to return a boolean.
  • Since addProjectResource is used by every project add sub-resource (memory, runtime, harness, gateway, evaluator, etc.), the fix applies uniformly.
  • Tests exercise real IO via testIO({ isTTY }) and TestCoreClient — no new mocks introduced — and cover both the TTY frame path and the --json-on-a-TTY ANSI-free path.
  • No telemetry gap: this is a rendering bug fix, not a new feature.

Nothing blocking. LGTM.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Sep 8, 2026
@codecov-commenter

codecov-commenter commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.04%. Comparing base (d9ab959) to head (942bbf6).
⚠️ Report is 1 commits behind head on refactor.

Additional details and impacted files
@@            Coverage Diff            @@
##           refactor    #2247   +/-   ##
=========================================
  Coverage     97.04%   97.04%           
=========================================
  Files           566      566           
  Lines         39409    39414    +5     
=========================================
+ Hits          38244    38249    +5     
  Misses         1165     1165           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added size/s PR size: S and removed size/s PR size: S labels Sep 8, 2026
…minal

Ink boxes shrink by default, so a step title wider than the row (a long
path with no break opportunity, such as a Windows temp path) squeezed the
one-column ✓/✕ glyph and spinner frame to zero width and it vanished. Pin
both columns with flexShrink={0}; the title still wraps beneath itself.

Surfaced by the new project add TTY test on the Windows CI runner, where
the temp path exceeds Ink's 80-column test width. The same glitch showed
in `project create` at exactly the terminal width.
@github-actions github-actions Bot added size/s PR size: S and removed size/s PR size: S labels Sep 8, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Sep 8, 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 Sep 8, 2026
@github-actions github-actions Bot added size/s PR size: S and removed size/s PR size: S labels Sep 8, 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.

4 participants