Skip to content

fix(jsonc): accept one leading UTF-8 BOM - #8205

Draft
oocheol wants to merge 1 commit into
lidge-jun:devfrom
oocheol:codex/fix-jsonc-leading-bom-20261106
Draft

oocheol wants to merge 1 commit into
lidge-jun:devfrom
oocheol:codex/fix-jsonc-leading-bom-20261106

Conversation

@oocheol

@oocheol oocheol commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Accept one leading UTF-8 BOM when reading JSONC. Some Windows editors emit it, but the shared reader forwarded it to JSON.parse, causing valid OpenCode/Kilo configs to be treated as malformed and hiding OpenCode provider-override detection.
  • Remove the marker before comment/trailing-comma normalization and the existing rewrite-safety scan. BOM characters inside strings stay byte-identical; repeated or misplaced BOMs and malformed documents remain invalid. Strict JSON mode is unchanged.
  • Add nine regression cases, including the managed JSONC consumer. Update the English/Korean OpenCode guides and integration contract.

Verification

Windows; Bun 1.4.4; based on freshly fetched dev d0c8151a720ac2a42d32eea9b4fb76bff0072dc6.

  • Red/green: bun test --no-env-file --isolate ./tests/lib/fix-jsonc-cr-comments.test.ts --timeout 30000 failed 5 cases on the old implementation (9 passed).
  • bun run test:changed ./tests/lib/fix-jsonc-cr-comments.test.ts ./tests/lib/fix-jsonc-empty-comma.test.ts ./tests/clients/kilo-client.test.ts ./tests/clients/opencode-kilo-refresh.test.ts ./tests/clients/integrations-merge.test.ts --parallel=1 --timeout 30000 — 86 passed / 0 failed / 1 skipped / 384 assertions, 5 files, 31.04 seconds. The existing Windows-specific skip is an unsafe second candidate refuses before touching the selected file.
  • bun run typecheck — passed, 2,317 files.
  • bun run structure:check, bun scripts/file-size-ratchet.ts, bun run privacy:scan, git diff --check — passed.
  • cd docs-site; bun install --frozen-lockfile; bun run build — passed, 641 pages / 93,150 checked internal links. Existing chunk-size warnings remain.

The changed-test run is deliberately restricted to the listed files, with OCX_TEST_MAIN_TIMEOUT_MS=120000. A previous unrestricted import-graph run on this Windows host reached 900 seconds with timing/teardown failures; it is not passing evidence for this head. The full graph/full suite and non-Windows execution remain unverified and are left to CI/independent review. No live client configuration was read or changed. This PR remains Draft.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. Existing depth/numeric rewrite guards, credential handling and write ownership remain unchanged.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • Required local validation passed; commands, results, and any full-suite exception are documented.

  • I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • review readiness checklist open (0/4 boxes ticked).

What to do

  • Tick all four boxes in the PR description once you're done (currently 0/4).

Review readiness checklist

  • ⬜ Required local validation passed; commands, results, and any full-suite exception are documented.
  • ⬜ I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
  • ⬜ I resolved all correct Codex and CodeRabbit findings.
  • ⬜ My PR is ready for review.

0/4 boxes ticked.

This PR stays in draft until every box above is ticked.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant