Repository navigation
fix(mcp): preserve UTF-8 when reading JSONC configs - #1325
Open
AmitKulkarni23 wants to merge 1 commit into
Open
AmitKulkarni23 wants to merge 1 commit into
AmitKulkarni23 wants to merge 1 commit into
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.
The JSONC fallback converts each UTF-8 byte into a separate character, so installing MCP into a commented config changes existing keys and values such as
cafétocafé.Keep the original bytes while stripping comments and trailing commas, then convert the result back to UTF-8. Add regression coverage for Unicode keys and values, escaped strings, line and block comments, and trailing commas. Exercise all seven JSON-based MCP targets with each transport and verify that malformed configs remain unchanged.
Validation on macOS:
cargo test --locked: 1,862 unit tests and 30 integration tests passed; six existing tests ignored. The suite required an unrestricted run because the sandbox blockspsin the OpenCode lifecycle test.cargo check --lockedcargo clippy --locked --all-targets --all-features(existing repository warnings)cargo fmt --all -- --checkCloses #1312