Repository navigation
fix(derive): take an MCP server's host from its walked parent chain - #96
Merged
Merged
Conversation
…s host On Windows a process keeps the PID of its exited parent, and a newer process can reuse it. Process placement already stops the parent chain at such a parent, but it set an MCP server's SharedHost from the raw parent PID, so the server's memory could be grouped under that unrelated newer process. SharedHost now skips a sampled parent that started after the server, using the same check as processChain, which is now shared as reusedParent.
Address review: the host is now the next process the parent chain walked, so it is never a reused, dead or zero PID. A server whose chain ends there has no host and is placed as other, not as shared with an editor that is gone. processChain keeps its own check, so no helper is added.
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.
Process placement set an MCP server's SharedHost from its raw parent PID. On Windows a process keeps the PID of its exited parent, so the host could be a dead PID or an unrelated newer process that reused it, and the server's memory showed as "unknown (shared with editor)" or under the wrong app.
The host is now the next process the parent chain walked. processChain already stops at a missing parent or one that started after its child, so the host is always a sampled, valid parent. A server with no such parent is placed as other instead of as shared with an editor.