-
Notifications
You must be signed in to change notification settings - Fork 201
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When sending a message with the batch payload of several requests, like:
val payload = encodeMessages(listOf(firstRequest, secondRequest))So the body is:
[{"id":"first","method":"tools/list"},{"id":"second","method":"resources/list"}]the response from the server will be
[{"id":"second",...},{"id":"first",...}]instead of
[{"id":"first",...},{"id":"second",...}]To Reproduce
Steps to reproduce the behavior:
- Checkout to the branch
zarechneva/streamable-http-transport-testsOR edit theStreamableHttpServerTransportTestand add the following checks to thebatched requests wait for all responses before replyingtest:
// Check responses' order
assertEquals(listOf(firstRequest.id, secondRequest.id), responses.map { it.id })
val firstMeta = (responses[0] as ListToolsResult).meta
val secondMeta = (responses[1] as ListResourcesResult).meta
assertEquals("first", firstMeta?.get("label")?.jsonPrimitive?.content)
assertEquals("second", secondMeta?.get("label")?.jsonPrimitive?.content)instead of a TODO.
2. Run io.modelcontextprotocol.kotlin.sdk.server.StreamableHttpServerTransportTest#batched requests wait for all responses before replying
Expected behavior
The order of responses should match the order of messages in the batch request.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working