Repository navigation
[Server] Send progress with the token of the gateway's own request - #594
Merged
chr-hertel merged 1 commit intoOct 14, 2026
Merged
chr-hertel merged 1 commit into
chr-hertel merged 1 commit into
Conversation
chr-hertel
requested review from
CodeWithKyrian,
Nyholm and
soyuka
as code owners
October 13, 2026 22:39
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The request-specific token propagation is complete across supported gateway creation paths and has focused regression coverage.
0 open findings
What changed in this PR
Fixes progress-token mix-ups between parallel requests sharing a session by associating each ClientGateway with its current request.
Changes:
- Reads progress tokens from request metadata, retaining session fallback compatibility.
- Propagates requests through gateway construction and dependency injection.
- Adds unit and concurrency regression coverage.
| File | Description |
|---|---|
src/Server/ClientGateway.php |
Uses request-specific progress metadata. |
src/Server/RequestContext.php |
Passes the current request to the gateway. |
src/Capability/Registry/InjectableParameters.php |
Injects request-aware gateways. |
src/Capability/Registry/Loader/ExplicitElementLoader.php |
Passes requests through explicit handlers. |
tests/Unit/Server/ClientGatewayTest.php |
Tests token selection and fallback behavior. |
tests/Unit/Server/ProtocolTest.php |
Tests parallel-call token isolation. |
tests/Unit/Capability/Registry/ReferenceHandlerTest.php |
Updates request fixtures to valid request objects. |
tests/Unit/Capability/Registry/Loader/ExplicitElementLoaderTest.php |
Updates explicit-loader request fixtures. |
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.
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.
ClientGateway::progress()read the progress token from the session, which every call of a session shares. With parallel calls, steps 2..n of one call went out with the token of the call that came last.ClientGatewaytakes the request it serves as an optional second argument and reads the token from its metaRequestContext,InjectableParametersandExplicitElementLoaderpass the requestFixes chr-hertel#82
Part of chr-hertel#74 (together with #581)
🤖 Generated with Claude Code