Surface streamable HTTP connection errors#2711
Conversation
401bd5e to
fd1d142
Compare
fd1d142 to
b3cb4d8
Compare
|
Thanks for the CI signal here. I pushed a follow-up that fixes the Python 3.14 branch-coverage miss in the new connection-error test.\n\nThe latest run now has only one red job left: . Its log shows the test suite passed, but coverage missed the subprocess helper on that Windows matrix (, fail-under 100). That file is outside this PR's diff, and the other Python 3.14 jobs now pass.\n\nI tried to rerun the failed job, but GitHub rejected it because I do not have admin rights on the repo. |
|
Thanks for the CI signal here. I pushed a follow-up that fixes the Python 3.14 branch-coverage miss in the new connection-error test. The latest run now has only one red job left: I tried to rerun the failed job, but GitHub rejected it because I do not have admin rights on the repo. |
Fixes #915.\n\n## Summary\n- convert background streamable HTTP request failures into JSON-RPC errors for the originating request\n- prevents ClientSessionGroup initialization from hanging or surfacing async generator cleanup errors when the remote streamable HTTP server is unavailable\n- add a regression test that uses a failing httpx transport and asserts connect_to_server returns a catchable MCPError\n\n## Validation\n- uv run pytest tests/client/test_session_group.py -q\n- uv run pytest tests/client/test_session_group.py -q -k streamable_http_connection_error_surfaces\n- uv run ruff check src/mcp/client/streamable_http.py tests/client/test_session_group.py\n- uv run ruff format --check src/mcp/client/streamable_http.py tests/client/test_session_group.py\n- uv run pyright src/mcp/client/streamable_http.py tests/client/test_session_group.py\n- git diff --check\n\nNote: I also tried the existing tests/client/test_transport_stream_cleanup.py locally; an unrelated environment/proxy behavior returned 502 for a free localhost port where that test expects ConnectError, so I kept the validation above focused on this change path.