You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix hang caused by StreamableHttpClientTransport (#226) (#227)
Re-throw exceptions in `StreamableHttpClientTransport` so `Protocol`
doesn't hang indefinitely.
## Motivation and Context
Fixes the issue described in #226
## How Has This Been Tested?
I've verified that my test case reproduces the error without my fix, and
verified with breakpoints that the hang occurred where I described it.
## Breaking Changes
None
## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [x] I have added appropriate error handling
- [ ] I have added or updated documentation as needed
## Additional context
I am unsure about the dispatcher I used for the real-time timeout here.
I could not get the test to work otherwise, as `kotlinx.coroutines.test`
was always tripping my timeout, with or without the fix. This is
seemingly unrelated to the test case though, as removing my timeout
results in the [timeout in
Protocol](https://github.com/modelcontextprotocol/kotlin-sdk/blob/6bae9874c0ba02c683dfe61a416eeee0de0c6f32/kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/shared/Protocol.kt#L454)
being tripped, even though that's not the point of the indefinite hang.
Copy file name to clipboardExpand all lines: kotlin-sdk-client/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/client/StreamableHttpClientTransport.kt
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -142,7 +142,10 @@ public class StreamableHttpClientTransport(
Copy file name to clipboardExpand all lines: kotlin-sdk-client/src/commonTest/kotlin/io/modelcontextprotocol/kotlin/sdk/client/StreamableHttpClientTransportTest.kt
0 commit comments