Skip to content

fix(streamable-http): reject duplicate request IDs#2756

Open
Epochex wants to merge 3 commits into
modelcontextprotocol:mainfrom
Epochex:fix/2655-duplicate-request-id
Open

fix(streamable-http): reject duplicate request IDs#2756
Epochex wants to merge 3 commits into
modelcontextprotocol:mainfrom
Epochex:fix/2655-duplicate-request-id

Conversation

@Epochex
Copy link
Copy Markdown

@Epochex Epochex commented Jun 1, 2026

Fixes #2655.

When a Streamable HTTP session receives a second JSON-RPC request with an id that is already in-flight, the transport used to overwrite the per-id stream slot, leaving the first request hanging until client timeout.

This change rejects the duplicate with HTTP 409 + JSON-RPC error (preserving the offending id) and leaves the original request untouched.

Tests:

  • uv run --frozen pytest tests/issues/test_2655_streamable_http_duplicate_request_id.py
  • uv run --frozen pytest tests/server/test_streamable_http_manager.py

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Streamable HTTP server silently drops in-flight request when client reuses a JSON-RPC id

1 participant