Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/ModelContextProtocol.Core/Client/StdioClientTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ internal static void DisposeProcess(
// and Node.js does not kill its children when it exits properly.
process.KillTree(shutdownTimeout);
}

// Ensure all redirected stderr/stdout events have been dispatched
// before disposing. Only the no-arg WaitForExit() guarantees this;
// WaitForExit(int) (used by KillTree) does not.
process.WaitForExit();
Comment thread
stephentoub marked this conversation as resolved.
Outdated
}
finally
{
Expand Down
Loading