Repository navigation
fix(unstable-v2): enforce elicitation scope and item discriminators - #2931
Merged
Merged
Conversation
Merged
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 otherwise method-specific
elicitation/createvalidations accepted the wrong payload:toolCallIdonly belongs to session scope, including when its value is null. Unrelated extra fields remain valid.itemswithtype: "string"must satisfy the string variant. A strayanyOfno longer turns a malformed stringenuminto a titled control. Titled items omittype. A genuinely unknown stringtypestill takes the extensible branch.This changes v2 Rust dispatch and both v2 schemas, not v1. Adds Rust regressions and keeps published-schema validation in npm.
npm run test:json-schema(also innpm run checkand CI) compiles all four Draft 2020-12 roots and all 966 public definitions in strict Ajv. It checks all 391 complete JSON-RPC examples across the matching protocol guides; the migration guide mixes versions and is not used. Unknown keywords and formats fail compilation unless explicitly registered. URI and date-time are asserted, with invalid-value controls; numeric formats are annotations, with limits enforced by schema bounds. The separate envelope change builds on these payload validators.Validation:
npm run generate,npm run check, the v2 no-default-feature Rust elicitation tests, and the TypeScript SDK generator and typecheck with the candidate schemas.Stacked follow-up: #2932 uses these payloads for whole-message validation. For both v2 publications, TypeScript SDK
1db9118generated byte-identical bindings with and without the threepropertyNamesconstraints. Generation, typecheck and build passed. Its Zod reader accepts a request-scopedtoolCallId(evennull) and malformed string multi-select items with a titledanyOf; the published schema and Rust request decoder reject both. Python SDK0459667also emitted identicalschema.pywith and without the constraints. Its full Draft pipeline hit the same unrelated missingCreateOtherSessionElicitationRequestin both cases. Strict SDK readers need their own coverage for the excluded keys.