Skip to content

Conversation

@iHildy
Copy link
Owner

@iHildy iHildy commented Dec 31, 2025

Summary

Adds support for trailing commas in JSONC-config via parseJsonc, improves error handling on config load, and extends tests and workflow config.

Changes

  • Implement stripTrailingCommas in src/sync/config.ts and apply it in parseJsonc
  • Add parseJsonc tests in src/sync/config.test.ts
  • Harden startupSync to catch load errors and notify via toast
  • Make showToast resilient to failures (headless mode)
  • Add opencode.json and smoke workflow enhancements to wire opencode-synced plugin
  • Update package.json files field formatting and lint-staged config
  • Minor import updates for config tests to include parseJsonc

Testing

  • Run bun test to verify parseJsonc parsing and existing tests
  • Validate smoke workflow generates opencode-synced.jsonc and runs smoke tests

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @iHildy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the robustness and user-friendliness of configuration handling by introducing support for trailing commas in JSONC files, making configuration more flexible. It also bolsters error handling during config loading to provide clearer feedback to users and improves the reliability of toast notifications. Additionally, it includes minor updates to development workflow configurations.

Highlights

  • JSONC Trailing Commas Support: Implemented support for trailing commas in JSONC configuration files by introducing a stripTrailingCommas utility, enhancing flexibility in config authoring.
  • Enhanced Configuration Error Handling: Improved the startupSync process to gracefully handle errors during configuration loading, providing clearer feedback to the user via toast notifications.
  • Robust Toast Notifications: Made the showToast utility more resilient by wrapping its call in a try-catch block, ensuring it doesn't fail in headless environments or during early startup.
  • New parseJsonc Tests: Added dedicated unit tests for the parseJsonc function to verify its correct parsing of JSONC, including comments and trailing commas.
  • Workflow and Config Updates: Introduced an opencode.json file for plugin configuration and refined package.json formatting and lint-staged settings for consistency.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/opencode-smoke.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for trailing commas in JSONC configuration files and improves error handling. The implementation for stripping trailing commas in src/sync/config.ts is functional but could be made more efficient and maintainable by combining it with the existing comment-stripping logic to avoid parsing the string twice. Additionally, a new configuration file opencode.json has been added with a hardcoded local file path, which is a critical issue that needs to be addressed to ensure portability and prevent information leakage. The error handling improvements in src/sync/service.ts and src/sync/utils.ts are well-implemented and enhance the robustness of the plugin.

@iHildy
Copy link
Owner Author

iHildy commented Dec 31, 2025

I've addressed the reviewer feedback:

  • opencode.json: Removed the hardcoded absolute local path and unnecessary $schema. The file now contains an empty object {}.
  • src/sync/config.ts: Refactored parseJsonc to combine comment-stripping and trailing comma stripping into a single efficient pass, avoiding multiple string traversals and reducing code duplication.

Verified with bun test and bun run lint.

@iHildy iHildy merged commit 378bc1a into main Dec 31, 2025
3 checks passed
@iHildy iHildy deleted the feat/jsonc-trailing-commas branch December 31, 2025 23:39
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.

2 participants