Skip to content

[Tests] Cover requestState binding and key rotation end to end - #665

Merged
chr-hertel merged 2 commits into
modelcontextprotocol:mainfrom
chr-hertel:request-state-testing
Nov 5, 2026
Merged

chr-hertel merged 2 commits into
modelcontextprotocol:mainfrom
chr-hertel:request-state-testing

Conversation

@chr-hertel

@chr-hertel chr-hertel commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

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/client as interop dev dependency, already in the lockfile via the Inspector.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@chr-hertel
chr-hertel merged commit 7442aee into modelcontextprotocol:main Nov 5, 2026
28 checks passed
@chr-hertel
chr-hertel deleted the request-state-testing branch November 5, 2026 00:58
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.

2 participants