fix(project): show the live progress list for project add on a TTY - #2247
fix(project): show the live progress list for project add on a TTY#2247aidandaly24 wants to merge 2 commits into
Conversation
`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.
|
Claude Security Review: no high-confidence findings. (run) |
There was a problem hiding this comment.
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
runWithProgresstreatsinteractive: undefinedas "fall back toio.stderr.isTTY", so the non-JSON branch correctly restores the live task list. JsonKeyis a global flag with.default(false), soctx.require(JsonKey)is guaranteed to return a boolean.- Since
addProjectResourceis used by everyproject addsub-resource (memory, runtime, harness, gateway, evaluator, etc.), the fix applies uniformly. - Tests exercise real IO via
testIO({ isTTY })andTestCoreClient— 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.
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
…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.
|
Claude Security Review: no high-confidence findings. (run) |
Description
agentcore project add <resource>now renders the same live progress list asproject create,build, anddeploywhen run in a terminal: a spinner on the running step, a scrolling tail of its output (for exampleuv syncduringadd 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 calledrunWithProgresswithinteractive: 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--jsononly, the value every other project mutation already passes.Behavior for
project add:--jsonTaskList: 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:
TaskListandSpinnernow wrap the glyph in<Box flexShrink={0}>. The title still wraps beneath itself. The same glitch showed inproject createat 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
--jsonand non-TTY callers is unchanged.Type of Change
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--jsonasserts 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 theflexShrinkchange on every platform.Manual checks against a scaffolded project:
Pseudo-TTY (
scriptwithstty cols 200):add memoryshows both steps ✓;add runtimeshows the spinner with theuv synctail under the running step, then all four steps ✓.60-column terminal via the TUI harness:
add runtimekeeps every ✓ with the long paths wrapping beneath their titles.Non-TTY and
--jsonoutput is byte-identical to before.bun test(3181 pass, 0 fail)I ran
bun run typecheckI ran
bun run lint:checkandbun run format:checkIf I modified
src/assets/, I rannpm run test:update-snapshotsand committed the updated snapshots (not applicable)Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.