Repository navigation
Conversation
|
|
This branch has not been deployed
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.
MCP enum choices such as
read-only,read_only, andREAD_ONLYcurrently end up with the same Python member name. Earlier choices get overwritten, so valid tool arguments disappear from the schema and fail validation.This gives conflicting member names a unique suffix without changing the values sent to the tool. It also handles collisions with generated names and avoids creating reserved Enum names when a value starts with an underscore.
I added nine focused tests for accepted values, rejected values, JSON schema output, and enums inside arrays. The original collision was reproduced before the fix, and all nine tests now pass using the real resolver and Pydantic. The test launcher stubs the unrelated browser and MCP imports; these are isolated schema tests, not browser or MCP-server integration tests.
Summary by cubic
Preserves every MCP enum choice even when their names normalize to the same Python member name, so earlier choices are no longer overwritten and valid tool arguments remain in the schema.
Bug Fixes
Written for commit 7bd9089. Summary will update on new commits.