[rush-cli-client] Add agent output mode and honor useRushReporter on the daemon path - #6082
Merged
Merged
Conversation
…the daemon path Fixes #6076 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… agent mode only when no reporter is chosen Addresses review: --reporter=ai (with or without --no-daemon, and on fallback) and RUSH_REPORTER=ai keep the native AI reporter JSON; agent mode writes nothing ahead of native reporter output. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Agent summaries can miscount operations, omit relevant failure diagnostics, and skip output for supported argument forms.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 5
Open (6)
Count ABORTED operations as terminal results · New Retain stderr tails for failed operations · New Emit final summary when daemon startup fails · New Normalize legacy reporter detection consistently · New Parse admission controls before deriving command name · New Avoid rerendering unchanged queue positions · New
What changed in this PR
Adds agent-oriented daemon output while preserving native reporter routing.
Changes:
- Adds compact agent progress rendering and output selection.
- Honors
useRushReporterthrough native routing. - Adds tests and documentation for routing and rendering.
| File | Description |
|---|---|
common/changes/@rushstack/rush-cli-client/agent-reporter_2026-09-24-02-35.json |
Records the patch change. |
apps/rush-cli-client/src/AgentProgressRenderer.ts |
Implements agent progress output. |
apps/rush-cli-client/src/outputSelection.ts |
Selects output mode and reads reporter opt-in. |
apps/rush-cli-client/src/start.ts |
Starts early agent rendering. |
apps/rush-cli-client/src/launchClient.ts |
Integrates rendering with daemon execution. |
apps/rush-cli-client/src/routing.ts |
Routes reporter-enabled repositories natively. |
apps/rush-cli-client/src/test/AgentProgressRenderer.test.ts |
Tests agent rendering. |
apps/rush-cli-client/src/test/outputSelection.test.ts |
Tests output selection. |
apps/rush-cli-client/src/test/routing.test.ts |
Tests native reporter routing. |
apps/rush-cli-client/README.md |
Documents output modes and precedence. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…re tails, final line on rejection, admission-control command name, normalized RUSH_REPORTER, queue dedup Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Mo Jazayeri (mojaza)
approved these changes
Sep 24, 2026
Sean Larkin (TheLarkInn)
deleted the
thelarkinn-rushd-agent-reporter
branch
September 24, 2026 21:17
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
Adds an opt-in agent output mode to
rush-clienton the daemon path. You turn it on withRUSHD_OUTPUT=agent, or it switches on automatically when theCOPILOT_CLIagent marker is set. The client also no longer silently ignores theexperiments.jsonuseRushReportersetting. Without either of these, output is unchanged. Explicit reporter controls (--reporter,--output,--log-level,RUSH_REPORTER,RUSH_LOG_LEVEL) are routed to the native reporter path exactly as before.Root cause
quietverbosity hid progress, the queue position only showed on a TTY, and a no-op printed no summary.useRushReporter: true(board bug 45) was never read by the client. Repositories that opted into the native reporter silently got legacy daemon output instead.Fix
AgentProgressRenderer.ts(new; based on A04's prototype; no heavy imports). It prints:The output is plain text, not the AI reporter's JSON records.
outputSelection.ts(new):legacy, so agent mode writes nothing ahead of native reporter output. These are requests with explicit reporter controls,--no-daemon, oruseRushReporter.RUSHD_OUTPUT=agent|legacy, thenCOPILOT_CLI, thenlegacy.COPILOT_CLIis the same marker thatdetectAgent()in@rushstack/reporterchecks. I dropped the prototype'sCLAUDECODEmarker for that reason; other agents can setRUSHD_OUTPUT=agent.rush.jsonand readuseRushReporterbefore rush-lib is loaded.routing.ts: a repository withuseRushReporteris routed to the native in-process reporter (fix for bug 45). Reporter-flag routing is unchanged from main.launchClient.ts: passes the renderer through and subscribes atnormalverbosity in agent mode. It always wires the queue position, and calls finish or dispose on every exit path.start.ts: prints the first line, then loadslaunchClientlazily. The change stays local, to limit conflicts with [rush] rush-cli-client: routing and feedback gaps (non-build commands auto-start the daemon, 0-column TTY hard-fails, no queue or startup feedback for non-TTY clients) #6052, [rush] rush-cli-client: every invocation loads all of @microsoft/rush-lib (~600 ms) before connecting to the daemon #6054 and [rush] rush-client-core: a failed or slow daemon startup leaves a durable .starting reservation that wedges the workspace (every command waits ~16 s, daemon start refuses); an invalid RUSH_* env value triggers it and hides the real error #6050.README: documents the output modes, the order in which they are chosen, and the native routing for explicit reporters and
useRushReporter.Review follow-up (A04, board #313/#333)
The first revision sent
--reporter=aito agent mode. That caused three regressions:--reporter=ai --no-daemonprinted legacy output;--reporter=aiwas dropped when the client fell back in-process;--reporter=aiproduced plain text instead of AI JSON records.Fix: an explicit reporter keeps its pre-PR native routing, and agent mode is chosen only when no reporter was requested. On Linux, all three cases now print native
ai.statusandai.finalJSON with nothing in front of it.Tests
outputSelection:--reporter=aiwith and without--no-daemon,--output,RUSH_REPORTER=ai,RUSH_LOG_LEVEL) always getlegacy;useRushReportergetslegacy;--are ignored;experiments.json(including commented-out settings) and findingrush.jsonfrom a nested folder.--reporter=ai,--reporter ai,--reporter=ai --no-daemonandRUSH_REPORTER=aiall go native;useRushReportertrue/false; the argv reaches the native path unchanged; rushx ignoresuseRushReporter.Linux validation (WSL Ubuntu-24.04, Node 22)
rush build --to @rushstack/rush-cli-client(including lint) andrush test --only @rushstack/rush-cli-clientpass.Scenario runs used a synthetic 12-project workspace (
mkws-synth), stdout piped, all in onelabinvocation:rush-clientRUSHD_OUTPUT=agent"First output" is the time to first output.
--to p01SUCCESS 1/1 operations (1 from cache) in 4.4sSUCCESS 12/12 operations (12 no op) in 1.0sSUCCESS 12/12 operations (11 skipped, 1 success) in 1.5sFAILURE 12/12 ... failed: p05 (build)+error TS2322 ...Line counts for
legacymatchbefore, so the default output is unchanged.Explicit reporter runs after the review fix:
build --reporter=ai(daemon enabled)ai.status+ai.finalJSON, 2 linesbuild --reporter=ai --no-daemonai.status+ai.finalJSON, 2 linesbuild --reporter=ai, daemon unavailable (in-process fallback)ai.status+ai.finalJSON, 2 linesRUSH_REPORTER=ai buildRUSHD_OUTPUT=agent, daemon unavailableQueued note: in this workspace, a queued request that follows a source edit fails in every mode with
The successor requested another restart; the single safe retry was exhausted. That problem exists without this PR and is out of scope here. With agent mode, the queue notice now appears at 0.7 s instead of nothing on the pipe for 8 s.CI note: the first Windows run failed in
rush-cli-clientdaemonLogs.test.ts, on the log-file "replace" case, with a 5 s jest timeout on Node 26. That test callsprintDaemonLogAsyncdirectly and does not load any file this PR changes, and it passed on Node 24 Windows in the same run. The same run also failedrush-reporterPerformance.test.ts, which is in a package this PR doesn't touch. Both look like Windows flakes, and main has similar Windows failures.Follow-ups (optional)
useRushReporterrepositories can use the daemon.rush.jsonfor detection.rushx-client.Fixes #6076
Came out of the automated rushd Linux analysis (Rushd Hive; board threads 45, 72, 184, 187, 313, 333; prototype by A04).