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
The error log lines in that targeted pytest run are expected: the new regression test deliberately crashes the session runner and asserts that the JSON response reports the original session exception instead of only the downstream closed-stream error.
Closing this. Since I opened it, main has reworked the streamable-HTTP POST error path in the opposite direction — it logs the exception server-side and returns a generic "Error handling POST request" message rather than surfacing the underlying error to the client. This PR's whole point was to surface the session crash cause, which now cuts against that deliberate choice, so it's cleaner to drop it than to force a conflicting reconcile. Thanks for the refactor.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
app.run()exception when a POST fails after the session stream closesClosedResourceErrorwhen reporting the failure back to an already closed writerFixes #2741.
To verify
python -m pytest tests\server\test_streamable_http_manager.py -qpython -m ruff check src\mcp\server\streamable_http.py src\mcp\server\streamable_http_manager.py tests\server\test_streamable_http_manager.pypython -m ruff format --check src\mcp\server\streamable_http.py src\mcp\server\streamable_http_manager.py tests\server\test_streamable_http_manager.pygit diff --check -- src\mcp\server\streamable_http.py src\mcp\server\streamable_http_manager.py tests\server\test_streamable_http_manager.py