feat(cli): add loading spinner for argue run and argue act - #61
Merged
Merged
Conversation
The act command had no output between dispatch and awaitResult, leaving users unsure whether anything was running. The run command had event prints but the gaps between RoundDispatched and the first response could still feel silent on slow agents. Add a Braille spinner (⣾⣽⣻⢿⡿⣟⣯⣷) wired into: - runAction: spins from dispatch until awaitResult settles - runHeadless: spins between *Dispatched events and the next event, tracking still-waiting participants in a per-round set so the label updates as agents come back Spinner writes to stderr so it never pollutes act's stdout output. Non-TTY falls back to a single breadcrumb line; NO_COLOR disables ANSI. Also remove timer.unref() in two places: - spinner.setInterval: keeps the event loop alive while spinning so the animation actually renders instead of getting cut off after one frame - delegate.withTimeout: combined with mock provider's unref'd setTimeout it was causing "Detected unsettled top-level await" exits in act runs against the mock provider. clearTimeout is called on both settle paths so keeping the timer ref'd is safe. Closes #60
Owner
Author
Contributor
🤖 Argue 研判结果
Representative
Summary共识结论:PR #61 主体实现方向正确,CI 与相关测试支持合并方向;但不建议直接 approve,应 request small changes,先修 All claims
Report
|
…rror - parseActOptions now accepts --no-color and forwards noColor to the spinner so the act command honors the flag, matching the PR claim. - runAction's catch path now stops the spinner before printing the error so the line is not interleaved with an in-flight frame or written under a hidden cursor. - Help text updated to list --no-color under argue act.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #60. Fixes the "is it even running?" silence in
argue actand thesimilar quiet gaps between rounds in
argue runby adding a Braillespinner
⣾⣽⣻⢿⡿⣟⣯⣷to stderr.argue act: spins fromdispatchuntilawaitResultsettles, sothe long opaque wait now shows visible progress.
argue run: the output formatter now owns a spinner. After each*Dispatchedevent it starts; eachParticipantResponded/ParticipantEliminatedremoves that id from a per-round waiting setand either restarts with the updated label or stays idle until the
next event. Stops on
RoundCompleted/ReportCompleted/ActionCompleted/ActionFailedand inrunCompleted/runFailed.argue act's stdout (the action response)stays clean for piping. Non-TTY → one breadcrumb line, no animation.
NO_COLORand--no-colorare honored.Side fix: unref'd timers
While testing against the mock provider I hit
Warning: Detected unsettled top-level awaitplus spinner stuck on thefirst frame. Two
timer.unref()calls combined with the mock's ownunref'd
setTimeoutleft the event loop with zero ref'd handles, so itexited before the awaited promise could settle. Removed:
spinner.tssetInterval — keeping it ref'd means the animationactually renders for the full wait
runtime/delegate.tswithTimeoutsetTimeout —clearTimeoutruns onboth settle paths so this is safe; the previous unref masked the issue
only when real network sockets were holding the event loop open
Test plan
npm run format:check,npm run lint,npm run checknpm run ci(argue 52 + cli 217 + viewer 78 = 347 tests pass)fallback, idempotent start/stop, color toggle,
setLabel,isActive)RoundDispatched→ label updates →RoundCompletedstops;ActionDispatched→ActionCompletedstops)rotates through full waits, clears cleanly, stdout output unaffected