Skip to content

[Client] Fail a request at once when its response ends unanswered - #577

Open
chr-hertel wants to merge 1 commit into
modelcontextprotocol:mainfrom
chr-hertel:fix-client-cut-response
Open

chr-hertel wants to merge 1 commit into
modelcontextprotocol:mainfrom
chr-hertel:fix-client-cut-response

Conversation

@chr-hertel

Copy link
Copy Markdown
Member

A connection cut mid-answer left the request pending until its timeout (120s by default) - end of stream counted as done, and a truncated JSON body was only logged as "Failed to parse message".

  • SSE: if the POST's stream ends, is cut or fails to read before the answer to its request arrived, the waiting call fails with a ConnectionException
  • JSON: a body that fails to read or doesn't carry the answer (truncated, empty) does the same, instead of leaking the PSR stream exception or waiting

Interacts with #463: resuming via Last-Event-ID would slot in where the unanswered stream now fails - this covers what stays unresumable (no event id, JSON bodies, read errors). Status handling of #425 / #560 is untouched.

Fixes chr-hertel#65

🤖 Generated with Claude Code

@chr-hertel chr-hertel added this to the 0.9.0 milestone Oct 10, 2026
@chr-hertel chr-hertel added bug Something isn't working Client Issues & PRs related to the Client component labels Oct 10, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Client Issues & PRs related to the Client component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Client] A connection cut mid-answer waits out the whole request timeout

1 participant