Skip to content

[Server] Fix parallel elicitations on one session getting each other's answers - #581

Open
chr-hertel wants to merge 1 commit into
modelcontextprotocol:mainfrom
chr-hertel:fix-parallel-client-requests
Open

chr-hertel wants to merge 1 commit into
modelcontextprotocol:mainfrom
chr-hertel:fix-parallel-client-requests

Conversation

@chr-hertel

Copy link
Copy Markdown
Member

Two tool calls on one session that both elicit got the same request id (1000), so one call resumed with the other one's answer. On top, an elicitation could go out on another call's SSE stream, since all streams drained one session-wide queue.

  • requests to the client get a random id (up to 2^53 - 1, JS-safe) instead of a counter read-modify-written in the session
  • what a suspended fiber sends is queued per transport in Protocol, so it goes out on the stream of its own call - the session-wide queue stays for messages not tied to a call, like ResourceUpdatedNotification

Overlaps with #580, which also touches the fiber yield handler in Protocol::connect().

Fixes chr-hertel#56

🤖 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 Server Issues & PRs related to the Server 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 Server Issues & PRs related to the Server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Server] Parallel elicitations on one session get each other's answers

1 participant