Repository navigation
fix(config): preserve quoted strings when stripping JSONC trailing commas - #411
Merged
EyJunge1 merged 2 commits intoOct 15, 2026
Merged
Conversation
Avoid a second string scanner after comment stripping; detect trailing commas in the existing state machine while peeking past whitespace and comments.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The trailing-comma regex also removed commas inside quoted JSONC strings. Settings such as
memoryExtraParams.stop: [",}", ",]"]became["}", "]"], and astoragePathcontaining 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
bun run checkpasses on both, and patchedbun run typecheckpasses.bun testis 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
main.bun testpasses — the baseline-matched failures above remain.bun run typecheckpasses.bun run checkpasses (format + lint + typecheck).AI assistance was used for implementation and testing, including review by a coordinating AI agent.