Skip to content

Send process id from the agent to the client in initial response. - #56245

Merged
tmat merged 2 commits into
dotnet:release/11.0.1xxfrom
tmat:AgentInfo
Sep 15, 2026
Merged

tmat merged 2 commits into
dotnet:release/11.0.1xxfrom
tmat:AgentInfo

Conversation

@tmat

@tmat tmat commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

Allows a Hot Reload implementation that does entirely control the process launch to associate Hot Reload session with a process id.

For example, in CDK the Hot Reload session for a project is created when the launch configuration is resolved. Then VS Code launches the process and vsdbg-ui receives DAP protocol event. There is no connection back to the code that created the session that would start it.

This change allows to implement "auto-start" -- when the agent in the launched process connects to the named pipe/web socket created for the launch (when the Hot Reload session is created) we can start the session and associate it to the process via proces id.

Allows a Hot Reload implementation that does entirely control the process launch to associate Hot Reload session with a process id.
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@tmat
tmat marked this pull request as ready for review September 12, 2026 21:53
@tmat
tmat requested a review from a team as a code owner September 12, 2026 21:53
Copilot AI lite review requested due to automatic review settings September 12, 2026 21:53
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The handshake version change breaks compatibility with older clients and agents and needs a backward-compatible negotiation path.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds process-ID metadata to Hot Reload agent initialization, allowing sessions to associate with launched processes.

Changes:

  • Adds agent metadata and process-ID propagation.
  • Updates clients, app models, hosts, listeners, and tests.
  • Extends the named-pipe initialization protocol.
File summaries
File Summary
test/Microsoft.Extensions.DotNetDeltaApplier.Tests/Mocks/TestHotReloadClient.cs Updates the test client contract.
test/Microsoft.Extensions.DotNetDeltaApplier.Tests/HotReloadClientTests.cs Tests process-ID handling.
src/Dotnet.Watch/Watch/HotReload/RunningProjectsManager.cs Consumes agent metadata.
src/Dotnet.Watch/Watch/AppModels/WebServerAppModel.cs Configures web server agent behavior.
src/Dotnet.Watch/Watch/AppModels/MobileAppModel.cs Configures mobile agent behavior.
src/Dotnet.Watch/Watch/AppModels/DefaultAppModel.cs Configures default agent behavior.
src/Dotnet.Watch/Watch/AppModels/BlazorWebAssemblyHostedAppModel.cs Configures hosted WebAssembly agent behavior.
src/Dotnet.Watch/HotReloadClient/Web/WebAssemblyHotReloadClient.cs Reports WebAssembly agent information.
src/Dotnet.Watch/HotReloadClient/HotReloadClients.cs Aggregates agent information and capabilities.
src/Dotnet.Watch/HotReloadClient/HotReloadClient.cs Updates the client abstraction.
src/Dotnet.Watch/HotReloadClient/HotReloadAgentInfo.cs Defines agent metadata.
src/Dotnet.Watch/HotReloadClient/DefaultHotReloadClient.cs Reads and exposes process IDs.
src/Dotnet.Watch/HotReloadAgent.PipeRpc/NamedPipeContract.cs Extends initialization response serialization.
src/Dotnet.Watch/HotReloadAgent.Host/StartupHook.cs Captures the running process ID.
src/Dotnet.Watch/HotReloadAgent.Host/Listener.cs Sends the process ID to clients.
Review details
  • Files reviewed: 15/15 changed files
  • Comments generated: 1
  • Review effort level: Lite

@tmat tmat added Area-Watch dotnet-watch and removed Servicing-consider labels Sep 12, 2026
@tmat

tmat commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

@DustinCampbell @genlu ptal

@tmat

tmat commented Sep 14, 2026

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
3 pipeline(s) were filtered out due to trigger conditions.

@tmat
tmat enabled auto-merge (squash) September 14, 2026 21:55
@tmat

tmat commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
3 pipeline(s) were filtered out due to trigger conditions.

@tmat
tmat merged commit 31bd744 into dotnet:release/11.0.1xx Sep 15, 2026
22 of 23 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc2 milestone Sep 15, 2026

This branch had an error being deployed

1 failed deployment
copilot-pat-pool — 4776fed8 Deployed Sep 15, 2026 by tmat via pre_activation #4985
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Watch dotnet-watch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants