Conversation
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.
Problem
Codex App Server's
McpServerElicitationRequestParamsJSON Schema combines shared object properties with aoneOfwhose branches are distinguished by disjointmodevalues. Several branches also contain a wildcard (true) property schema.cargo typify0.8.0 panics inmerge_schema_notwhen it subtracts another branch that cannot match the already-merged branch.This follows the shared-properties case in #272 and the
notmerge work in #829 / #831. The broadernothandling issue remains #489.Fix
Before subtracting another
oneOfbranch, check whether it can intersect the current merged branch. If the intersection is unsatisfiable, the branch is already excluded and nonotschema is needed. Keep the existing subtraction path for overlapping branches.Add a small schema fixture with the same shared-properties, disjoint-mode, and wildcard-property shape. The generated Rust snapshot verifies that both variants retain
serverName,threadId,mode,requestedSchema, and_meta. A merge unit test checks those fields after the branch merge.Verification
cargo test -p typify-impl --lib(114 passed)cargo test -p typify --test schemas test_schemas(passed)cargo fmt --all -- --check(passed)McpServerElicitationRequestParams.jsongenerates successfully with this change; it panics atmerge.rs:426on typify 0.8.0 without the change.