[rush-daemon] Stop --verbose / --parallelism / --timeline from reloading the warm graph - #6063
Merged
Merged
Conversation
…loading the warm graph Presentation and scheduling flags (--verbose, --parallelism, --timeline) are no longer part of the engine parameter identity, so they no longer force a tier-1 reload that discards all retained results. rushd applies quietMode/parallelism to the shared graph before each iteration and only coalesces requests with equal settings. Fixes #6048 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Fixes #6048 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new concurrent batching compatibility behavior lacks a test covering requests with different settings.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
This PR keeps Rush daemon operation graphs warm when request-scoped presentation or scheduling flags change.
Changes:
- Excludes verbosity, parallelism, timeline, and selection flags from graph identity.
- Applies request settings per iteration and restricts batching to matching settings.
- Adds identity and warm-graph integration coverage.
| File | Description |
|---|---|
libraries/rush-lib/src/index.ts |
Exports request settings type. |
libraries/rush-lib/src/cli/scriptActions/PhasedScriptAction.ts |
Separates request-scoped flags from graph identity. |
libraries/rush-lib/src/api/test/PhasedCommandEngineParameterIdentity.test.ts |
Tests identity and settings parsing. |
libraries/rush-lib/src/api/PhasedCommandEngine.ts |
Exposes parsed request settings. |
libraries/rush-daemon/src/test/WorkspaceRequestScopedParameters.test.ts |
Tests sequential warm-graph reuse. |
libraries/rush-daemon/src/ProductionDaemonRequestResolver.ts |
Propagates request settings. |
libraries/rush-daemon/src/PhasedRequestRouter.ts |
Applies settings and gates request coalescing. |
libraries/rush-daemon/src/DaemonRequestDispatcher.ts |
Passes settings to the router. |
common/reviews/api/rush-lib.api.md |
Updates rush-lib API report. |
common/reviews/api/rush-daemon.api.md |
Updates rush-daemon API report. |
common/changes/@rushstack/rush-daemon/flag-reload_2026-09-24.json |
Records daemon patch. |
common/changes/@microsoft/rush/flag-reload_2026-09-24.json |
Records Rush patch. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…gether 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-fix-rushd-flag-reload
branch
September 24, 2026 21:16
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
The Rush daemon pins its warm operation graph to the first request's non-selection parameter identity. That identity included presentation and scheduling flags such as
--verbose,-p/--parallelismand--timeline. Sobuild --verboseafter a warmbuildcaused a tier-1 reload that threw away every retained result: every operation was restored from the build cache again, and switching back to plainbuildreloaded a second time.With this change, these flags apply per request. After a warm build,
build --verbose,build -p 2andbuild --timelinekeep the same generation and run 0 operations, and the flags still take effect.Root cause
PhasedScriptAction.getEngineParameterIdentity()(rush-lib) built the identity fromactionName, the global parameters and all non-selection action parameters. That included--verbose,--parallelismand--timeline.WorkspaceRequestLifecycle(rush-daemon) treats any identity mismatch as a tier-1 reload. The reload creates a new resolver and graph with no retained results.OperationGraph.quietModeandOperationGraph.parallelismare read on every iteration, and watch mode already changes them at runtime.--timelineonly addsConsoleTimelinePlugin, which writes to a no-op presentation terminal.Fix
getEngineParameterIdentity()now excludes--verbose,--parallelismand--timeline. Graph-affecting custom parameters, global parameters and the command name remain in the identity. A newPhasedCommandEngine.requestSettingsexposes the request-scoped values asIPhasedCommandEngineRequestSettings { quietMode, parallelism }(@alpha).ProductionDaemonRequestResolverreturnsrequestSettingson the resolved phased request.PhasedRequestRouterappliesquietModeandparallelismto the shared graph just before it schedules each iteration.-p 1request never runs inside a batch that uses the default parallelism.rebuild<->build: not addressed here (follow-up)A
rebuildgraph is not just abuildgraph with some operations invalidated. It is created withisIncrementalBuildAllowed = false, and that setting is baked in when the graph is constructed:CacheableOperationPluginsetsisCacheReadAllowedper operation.ShellOperationRunnerPluginuses no:incrementalcommand.LegacySkipPluginsetsallowSkip.DaemonIpcOperationRunnerPluginis skipped.Running
rebuildon a warmbuildgraph would need a per-iteration "non-incremental" mode across these plugins and runners. Folding the command name into the build identity would be incorrect: the rebuild would restore from cache instead of executing. So this PR leavesrebuildbehavior unchanged. It still causes one tier-1 reload, and the nextbuildcauses another (see steps 9–10 below). Flag variants such asrebuild --verboseno longer re-key the graph.Suggested follow-ups:
rebuild --to Xcan simply invalidate the selected operations on the shared build graph.Tests
libraries/rush-lib/src/api/test/PhasedCommandEngineParameterIdentity.test.ts:--verbose/-v,--parallelism/-p,--timelineand selection parameters leave the identity unchanged.--production) andrebuildstill change it.requestSettingsreports verbosity and parallelism, including50%.libraries/rush-daemon/src/test/WorkspaceRequestScopedParameters.test.ts:build→build→build --verbose→build→build -p 1 --timeline→buildagainst a real daemon host and native graph.lastReloadTier = Reuse, and executes nothing.graph.quietModeandgraph.parallelismfollow each request.build --verbose -p 1rebuildsaandbon the same generation.rush build --to @rushstack/rush-daemon --to @rushstack/rush-cli-client(includes lint and API Extractor; the API reports match the committed ones exactly) passes.WorkspaceRequestScopedParameters|PhasedRequest*|ProductionDaemon*|WorkspaceReloadTier*: 71/71 passed.Linux validation
Setup: WSL Ubuntu-24.04, node 22, synthetic
mkws-synth --projects 12 --sleep-ms 300, one bash process per series. The machine was heavily loaded (load average about 90), so wall times are noisy; the generation, tier and operation counts are deterministic.Fixes #6048
This came out of the automated rushd Linux performance and behavior analysis ("Rushd Hive", board BUG #48; prototype by A01).