Skip to content

fix(config): preserve quoted strings when stripping JSONC trailing commas - #411

Merged
EyJunge1 merged 2 commits into
tickernelz:mainfrom
March-7:codex/jsonc-string-preservation
Oct 15, 2026
Merged

EyJunge1 merged 2 commits into
tickernelz:mainfrom
March-7:codex/jsonc-string-preservation

Conversation

@March-7

@March-7 March-7 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Summary

The trailing-comma regex also removed commas inside quoted JSONC strings. Settings such as memoryExtraParams.stop: [",}", ",]"] became ["}", "]"], and a storagePath containing the same punctuation changed during configuration loading.

Replace that regex with a string-aware scan that removes structural trailing commas while preserving quoted keys and values. Add parser regressions and a configuration-to-provider-parameters regression. No dependencies or configuration precedence changes.

Test plan

  • Exercised the change locally: focused Bun parser/config suites go from 18 passed / 9 failed to 27 passed; independent real-file configuration cases go from 2/7 to 7/7. No model or HTTP calls.
  • Compared 2,000 deterministic JSON/JSONC cases against jsonc-parser 3.3.1.
  • Built both the unchanged baseline and patched checkout; full bun run check passes on both, and patched bun run typecheck passes.
  • Noted limitations: complete bun test is not green in this environment. Baseline: 731 passed, 4 skipped, 32 failed (767 tests). Patched: 742 passed, 4 skipped, 32 failed (778 tests). All 32 failure IDs and diagnostics match after normalizing temporary directory names. Failures include child processes denied access to the real home directory and dependent lock-worker errors. This does not establish a passing full suite outside this environment.

The complete runs used the same original parent-process home adapter and model-download barrier; no inherited child preload options. An intermediate experimental runner had an argument-parsing error that recursively spawned Bun; it was stopped and excluded from the comparison. No production or upstream test changes were made to hide these environment failures.

Checklist

  • Branch is based on main.
  • bun test passes — the baseline-matched failures above remain.
  • bun run typecheck passes.
  • bun run check passes (format + lint + typecheck).
  • Docs / README: not needed; existing JSONC configuration syntax and intended values are preserved.

AI assistance was used for implementation and testing, including review by a coordinating AI agent.

Copilot AI balanced review requested due to automatic review settings October 15, 2026 14:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Avoid a second string scanner after comment stripping; detect trailing
commas in the existing state machine while peeking past whitespace and
comments.
@EyJunge1
EyJunge1 merged commit 552825f into tickernelz:main Oct 15, 2026
6 checks passed
@EyJunge1 EyJunge1 mentioned this pull request Oct 15, 2026
5 of 8 tasks
dmr48rus pushed a commit to dmr48rus/opencode-mem that referenced this pull request Oct 16, 2026
…mmas (tickernelz#411)

* fix(config): preserve quoted JSONC strings

* fix(config): fold JSONC trailing-comma strip into one pass

Avoid a second string scanner after comment stripping; detect trailing
commas in the existing state machine while peeking past whitespace and
comments.

---------

Co-authored-by: EyJunge1 <149941075+EyJunge1@users.noreply.github.com>
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.

3 participants