Skip to content

fix(config): accept server config with a UTF-8 BOM - #205

Merged
PatrickSys merged 1 commit into
masterfrom
fix/server-config-utf8-bom-20261205b
Dec 5, 2026
Merged

PatrickSys merged 1 commit into
masterfrom
fix/server-config-utf8-bom-20261205b

Conversation

@PatrickSys

Copy link
Copy Markdown
Owner

Windows PowerShell 5.1 writes a UTF-8 byte-order mark (BOM) with Set-Content -Encoding UTF8. CBC rejected the whole server config, so registered project roots were ignored and HTTP fell back to port 3100.

Reproduce

From a built checkout, run this in Windows PowerShell 5.1:

$config = Join-Path ([System.IO.Path]::GetTempPath()) 'cbc-bom-config.json'
'{"projects":[{"root":"."}],"server":{"port":4242}}' | Set-Content -LiteralPath $config -Encoding UTF8
$env:CODEBASE_CONTEXT_CONFIG_PATH = $config
node dist/index.js --http

The fixed server reads the project roots and listens on port 4242. The config loader now strips one leading BOM before parsing JSON. The regression test checks that both settings survive.

Verification

  • The regression failed before the fix. All 36 tests in tests/server-config.test.ts passed after it.
  • pnpm test passed across 168 test files with 1,595 tests passed and 2 skipped.
  • pnpm build, pnpm type-check, pnpm format:check, and pnpm lint passed. ESLint reported 150 warnings and zero errors.
  • The built server returned HTTP 200 on the port specified by an actual Windows PowerShell 5.1 config file.

Agent: Codex 01a2446c-e11a-7171-a00b-3b043ca6e986
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-05T04:36:36.785813Z ffd926a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge.

Summary

loadServerConfig now accepts JSON files with one leading UTF-8 BOM.

  • Server configs with a leading BOM now load their settings.

Reviews (1) · Last reviewed commit: "fix(config): read UTF-8 BOM in server co..." · Reviewed by Greptile

@PatrickSys
PatrickSys merged commit 9d5e162 into master Dec 5, 2026
5 checks passed
@PatrickSys
PatrickSys deleted the fix/server-config-utf8-bom-20261205b branch December 5, 2026 04:52
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