Fix UTF-8 BOM in Windows mcp_config.json registration - #368
Open
tsiwt wants to merge 1 commit into
Open
Conversation
Windows PowerShell 5.1 (the pinned launcher runtime, ENG-441) writes a UTF-8 BOM with Set-Content -Encoding UTF8, which Antigravity's MCP config parser rejects. Write BOM-free UTF-8 via WriteAllText instead, keeping the three shipped launcher copies byte-identical. Adds a regression test that reproduces the BOM under 5.1 and verifies BOM-free output on both 5.1 and PowerShell 7, wired into the windows CI. Refs monk-io#367.
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.
Fixes the bug reported in #367.\n\n\Set-Content -Encoding UTF8\ under Windows PowerShell 5.1 (the pinned launcher runtime, ENGINE-441) writes a UTF-8 BOM into mcp_config.json; Antigravity's MCP config parser does not accept a BOM-prefixed config. The POSIX launcher already writes BOM-free via jq/python3.\n\nFix: write the JSON with [System.IO.File]::WriteAllText\ + \UTF8Encoding(\False)\ (BOM-free on both 5.1 and 7), keeping the three shipped launcher copies byte-identical.\n\nRegression test (\ ests/register-antigravity-mcp.ps1): extracts the real \Register-AntigravityMcp\ body from the shipped script and asserts the written \mcp_config.json\ has no BOM and registers the expected serverURL. Verified red-on-old / green-on-fixed under Windows PowerShell 5.1 locally, and wired to run under both 5.1 (\powershell.exe) and 7 (\pwsh) on the windows CI job. (The bug only reproduces on 5.1, so the dual-host run matters.)