You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Client transports/sessions swallow the original exception; applications cannot classify 401/403/429 transport failures #3569
I confirm that I'm using the newest release of my line (verified on main and 2.2.0)
I confirm that I searched for my issue in the issues before opening this one (searched "exception pending request", "error classification", "McpError generic")
Release line
v2 (v1 shares the code)
Description
When a transport request fails mid-flight (HTTP 401/403/429, connection reset, etc.), the client transports log the exception and close the stream, and pending send_request callers get a generic closed-stream error. The original exception — with its status code — never reaches the application, so a host cannot distinguish "token expired, re-authorize" from "rate limited, back off" from "server gone".
Proposal, in two parts (we run both in production and can PR them):
SSE/streamable-HTTP transports forward the caught exception into the read stream (instead of only logger.exception), so the session sees it.
Client/shared sessions deliver that raw exception to the pending request(s) — the default message handler re-raises Exception instances — so send_request callers receive the real httpx.HTTPStatusError and can classify it.
One caveat worth discussing: httpx exceptions stringify with the request URL, which can carry credentials in query strings; our transport-side change logs only the exception type name and leaves scrubbing to the application that receives the raw exception.
Both reports describe SSE and streamable HTTP transport failures losing the original HTTP error, leaving callers unable to classify the status. This is tracked in #2110, so I’m closing this as a duplicate. AI-assisted triage; I reviewed both reports.
Activity
Kludex commentedon Oct 10, 2026
Both reports describe SSE and streamable HTTP transport failures losing the original HTTP error, leaving callers unable to classify the status. This is tracked in #2110, so I’m closing this as a duplicate. AI-assisted triage; I reviewed both reports.