Title: fix(client): catch httpx transport errors in streamable HTTP post_writer by devansh-dek · Pull Request #3025 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: fix(client): catch httpx transport errors in streamable HTTP post_writer by devansh-dek · Pull Request #3025 · modelcontextprotocol/python-sdk
X Title: fix(client): catch httpx transport errors in streamable HTTP post_writer by devansh-dek · Pull Request #3025 · modelcontextprotocol/python-sdk
Description: Summary Catch httpx.HTTPError inside streamable HTTP post_writer request tasks and reply with a JSON-RPC error on the read stream instead of letting the exception escape into the outer transport task group. Fixes the uncatchable RuntimeError: Attempted to exit cancel scope in a different task than it was entered in when ClientSessionGroup.connect_to_server() targets an unreachable streamable HTTP server (#915). Adds a regression test in tests/issues/test_915_streamable_http_unreachable.py. Test plan uv run pytest tests/issues/test_915_streamable_http_unreachable.py -v uv run ruff check src/mcp/client/streamable_http.py tests/issues/test_915_streamable_http_unreachable.py Fixes #915
Open Graph Description: Summary Catch httpx.HTTPError inside streamable HTTP post_writer request tasks and reply with a JSON-RPC error on the read stream instead of letting the exception escape into the outer transport t...
X Description: Summary Catch httpx.HTTPError inside streamable HTTP post_writer request tasks and reply with a JSON-RPC error on the read stream instead of letting the exception escape into the outer transport t...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/3025
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:b00e1bf6-cdc4-42df-3edf-7daf8421d3e0 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8F04:3E74E8:FF4F45:15DD065:6A61A9CB |
| html-safe-nonce | d68baf61ad6420a8227c6c95156d4e9dabdf7fba96e7bef2bf8ac12eb9577b23 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RjA0OjNFNzRFODpGRjRGNDU6MTVERDA2NTo2QTYxQTlDQiIsInZpc2l0b3JfaWQiOiI3MTY1MzY3MDAzMzkwMjU3NjExIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 562a8b0e198a7eeb13d3b33c5e98ef9846d8a017ade3de53de20039914288b94 |
| hovercard-subject-tag | pull_request:3960053526 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/3025/files |
| twitter:image | https://avatars.githubusercontent.com/u/83805376?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/83805376?s=400&v=4 |
| og:image:alt | Summary Catch httpx.HTTPError inside streamable HTTP post_writer request tasks and reply with a JSON-RPC error on the read stream instead of letting the exception escape into the outer transport t... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6f4633bcf01c1ad14b73fd07dd39ac31d61f3d3c2578ee08ec1792b7b351eeb9 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ac296ae7f21856f1f92adbad22f870b6fbb4b907 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width