Repository navigation
fix: validate JSON-RPC response IDs - #1335
Merged
kabir merged 3 commits intoNov 19, 2026
Merged
Conversation
ehsavoie
approved these changes
Nov 18, 2026
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.
Summary
Addresses the v1 path of #1331. The JSON-RPC transport generated an ID internally and discarded it, so it accepted results and errors with a different ID. This is a protocol-consistency check; no real deployment exhibiting cross-request HTTP response misrouting has been established, so its practical value remains a review question.
Generate and retain an ID per call and validate normal responses, SSE events and standard JSON-RPC preflight errors. Preserve explicit null-ID errors when the server cannot identify the request, and leave non-JSON-RPC middleware errors on their existing path. Treat stream errors as terminal, including when an event arrives before the stream future is bound. Update existing fixtures to return the actual request ID.
The shared response parser now accepts an explicit null ID for an error and handles an extended-agent-card error. The v0.3 path is handled separately in #1334.
Validation
mvn -q -pl client/transport/jsonrpc -am clean test(682 reactor tests passed).git diff --check.Follow-up: JDK 17 CI's NullAway check rejected passing
ref.get()to the non-null future binding. The follow-up commit binds the non-null returned future directly, retaining the early-callback cancellation logic. The local JSON-RPC reactor tests passed on JDK 25; JDK 17 CI on the new head remains to be verified.Follow-up: preserve middleware errors
At head
b8b5b3cb, non-2xx JSON-RPC-style error responses without anidretain the existing HTTP error path. A local HTTP server reproduced a regression for an HTTP 429 response: the initial PR replaced its HTTP error with an ID mismatch, whereas the baseline and follow-up preserve the HTTP status, body andRetry-Afterheader. The default JDK client's HTTP 401 path was also checked and was not affected by that regression. Explicit mismatched IDs and HTTP 200/SSE validation retain the PR's prior behavior.git diff --checkpassed. Remote CI will cover its configured matrix.