{{ message }}
Prevent stdio connection hang for missing server path. - #401
Merged
Merged
Conversation
TimChild
force-pushed
the
prevent-stdio-hang
branch
from
April 7, 2025 18:59
6a85c7f to
90f224d
Compare
ihrpr
previously requested changes
May 27, 2025
ihrpr
left a comment
Contributor
There was a problem hiding this comment.
Thank you for your contribution! Sorry for the delay in reviews.
This PR identified an issue where the SDK is not handling missing server paths. I'd suggest a slightly different approach for a solution though. Should we implement error handling for the server path instead?
Contributor
Author
Contributor
bhosmer-ant
self-requested a review
May 28, 2025 21:31
7 tasks
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.

Motivation and Context
The stdio connection was hanging indefinitely for a bad server file path (e.g. command
uv, argsrun non-existing-file.py).I think because the read/write streams were not being closed properly in that case.
This makes it so that errors due to the underlying mcp server stopping early raises a
ProcessTerminatedEarlyError.How Has This Been Tested?
Added a test (including catching if it does hang for more than 1s)
Breaking Changes
Should not be a breaking change.
Types of changes
Checklist
Additional context