Repository navigation
mcp: repeat legacy multi-round-trip rounds until the handler completes - #1355
Merged
guglielmo-san merged 1 commit intoOct 9, 2026
Conversation
For clients before 2026-07-28, serverMultiRoundTripMiddleware fulfilled a handler's InputRequests and called the handler again only once. A handler that asked for more input on that call had its second InputRequiredResult returned to a client that cannot interpret it. Loop until the handler completes, with the same maxMultiRoundTripRetries limit as the client-side middleware, and update the server docs that described a single retry.
guglielmo-san
approved these changes
Oct 9, 2026
Contributor
|
@SergeevDmitry thank you for the contribution! |
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.
For clients on a protocol version before 2026-07-28,
serverMultiRoundTripMiddlewarefulfills a handler'sInputRequestsand calls the handler again, but only once. If the handler asks for more input on that call, the middleware returns the secondInputRequiredResultto a client that cannot interpret it. The client gets"content": nullplusinputRequestsandrequestState, which the TypeScript SDK 1.32.1 rejects.This loops until the handler completes, with the same
maxMultiRoundTripRetrieslimit and error asclientMultiRoundTripMiddleware. Load shedding (an emptyInputRequests) still returns "the server is busy, retry later", now on any round. The server docs anddesign/mrtr.md, which described a single retry, are updated, anddocs/server.mdis regenerated.The two new tests fail on
main:TestMultiRoundTrip_ServerMiddleware_MultipleRounds: a handler asking twice completes for a2025-11-25client.TestMultiRoundTrip_ServerMiddleware_MaxRetries: a handler that always asks stops after 10 calls.go test -race ./...,go vet ./...and both conformance scripts pass locally (server 40/40, client 239/239).Fixes #1354
AI assistance: I used Claude Code to help write this fix and the tests.