Fix node capability binding diagnostics#461
Merged
shanselman merged 3 commits intoMay 19, 2026
Merged
Conversation
…e in ClientCreated bridge Node connections were handshaking with caps=0/cmds=0 because the NodeConnector.ClientCreated bridge silently no-oped when _nodeService was null (via the ?. null-conditional on AttachClient). The gateway recorded the node as having no advertised commands, so the agent could not invoke anything on it. _nodeService construction was gated by ShouldInitializeNodeService, which returns false while _suppressNodeDuringSetup is true. The setup engine drives node connect through EnsureNodeConnectedAsync which bypasses that gate, so ClientCreated can fire before _nodeService is ever built — and after the suppress flag clears nothing reconstructs it. Fix: lazy-construct NodeService inside the ClientCreated handler so the capability registrar is guaranteed to exist whenever a node client is about to connect, independent of OnLaunched ordering or suppress-flag state. EnsureNodeService is idempotent. Also rename EnsureNodeServiceForLocalGatewaySetup -> EnsureNodeService: the original name reflected a single setup-time caller, but it now has 4 call sites and only 1 is setup-related. Regression introduced 2026-05-12 in 62533e2 when capability registration moved to the lazy ClientCreated bridge pattern. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the ClientCreated bridge visible when NodeService setup or capability binding cannot populate commands, without crashing the tray app. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Thanks, @ranjeshj. This is the right fix order-wise: node capability binding needs to happen before the node connect handshake serializes caps/commands, and making the I reviewed the lifecycle path, ran local validation, and added one small regression test so a throwing |
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
Validation