Skip to content

[rush-daemon][WS2.5][4/9] Isolate global command context - #5964

Draft
Mo Jazayeri (mojaza) wants to merge 3 commits into
mojazayeri-microsoft-rushd-ws2-route-phased-upstreamfrom
mojazayeri-microsoft-rushd-ws2-global-context-upstream
Draft

[rush-daemon][WS2.5][4/9] Isolate global command context#5964
Mo Jazayeri (mojaza) wants to merge 3 commits into
mojazayeri-microsoft-rushd-ws2-route-phased-upstreamfrom
mojazayeri-microsoft-rushd-ws2-global-context-upstream

Conversation

@mojaza

Copy link
Copy Markdown
Contributor

Summary

Introduces request-scoped global command execution context and routing for @rushstack/rush-daemon, isolating per-client state while preserving warm workspace sessions.

This dependent PR targets and updates the stack dependency to #5962. It supersedes mojaza#3, follows merged #5949, and references #5897. PBI: https://onedrive.visualstudio.com/EFun/_workitems/edit/3216021

Details

  • Resolves and validates command names, request IDs, canonical working directories, immutable environment snapshots, and terminal capabilities before execution.
  • Provides a request-scoped execution context with ordered terminal forwarding, cancellation propagation, child-process management, and async-disposable cleanup without disposing the warm workspace session.
  • Routes global command requests against the workspace session and exports the new beta API surface.
  • Registers detached child process trees for cleanup both when a request ends and when the daemon exits unexpectedly.
  • Adds focused coverage for request validation, environment isolation, output ordering, cancellation, and cleanup behavior, plus the generated API report and change file.

Limitations

This layer intentionally stops at the open #5895 boundary: it establishes daemon-side global request/context isolation but does not wire the remaining end-to-end CLI/transport integration. No native stack metadata is created by this PR.

This draft awaits human review.

How it was tested

  • node common/scripts/install-run-rush.js test --to @rushstack/rush-daemon --verbose
  • @rushstack/rush-daemon TypeScript build, ESLint, and API Extractor report validation
  • Focused emitted Jest suite GlobalCommandRequestRouter.test.js: 10 tests passed

mojazayeri and others added 3 commits August 24, 2026 16:07
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs triage

Development

Successfully merging this pull request may close these issues.

2 participants