fix: log unknown or expired streamable HTTP session IDs#2218
Closed
lavish0000 wants to merge 2 commits intomodelcontextprotocol:mainfrom
Closed
fix: log unknown or expired streamable HTTP session IDs#2218lavish0000 wants to merge 2 commits intomodelcontextprotocol:mainfrom
lavish0000 wants to merge 2 commits intomodelcontextprotocol:mainfrom
Conversation
Author
|
Quick status note: the remaining red lane is |
Contributor
|
Thanks for the contribution — this was addressed in #2212 which was opened first. For |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #2204
Summary
StreamableHTTPSessionManagerrejects a request with an unknown or expiredmcp-session-idWhy
The 404 behavior is already correct, but today the rejection path is silent. In practice that makes stale session IDs harder to diagnose after restarts or idle-session cleanup.
Scope
_handle_stateful_request()is touchedValidation
uv run pytest tests/server/test_streamable_http_manager.pyuv run ruff check src/mcp/server/streamable_http_manager.py tests/server/test_streamable_http_manager.pyuv run ruff format --check src/mcp/server/streamable_http_manager.py tests/server/test_streamable_http_manager.pyuv run pyright src/mcp/server/streamable_http_manager.py tests/server/test_streamable_http_manager.pyNotes