Skip to content

feat(opencode): update AI provider configurations and model settings - #289

Merged
shunkakinoki merged 1 commit into
mainfrom
feat/update-opencode-config
Oct 12, 2025
Merged

feat(opencode): update AI provider configurations and model settings#289
shunkakinoki merged 1 commit into
mainfrom
feat/update-opencode-config

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Oct 12, 2025

Copy link
Copy Markdown
Owner

Summary

  • Updated opencode.jsonc with enhanced AI provider configurations
  • Added comprehensive model settings for LM Studio, Ollama, OpenAI, and OpenRouter
  • Configured reasoning effort levels and provider preferences for optimal AI interactions
  • Included plugin support for OpenAI Codex authentication

This update improves the AI tooling setup with better model availability and configuration options.


Summary by cubic

Switched the default model to grok-code, added a dedicated code-reviewer agent, and tuned the terminal UI scroll speed. Also set a small model fallback for lighter tasks.

  • New Features
    • Set model to grok-code; added small_model = kimi-k2.
    • Added agent "code-reviewer" using anthropic/claude-sonnet-4-20250514 with write/edit disabled and a focused review prompt.
    • Added TUI setting: scroll_speed = 3.

Copilot AI review requested due to automatic review settings October 12, 2025 14:30
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @shunkakinoki, 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 AI tooling setup by updating the opencode.jsonc configuration. It introduces a new default large language model, defines a dedicated small model, and integrates a specific code-reviewer agent with tailored settings. These changes aim to improve model availability, optimize AI interactions, and provide more granular control over the AI environment, ultimately refining the user's experience with AI-powered features.

Highlights

  • Updated AI Provider Configurations: The opencode.jsonc file has been updated to include more comprehensive AI provider and model settings, enhancing the overall AI tooling setup.
  • New Default Model and Small Model: The default model has been changed from kimi-k2 to grok-code, and a new small_model setting has been introduced, set to kimi-k2.
  • Added Code Reviewer Agent: A new code-reviewer agent configuration has been added, specifying its description, model (anthropic/claude-sonnet-4-20250514), prompt, and disabling write and edit tools for review-only functionality.
  • Introduced TUI Scroll Speed Setting: A new tui section with a scroll_speed setting (value 3) has been added to the configuration, likely for terminal user interface adjustments.
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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the OpenCode configuration by updating AI provider settings and model configurations for improved AI tooling capabilities. The changes focus on adding a specialized code review agent, updating default models, and configuring UI preferences.

  • Added a dedicated code-reviewer agent with Claude Sonnet model and restricted file modification tools
  • Updated primary model from "kimi-k2" to "grok-code" and added "small_model" configuration
  • Added TUI scroll speed configuration for better user experience

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@coderabbitai

coderabbitai Bot commented Oct 12, 2025

Copy link
Copy Markdown
📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added a built-in code-reviewer agent focused on security, performance, and maintainability with read-only operation.
    • Introduced a UI setting to control terminal scroll speed.
  • Improvements

    • Switched the default model to “grok-code” for coding tasks.
    • Added a lightweight “small_model” option set to “kimi-k2” for faster operations.
  • Chores

    • Minor configuration formatting cleanup without functional impact.

Walkthrough

Updates the OpenCode configuration: changes the root model to "grok-code", adds a root small_model "kimi-k2", introduces an agent.code-reviewer with settings and disabled write/edit tools, and adds a root tui block with scroll_speed. Provider and plugin structure remain, with minor formatting tweaks.

Changes

Cohort / File(s) Summary
OpenCode configuration
home-manager/modules/opencode/opencode.jsonc
- Root model changed: "kimi-k2" → "grok-code"
- Added root small_model: "kimi-k2"
- Added agent.code-reviewer with description, model "Claude Sonnet 4", prompt, tools: { write: false, edit: false }
- Added root tui.scroll_speed: 3
- Provider/plugins kept; minor formatting adjustment

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant CLI as OpenCode CLI
  participant Agent as Agent: code-reviewer
  participant LLM as Model Provider
  participant Tools as Tools (write/edit)

  User->>CLI: invoke code-review
  CLI->>Agent: start with prompt & config
  Note over Agent: Uses model: "Claude Sonnet 4"<br/>Focus: security/perf/maintainability
  Agent->>LLM: send review request
  LLM-->>Agent: review analysis
  Agent->>Tools: check permissions
  alt Tools disabled
    Note over Tools: write=false, edit=false
    Agent-->>CLI: return read-only review
  else Tools enabled
    Agent->>Tools: apply changes
    Tools-->>Agent: changes applied
    Agent-->>CLI: review + edits
  end
  CLI-->>User: display results (TUI scroll_speed=3)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I thump my paws at configs new,
