Repository navigation
[Tests] Cover requestState binding and key rotation end to end - #665
Merged
chr-hertel merged 2 commits intoNov 5, 2026
Merged
Conversation
chr-hertel
force-pushed
the
request-state-testing
branch
from
November 5, 2026 00:29
4192b5f to
83b3801
Compare
chr-hertel
marked this pull request as ready for review
November 5, 2026 00:36
chr-hertel
requested review from
CodeWithKyrian,
Nyholm and
soyuka
as code owners
November 5, 2026 00:36
chr-hertel
force-pushed
the
request-state-testing
branch
from
November 5, 2026 00:37
83b3801 to
7c4aec5
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The integration tests risk flaky failures when short-lived state expires during server startup and false positives because retry assertions do not distinguish successful results from tool errors.
2 open issues
1 file not reviewed
tests/Interop/package-lock.json: Generated file
What changed in this PR
Adds end-to-end coverage for requestState binding and signing-key rotation, following #625 and #626, using real servers and PHP and TypeScript clients.
Changes:
- Tests replay rejection, request binding, expiry, and cross-era behavior.
- Verifies calls survive staged key rotation across server instances, including with binding enabled.
- Adds shared HTTP fixtures, round-robin routing, and TypeScript client interoperability coverage.
| File | Description |
|---|---|
tests/Unit/Server/Stateless/StatelessProtocolTest.php |
Tests binding before request-listener rewrites. |
tests/Support/RoundRobinHttpClient.php |
Routes successive requests across server instances. |
tests/Interop/Server/Http/TypeScriptClientRequestStateTest.php |
Tests TypeScript client binding and rotation interoperability. |
tests/Interop/Server/Http/typescript-client.mjs |
Drives multi-round calls with the TypeScript SDK. |
tests/Interop/package.json |
Declares the TypeScript client dependency directly. |
tests/Interop/package-lock.json |
Records the direct client dependency. |
tests/Integration/RequestStateTestCase.php |
Provides server lifecycle, request, and assertion helpers. |
tests/Integration/RequestStateRotationTest.php |
Covers staged rotation and incompatible-key failures. |
tests/Integration/RequestStateDeploymentTest.php |
Covers expiry, configuration changes, and protocol-era boundaries. |
tests/Integration/RequestStateBoundRotationTest.php |
Verifies binding remains effective during rotation. |
tests/Integration/RequestStateBindingTest.php |
Covers replay rejection and valid multi-round retries. |
tests/Integration/Fixture/request_state.php |
Supplies a configurable HTTP and stdio test server. |
Review effort: Balanced
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the added request-state binding and key-rotation regression coverage.
No open issues 🎉
2 resolved since last review
1 file not reviewed
tests/Interop/package-lock.json: Generated file
Review effort: Balanced
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.

Follow-up to #625 and #626 - end to end proof with real servers over HTTP, our client and the TS SDK client: replays that succeed without a binder are refused with one, rotation steps keep calls alive across instances, and both hold together. Also covers TTL, SSE rounds, prompts, the subject resolver and states crossing eras or differently configured endpoints.
Adds
@modelcontextprotocol/clientas interop dev dependency, already in the lockfile via the Inspector.