Drop platform_overrides from resolved mcp_config; honour empty-string overrides#272
Open
aosmcleod wants to merge 1 commit into
Open
Drop platform_overrides from resolved mcp_config; honour empty-string overrides#272aosmcleod wants to merge 1 commit into
aosmcleod wants to merge 1 commit into
Conversation
…rrides getMcpConfigForManifest spreads the base mcp_config (including platform_overrides) and never removes it, so the full platform_overrides map — other platforms' commands/env included — leaked into the resolved runtime config handed to the host. Delete it after resolving. Also switch the command/args override merge from `||` to explicit `!== undefined` checks so a deliberate empty-string command (or empty args) override is honoured instead of silently falling back to the base value. Fixes modelcontextprotocol#265 (empty-string override is item 1 of modelcontextprotocol#267)
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.
Problems
getMcpConfigForManifestbuildsresultby spreading the basemcp_config(which includesplatform_overrides), applies the current platform's overrides, but never removes theplatform_overridesmap — so the resolved runtime config handed to the host still carries the entire block, including other platforms' commands/env.result.command = platformConfig.command || result.commanduses||, so a deliberate empty-string override is falsy and falls back to the base command.Fix
delete result.platform_overridesafter resolving (src/shared/config.ts).!== undefinedpresence checks for thecommand/argsoverride merge.Test
Adds cases to
test/config.test.ts: the resolved config has noplatform_overrides(incl. when an override exists for a non-current platform), and an empty-string command override is honoured. New assertions fail against the old code and pass with the fix.yarn lint+yarn test(config suite) green.Fixes #265.