Skip to content

Fix UTF-8 BOM in Windows mcp_config.json registration - #368

Open
tsiwt wants to merge 1 commit into
monk-io:mainfrom
tsiwt:fix/windows-mcp-config-utf8-bom
Open

Fix UTF-8 BOM in Windows mcp_config.json registration#368
tsiwt wants to merge 1 commit into
monk-io:mainfrom
tsiwt:fix/windows-mcp-config-utf8-bom

Conversation

@tsiwt

@tsiwt tsiwt commented Aug 29, 2026

Copy link
Copy Markdown

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.)

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant