Repository navigation
[Server] Fix parallel elicitations on one session getting each other's answers - #581
Merged
chr-hertel merged 8 commits intoOct 14, 2026
Conversation
chr-hertel
requested review from
CodeWithKyrian,
Nyholm and
soyuka
as code owners
October 10, 2026 02:02
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Concurrent session writes can still discard pending requests, and the request-ID bound fails on supported 32-bit PHP builds.
2 open findings
What changed in this PR
Fixes parallel session calls sharing request IDs and sending messages over the wrong stream.
Changes:
- Generates random JavaScript-safe request IDs.
- Queues fiber messages per transport.
- Adds concurrency regression tests and documentation.
| File | Description |
|---|---|
src/Server/Protocol.php |
Adds random IDs and transport-specific queues. |
tests/Unit/Server/ProtocolTest.php |
Tests concurrent streams and workers. |
tests/Unit/Fixtures/PollingLoopTransport.php |
Exposes outgoing messages for tests. |
CHANGELOG.md |
Documents the concurrency fix. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
chr-hertel
force-pushed
the
fix-parallel-client-requests
branch
from
October 12, 2026 20:58
1d66c37 to
0e5331f
Compare
soyuka
reviewed
Oct 13, 2026
chr-hertel
force-pushed
the
fix-parallel-client-requests
branch
from
October 13, 2026 22:11
0e5331f to
ffedfd6
Compare
This was referenced Oct 13, 2026
Closed
This was referenced Oct 13, 2026
…d not store on a fiber yield
chr-hertel
force-pushed
the
fix-parallel-client-requests
branch
from
October 14, 2026 22:17
6a892cf to
723e550
Compare
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.



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.Protocol::sendRequest(),checkResponse()andhandleFiberYield()take and return aUuidinstead of anint, as does a transport's response finderProtocol, so it goes out on the stream of its own call - the session-wide queue stays for messages not tied to a call, likeResourceUpdatedNotificationFixes chr-hertel#56
🤖 Generated with Claude Code