Repository navigation
fix: stop total request timeouts from cutting long streams - #494
Merged
Merged
Conversation
reqwest's ClientBuilder::timeout bounds the whole request, body included: - MCP: the 60 s client timeout also applied to the legacy transport's long-lived SSE GET, which carries every answer. A server on that transport dropped out a minute after connecting. The client now sets only a connect timeout; each POST keeps its own 60 s bound. - SDK and TUI remote: a run streamed longer than 600 s was cut off mid turn. The bound is now between reads; the server pings every 15 s. Co-Authored-By: Claude Opus 5.5 <[email protected]>
mrnasil
enabled auto-merge (squash)
November 25, 2026 15:21
Merged
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.
reqwest::ClientBuilder::timeoutbounds the whole request, body included. Two clients used it on streams.MCP. The 60 s client timeout also applied to the legacy transport's long-lived SSE GET, and every answer arrives on that GET. So a server using that transport dropped out about a minute after connecting, and every later tool call failed. The client now sets only a connect timeout, and each of the four POSTs keeps its own 60 s bound (
request_timeout()).SDK and TUI remote. A run that streamed for longer than 600 s was cut off mid-turn. The 600 s bound now applies to the gap between reads (
read_timeout). The server pings every 15 s while a run is quiet, so a healthy run is never cut, and a dead connection is still noticed.Test: the legacy SSE test now waits twice the per-request bound before sending a request whose answer arrives on the GET stream. Putting the timeout back on the client makes this test fail; I checked. Lines missed in
mcp/src/http.rsare the same as on main.🤖 Generated with Claude Code