fix(mcp): report malformed JSON config instead of falling back to INI#41909
Conversation
`loadConfig` fell back to INI parsing on any JSON error, so a typo'd JSON config (e.g. a trailing comma) was silently accepted as INI: the intended settings were dropped for the defaults and the raw JSON kept as an unused top-level key
surface the original `SyntaxError` when the input is a JSON object (`{`) while keeping the INI fallback (including files whose first line is a `[section]` header) and BOM handling
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
yury-s
left a comment
There was a problem hiding this comment.
Maybe it's time to make .ini support official or drop it? @pavelfeldman wdyt?
Test results for "MCP"2 failed 7790 passed, 1269 skipped Merge workflow run. |
|
Hi, I'm the Playwright bot and I took a first look at the failing CI. 🟡 Uncertain, but both failures lean hard toward pre-existing flakesTwo Windows-only MCP failures, neither on the config-parsing path this PR touches. One is a known pre-existing flake; the other I can't stamp outright because its only failure in the results DB is this PR's own run. DetailsThis PR changes only Pre-existing flake / infra
Uncertain (almost certainly a flake)
Caused by this PR
To close out the uncertain one, a green re-run of the current head ( Triaged by the Playwright bot - agent run |
loadConfigfell back to INI parsing on any JSON error, so a typo'd JSON config (e.g. a trailing comma) was silently accepted as INI: the intended settings were dropped for the defaults and the raw JSON kept as an unused top-level keysurface the original
SyntaxErrorwhen the input is a JSON object ({) while keeping the INI fallback (including files whose first line is a[section]header) and BOM handlingfixes #41893