Skip to content

fix(config): read UTF-8 BOM-prefixed config files - #697

Merged
nicobailon merged 2 commits into
nicobailon:mainfrom
quifox:fix/read-utf8-bom-config
Sep 27, 2026
Merged

nicobailon merged 2 commits into
nicobailon:mainfrom
quifox:fix/read-utf8-bom-config

Conversation

@quifox

@quifox quifox commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Accept a leading UTF-8 BOM in adapter, shared, and imported JSON config files, as well as imported TOML config files.
  • Let init update a BOM-prefixed adapter config while preserving existing servers.
  • Keep BOM characters inside JSON string values unchanged.

Verification

  • npm run typecheck
  • vitest run __tests__/utils-parse-json.test.ts __tests__/config.test.ts __tests__/cli.test.ts (114 passed)
  • npm run test:public-exports (4 passed)

@greptile-apps

greptile-apps Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Adds UTF-8 BOM stripping to config file parsing.

The PR appears safe to merge.

Summary

The PR makes BOM-prefixed MCP configuration files readable without changing BOM characters inside JSON strings.

  • Covers adapter, shared, and imported JSON configs, plus imported TOML configs.
  • Lets init retain existing servers when updating a BOM-prefixed adapter config.
  • Adds focused parsing, config-loading, and CLI tests.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[JSON config] --> B[Remove leading BOM]
  B --> C[Parse JSON with comments]
  D[Imported TOML config] --> E[Remove leading BOM]
  E --> F[Parse TOML]
  G[init adapter config] --> H[Remove leading BOM]
  H --> I[Parse and update existing config]
Loading

Reviews (4) · Last reviewed commit: "docs(changelog): credit BOM config fix"

@nicobailon
nicobailon force-pushed the fix/read-utf8-bom-config branch from 92ac593 to f23d395 Compare September 27, 2026 13:01
@nicobailon
nicobailon merged commit 1416386 into nicobailon:main Sep 27, 2026
4 checks passed
@nicobailon

Copy link
Copy Markdown
Owner

Merged, thanks @quifox! I added a changelog entry crediting you.

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.

2 participants