Skip to content

fix(derive): take an MCP server's host from its walked parent chain - #96

Merged
vishr merged 2 commits into
mainfrom
fix/windows-shared-host-reused-pid
Oct 31, 2026
Merged

vishr merged 2 commits into
mainfrom
fix/windows-shared-host-reused-pid

Conversation

@vishr

@vishr vishr commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

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.

vishr added 2 commits October 31, 2026 10:38
…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.
@vishr vishr changed the title fix(derive): never name a process that reused a PID as an MCP server's host fix(derive): take an MCP server's host from its walked parent chain Oct 31, 2026
@vishr
vishr merged commit 98e6fc4 into main Oct 31, 2026
6 checks passed
@vishr
vishr deleted the fix/windows-shared-host-reused-pid branch October 31, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant