feat(config): add JSONC config file support#31
Merged
Conversation
2ace15a to
a9215a2
Compare
Support opencode.jsonc and micode.jsonc config files with comments and trailing commas, matching OpenCode's own JSONC parsing behavior. - Add jsonc-parser dependency (same library OpenCode uses) - Try .jsonc files first, fall back to .json for backward compatibility - Update loadOpencodeConfig, loadModelContextLimits, loadMicodeConfig - Add 17 new tests covering JSONC parsing, file precedence, fallback
There was a problem hiding this comment.
1 issue found across 5 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/config-loader.ts">
<violation number="1" location="src/config-loader.ts:29">
P1: `jsonc-parser` is used without checking parse errors, so malformed config may be accepted as partial data instead of being rejected.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
a9215a2 to
d59d4bd
Compare
Check parse errors from jsonc-parser and throw on malformed input. Callers already have try/catch that returns null on failure.
This was referenced Mar 10, 2026
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.
Support opencode.jsonc and micode.jsonc config files with comments and trailing commas, matching OpenCode's own JSONC parsing behavior.