Fix StdioServerTransport.DisposeAsync() hang: CancellableStdinStream missing Dispose override (#1276)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
This commit is contained in:
Copilot 2026-02-17 16:00:12 -08:00 • committed by GitHub
commit 841e810167
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -59,6 +59,16 @@ public sealed class StdioServerTransport : StreamServerTransport
}
#endif
protected override void Dispose(bool disposing)
{
if (disposing)
{
stdinStream.Dispose();
}
base.Dispose(disposing);
}
// The McpServer shouldn't call flush on the stdin Stream, but it doesn't need to throw just in case.
public override void Flush() { }