Enable TaskHost Callbacks by default#13579
Merged
JanProvaznik merged 2 commits intomainfrom Apr 21, 2026
Merged
Conversation
Callbacks are now always enabled via packet version negotiation. Remove the temporary escape hatch env var and cross-version fallback tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4c7cefd to
fcd087c
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR finalizes default enablement of IBuildEngine callback forwarding for out-of-proc TaskHost execution by making the feature depend purely on the negotiated packet protocol version (and bumping that version), removing the temporary environment-variable escape hatch.
Changes:
- Bump TaskHost/node packet protocol version to 4 to represent callback-capable communication.
- Remove
MSBUILDENABLETASKHOSTCALLBACKS(Traits escape hatch) and rely on packet version for callback support gating. - Update TaskHost callback integration tests to stop force-enabling callbacks via env var and remove “callbacks disabled” regression tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Shared/INodePacket.cs | Bumps PacketVersion to 4 and updates the version history comment. |
| src/MSBuild/OutOfProcTaskHostNode.cs | Removes env-var override; callback support now depends on packet version only. |
| src/Framework/Traits.cs | Removes the EnableTaskHostCallbacks escape-hatch environment variable. |
| src/Build.UnitTests/BackEnd/TaskHostCallback_Tests.cs | Removes env-var setup and deletes tests for the “callbacks not supported” path. |
Comments suppressed due to low confidence (1)
src/Build.UnitTests/BackEnd/TaskHostCallback_Tests.cs:112
- This file previously covered the “callbacks not supported”/cross-version path (MSB5022 for IsRunningMultipleNodes/BuildProjectFile and NotImplementedException for RequestCores). With callbacks now enabled by default, those regression tests were removed, leaving the fallback behavior untested even though the production code still has explicit
!CallbacksSupportedbranches. Consider reintroducing at least one unit-style test that forcesCallbacksSupportedfalse (e.g., by constructing a minimal TaskHostConfiguration and setting a lower parent packet version) to keep the cross-version compatibility behavior from regressing.
/// <summary>
/// Verifies RequestCores callback works when task is explicitly run in TaskHost via TaskHostFactory.
/// The first RequestCores call should always return at least 1 (the implicit core).
/// </summary>
[Fact]
JanProvaznik
commented
Apr 21, 2026
This was referenced Apr 21, 2026
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.
Fixes #12863
Context
final enablement without escape hatch
Notes
validated by vmr and vs expinsert