A grok-code moon and kimi’s hue—
A reviewer bun with careful stare,
No nibbling edits, just prudent care.
Scrolls breeze by at speed of three,
Hippity-hop through quality.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly captures the primary changes in this PR by highlighting updates to AI provider configurations and model settings, which matches the modifications made to opencode.jsonc.
Description Check ✅ Passed The description provides a coherent summary of the opencode.jsonc modifications, including model switches, agent additions, and UI tuning, and relates directly to the changeset without diverging off-topic.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/update-opencode-config

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@shunkakinoki
shunkakinoki enabled auto-merge (squash) October 12, 2025 14:30

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

Copy link
Copy Markdown
Contributor

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 updates the opencode.jsonc configuration file, changing the default model, adding a new agent, and other settings. The changes are generally good, but I've identified a potential issue with how new models are specified. Both the new default model and the model for the code-reviewer agent are defined without an explicit link to a provider. This could cause the application to fail if it cannot automatically resolve them. My review includes suggestions to make these model configurations more explicit and robust, improving the maintainability of the file.

"$schema": "https://opencode.ai/config.json",
"theme": "opencode",
"model": "kimi-k2",
"model": "grok-code",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The default model has been changed to grok-code. However, this model is not explicitly defined under any of the configured providers (lmstudio, ollama, openai, openrouter). This reliance on implicit model resolution can make the configuration fragile. If the tool fails to find a provider for grok-code, it could lead to a runtime failure. It would be more robust to explicitly define this model under its provider, for instance, in the openrouter.models section if it's an OpenRouter model.

Comment on lines +8 to +17
"code-reviewer": {
"description": "Reviews code for best practices and potential issues",
"model": "anthropic/claude-sonnet-4-20250514",
"prompt": "You are a code reviewer. Focus on security, performance, and maintainability.",
"tools": {
// Disable file modification tools for review-only agent
"write": false,
"edit": false
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The model anthropic/claude-sonnet-4-20250514 is specified for the new code-reviewer agent without an explicit provider. This could lead to resolution issues if the tool cannot automatically determine which provider to use. To make the configuration more robust and self-documenting, I suggest explicitly defining the provider for this agent's model. Assuming openrouter is the intended provider, you could add a provider key.

    "code-reviewer": {
      "description": "Reviews code for best practices and potential issues",
      "model": "anthropic/claude-sonnet-4-20250514",
      "provider": "openrouter",
      "prompt": "You are a code reviewer. Focus on security, performance, and maintainability.",
      "tools": {
        // Disable file modification tools for review-only agent
        "write": false,
        "edit": false
      }
    }

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5edec9e and 4b3210d.

📒 Files selected for processing (1)
  • home-manager/modules/opencode/opencode.jsonc (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
home-manager/**

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

Keep home-manager configurations under home-manager/

Files:

  • home-manager/modules/opencode/opencode.jsonc
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: e2e-run (NixOS, ubuntu-latest)
  • GitHub Check: e2e-run (MacOS, macos-latest)
  • GitHub Check: e2e-run (Ubuntu, ubuntu-latest)
  • GitHub Check: nix-linux
  • GitHub Check: nix-nixos
  • GitHub Check: nix-darwin
  • GitHub Check: docker-build-push (linux/amd64, -amd64, amd64)

Comment on lines +4 to +5
"model": "grok-code",
"small_model": "kimi-k2",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Unmapped default model will break requests

The new default "model": "grok-code" is not declared under any provider block (lmstudio/ollama/openai/openrouter). With no matching provider config, OpenCode will fail resolving the default model and requests will error out. Either restore the previous default or add the corresponding provider/model mapping (e.g., via openrouter) before landing this change.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 1 file

@shunkakinoki
shunkakinoki merged commit faebfb9 into main Oct 12, 2025
23 checks passed
@shunkakinoki
shunkakinoki deleted the feat/update-opencode-config branch October 12, 2025 14:47
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