refactor(review): multi-agent picker, orchestrator, and live TUI (1/2)#1111
Open
peyton-alt wants to merge 2 commits intofeat/entire-review-v2-a3from
Open
refactor(review): multi-agent picker, orchestrator, and live TUI (1/2)#1111peyton-alt wants to merge 2 commits intofeat/entire-review-v2-a3from
peyton-alt wants to merge 2 commits intofeat/entire-review-v2-a3from
Conversation
7 tasks
Contributor
Author
|
@BugBot review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit b423db9. Configure here.
… PR-B)
CU8 adds the multi-agent path: when 2+ launchable agents are configured
and no --agent override is given, prompt the user to multi-select agents
and optionally collect a per-run prompt, then run them concurrently.
- review/multipicker.go: PickAgents() shows a huh multi-select pre-
checking all eligible agents, then a per-run prompt textarea. Sorts
eligible alphabetically for stable order. Returns ErrPickerCancelled
or ErrNoAgentsSelected on the corresponding user actions.
- review/run_multi.go: RunMulti() runs N reviewers concurrently. Each
agent runs in its own goroutine; events from N goroutines fan in to
a single dispatch loop that calls every sink serially (preserves the
serial-dispatch contract from CU4 even under concurrent emission).
Cancellation propagates through ctx. Aggregates per-agent runs into
a populated RunSummary; sinks always get RunFinished.
- review/picker.go: computeLaunchableEligible filters s.Review to
agents with hooks installed AND ReviewerFor != nil.
- review/cmd.go: dispatch fork. When --agent is empty and 2+ launchable
agents are eligible, route through PickAgents + RunMulti via
runMultiAgentPath. perAgentConfiguredReviewer adapter injects per-agent
skills/prompt into RunConfig at Start time. runSingleAgentPath and
detectScope extracted to keep runReview under the maintidx threshold.
handlePickerError maps ErrPickerCancelled to nil (silent exit) and
ErrNoAgentsSelected to a user-facing error.
CU9 will add a TUI sink to render the multi-agent dashboard; until then,
multi-agent runs use DumpSink (the same as single-agent), so users see a
per-agent narrative dump after the run completes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
11df159 to
cdb69ef
Compare
b423db9 to
97a72a1
Compare
CU9 introduces TUISink, a Sink implementation that renders a per-agent
status dashboard during multi-agent review runs. Composed alongside
DumpSink in TTY mode; non-TTY multi-agent runs continue to use DumpSink
alone.
- review/tui_sink.go: TUISink wraps a Bubble Tea program. AgentEvent
translates each Event into a tea.Msg and sends it via Program.Send.
RunFinished signals the model to render a final dashboard frame and
waits for the user to dismiss with any key.
- review/tui_model.go: reviewTUIModel handles agentEventMsg / tickMsg
/ WindowSizeMsg / KeyMsg. Per-row run-start timestamps stamped on
first event from each agent (regression-prevented: PR #1018 used a
single TUI-start timestamp that inflated late-starting agents'
durations). Single cancel function: KeyCtrlC and out-of-TUI SIGINT
both call the same context.CancelFunc, gated by sync.Once.
- review/tui_detail.go: alt-screen drill-in. Ctrl+O enters; left/right
cycles agents; up/down scrolls; Esc returns. detailView pads to
termHeight so every frame returns the same line count (avoids ghost
rows in the alt-screen frame diff). ANSI/CSI sequences stripped per
line. Rune-safe truncation via stringutil.TruncateRunes.
Wires dispatch in cmd.go's runMultiAgentPath: TTY mode composes
[TUISink, DumpSink] (TUI for live dashboard, DumpSink for post-run
narrative); non-TTY composes [DumpSink] alone. tea.WithoutSignalHandler
keeps SIGINT routing on the cobra root's existing handler so the
single-cancel contract holds even when the TUI captures KeyCtrlC.
Anti-features explicitly NOT recreated:
- sync.Once-guarded onCancel + parallel signal.Notify goroutine: replaced
by a single shared context.CancelFunc gated by one sync.Once on the model
- cancelMsg dead-code type: omitted entirely
- byte-slice truncation: stringutil.TruncateRunes throughout
- single TUI-start timestamp: per-row runStart stamped on first event
- missing alt-screen on drill-in: tea.EnterAltScreen on Ctrl+O
- variable-line-count detail render: detailView pads to termHeight
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
97a72a1 to
ac94870
Compare
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.

First of two stacked meta-PRs that build the new multi-agent review on top of the PR-A redesign foundation. Stacked on #1107 (A3) — when A3 merges, this PR auto-retargets to its merge target.
The full redesign behind #993/#1018 is split across 5 stacked PRs:
When all five merge, the work targeted by #1018 ships as part of the redesign on
feat/entire-review(#993). #1018 itself becomes obsolete and can be closed.What's in this PR
RunMultiN-agent orchestrator. Each goroutine streams events into a single dispatch loop so theSinkserial-dispatch contract is preserved without per-sink synchronization.perAgentConfiguredRevieweradapter injects per-agent skills/prompt despiteRunMulti's shared-config API.Ctrl+Oenters drill-in mode on the alt screen showing the full event buffer;Escreturns.Ctrl+Ccancels through the sharedCancelFunc.tea.WithoutSignalHandlerkeeps cobra's SIGINT routing intact. After all agents finish, the user dismisses with any key —RunFinishedblocks on dismissal so the post-runDumpSinknarrative renders below the TUI rather than overlapping it.Smoke tests
.entire/settings.json(e.g.claude-code+codex)entire review— multi-select picker appears with the per-run prompt fieldCtrl+Oto drill into a specific agent's event buffer;EscreturnsCtrl+Cmid-run — all agents cancel cleanly, TUI exitsentire review --agent claude-code— single-agent path, no multi-pickerentire review > out.txt) — no TUI, just narrative dumpmise run check— lint clean, tests green🤖 Generated with Claude Code
Note
Medium Risk
Adds a new multi-agent execution path with concurrency, new UI flows, and new sink/orchestration logic; main risk is race/cancellation edge cases and altered CLI routing, though changes are well-covered by tests.
Overview
entire reviewnow forks between single-agent and multi-agent execution: when 2+ launchable eligible agents are configured and--agentis not provided, it prompts with a new multi-select picker (plus optional per-run prompt) and runs all selected agents concurrently.Introduces
RunMulti, a multi-reviewer orchestrator that fans N agent event streams into a single serial dispatch loop to preserve the existingSinkcontract, aggregates per-agent results intoRunSummary, and returns the first non-cancellation error.Adds a new Bubble Tea
TUISinkused in TTY multi-agent runs to show a live dashboard (status/duration/tokens/preview) with a drill-in detail view; non-TTY runs continue to useDumpSink. Tests were expanded substantially to cover dispatch routing, picker error sentinels, orchestrator behavior (ordering/serial dispatch/cancellation), and TUI rendering/controls.Reviewed by Cursor Bugbot for commit b423db9. Configure here.