Repository navigation
Conversation
3c9edc5 to
edeb3e0
Compare
|
Updated in You were right about the exception path. I moved
Added focused regressions for both probes:
Validation run locally: Results: the focused subset passed, the full I also tried |
bb834da to
69897d7
Compare
|
Addressed the latest review and rebased this branch on current Changes in the follow-up commit:
Validation on Windows:
|
69897d7 to
58bf5a5
Compare
|
Addressed the coverage gap on the non-terminal SSE error path. What changed:
Validation on head
|
58bf5a5 to
f122efe
Compare
|
Follow-up after the CI
Verified: uv run --no-sync pytest tests\shared\test_streamable_http.py -q --basetemp .tmp\pytest-2750-nocover -p no:cacheprovider
uv run --no-sync ruff check --no-cache src\mcp\client\streamable_http.py tests\shared\test_streamable_http.py
uv run --no-sync ruff format --check --no-cache src\mcp\client\streamable_http.py tests\shared\test_streamable_http.py
uv run --no-sync pyright src\mcp\client\streamable_http.py tests\shared\test_streamable_http.py
git diff --check |
|
closing as original issue wasn't reproduced |
Summary
Fixes #2707.
The streamable HTTP client was closing SSE responses as soon as a terminal JSON-RPC response arrived. That leaves the underlying HTTP/1.1 connection partially drained, so the next request can pay the keepalive penalty described in the issue.
This change keeps reading the POST SSE response, resumption GET response, and resumed GET stream to EOF after the terminal response has been delivered. Terminal responses still stop further message handling and still avoid reconnecting; the only behavior change is that the transport no longer aborts the response early on the normal completion path.
To verify
uv run pytest tests\shared\test_streamable_http.py -k "drains_after_terminal_response"uv run pytest tests\shared\test_streamable_http.py::test_streamable_http_client_tool_invocation tests\shared\test_streamable_http.py::test_streamable_http_client_resumptionuv run ruff check src\mcp\client\streamable_http.py tests\shared\test_streamable_http.pyuv run ruff format --check src\mcp\client\streamable_http.py tests\shared\test_streamable_http.pygit diff --check -- src\mcp\client\streamable_http.py tests\shared\test_streamable_http.py