refactor(code-review): replace Python implementation with OpenCode + skills#74
Merged
refactor(code-review): replace Python implementation with OpenCode + skills#74
Conversation
…skills This replaces the custom Python code review bot with OpenCode, a mature AI coding agent. Instead of implementing our own agent loop and tools, we now provide skills that guide OpenCode to use the gh/glab CLIs directly. Changes: - Remove Python implementation (llm library, PyGitHub, python-gitlab) - Add OpenCode as the AI agent runtime - Create separate skills for GitHub and GitLab code review - Simplify entrypoint scripts to just invoke OpenCode - Update Dockerfile to use node:22-slim base image - Default model: google/gemini-3-flash-preview via OpenRouter - Support legacy OPENROUTER_KEY env var for backwards compatibility Benefits: - Simpler architecture - no custom agent loop to maintain - Battle-tested agent with auto-retry, compaction, etc. - Skills are easy to read and modify (just markdown) - Direct CLI usage is more transparent and debuggable Closes #67 Co-authored-by: Shelley <shelley@exe.dev>
OpenCode already knows OpenRouter models, and we pass --model and --provider explicitly in the scripts. Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
Pertempto
pushed a commit
that referenced
this pull request
Feb 11, 2026
- Fix unbound-variable risks in shell scripts by using safe fallbacks
(${VAR:-}) for OPENROUTER_KEY, GITHUB_TOKEN, and GL_TOKEN
- Make Dockerfile resilient to dpkg dependency issues with apt-get -f fallback
- Add duplicate review comment detection to both GitHub and GitLab skills,
instructing the agent to update existing bot comments instead of creating new ones
- Replace placeholder [#XX] with [#74] in CHANGELOG.md
Co-authored-by: Shelley <shelley@exe.dev>
Pertempto
pushed a commit
that referenced
this pull request
Feb 12, 2026
- Fix unbound-variable risks in shell scripts by using safe fallbacks
(${VAR:-}) for OPENROUTER_KEY, GITHUB_TOKEN, and GL_TOKEN
- Make Dockerfile resilient to dpkg dependency issues with apt-get -f fallback
- Add duplicate review comment detection to both GitHub and GitLab skills,
instructing the agent to update existing bot comments instead of creating new ones
- Replace placeholder [#XX] with [#74] in CHANGELOG.md
Co-authored-by: Shelley <shelley@exe.dev>
a4d5839 to
efdf37a
Compare
Pertempto
pushed a commit
that referenced
this pull request
Feb 12, 2026
- Fix unbound-variable risks in shell scripts by using safe fallbacks
(${VAR:-}) for OPENROUTER_KEY, GITHUB_TOKEN, and GL_TOKEN
- Make Dockerfile resilient to dpkg dependency issues with apt-get -f fallback
- Add duplicate review comment detection to both GitHub and GitLab skills,
instructing the agent to update existing bot comments instead of creating new ones
- Replace placeholder [#XX] with [#74] in CHANGELOG.md
Co-authored-by: Shelley <shelley@exe.dev>
efdf37a to
b56cf68
Compare
Pertempto
pushed a commit
that referenced
this pull request
Feb 12, 2026
- Fix unbound-variable risks in shell scripts by using safe fallbacks
(${VAR:-}) for OPENROUTER_KEY, GITHUB_TOKEN, and GL_TOKEN
- Make Dockerfile resilient to dpkg dependency issues with apt-get -f fallback
- Add duplicate review comment detection to both GitHub and GitLab skills,
instructing the agent to update existing bot comments instead of creating new ones
- Replace placeholder [#XX] with [#74] in CHANGELOG.md
Co-authored-by: Shelley <shelley@exe.dev>
b56cf68 to
d429aaa
Compare
Pertempto
pushed a commit
that referenced
this pull request
Feb 12, 2026
- Fix unbound-variable risks in shell scripts by using safe fallbacks
(${VAR:-}) for OPENROUTER_KEY, GITHUB_TOKEN, and GL_TOKEN
- Make Dockerfile resilient to dpkg dependency issues with apt-get -f fallback
- Add duplicate review comment detection to both GitHub and GitLab skills,
instructing the agent to update existing bot comments instead of creating new ones
- Replace placeholder [#XX] with [#74] in CHANGELOG.md
Co-authored-by: Shelley <shelley@exe.dev>
d429aaa to
d1d0852
Compare
Pertempto
pushed a commit
that referenced
this pull request
Feb 12, 2026
- Fix unbound-variable risks in shell scripts by using safe fallbacks
(${VAR:-}) for OPENROUTER_KEY, GITHUB_TOKEN, and GL_TOKEN
- Make Dockerfile resilient to dpkg dependency issues with apt-get -f fallback
- Add duplicate review comment detection to both GitHub and GitLab skills,
instructing the agent to update existing bot comments instead of creating new ones
- Replace placeholder [#XX] with [#74] in CHANGELOG.md
Co-authored-by: Shelley <shelley@exe.dev>
d1d0852 to
2f6aaf1
Compare
Pertempto
pushed a commit
that referenced
this pull request
Feb 12, 2026
- Fix unbound-variable risks in shell scripts by using safe fallbacks
(${VAR:-}) for OPENROUTER_KEY, GITHUB_TOKEN, and GL_TOKEN
- Make Dockerfile resilient to dpkg dependency issues with apt-get -f fallback
- Add duplicate review comment detection to both GitHub and GitLab skills,
instructing the agent to update existing bot comments instead of creating new ones
- Replace placeholder [#XX] with [#74] in CHANGELOG.md
Co-authored-by: Shelley <shelley@exe.dev>
2f6aaf1 to
d5229a0
Compare
- Fix unbound-variable risks in shell scripts by using safe fallbacks
(${VAR:-}) for OPENROUTER_KEY, GITHUB_TOKEN, and GL_TOKEN
- Make Dockerfile resilient to dpkg dependency issues with apt-get -f fallback
- Add duplicate review comment detection to both GitHub and GitLab skills,
instructing the agent to update existing bot comments instead of creating new ones
- Replace placeholder [#XX] with [#74] in CHANGELOG.md
Co-authored-by: Shelley <shelley@exe.dev>
d5229a0 to
add0ea0
Compare
--provider is not a valid opencode run flag. The model must be specified in provider/model format using -m, e.g.: opencode run -m openrouter/google/gemini-3-flash-preview This was causing opencode to print help text and exit 1. Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
…ing it opencode's -f flag is an array type, so it consumes the trailing positional message as another file argument. Adding -- separates options from the positional message argument. Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
- Change default model to minimax/minimax-m2.5:nitro - Capture OpenCode share link from output and append to review comment - Remove debug logging (--print-logs --log-level DEBUG) - Rewrite docs/code-review-bot.md (renamed from -setup suffix): architecture overview, skip logic table, configuration, RC process - Update README link to new docs path Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
OpenCode's model registry doesn't include OpenRouter routing variants. The model ID is minimax/minimax-m2.5, not minimax/minimax-m2.5:nitro. Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
…ability The agent reported truncated JSON when reading pr-metadata.json. Pretty-printing via jq makes the structured data easier to parse in the LLM context window. Co-authored-by: Shelley <shelley@exe.dev>
Switch from glab mr view text output to -F json piped through jq, consistent with the GitHub harness. Rename mr-metadata.txt to mr-metadata.json. Co-authored-by: Shelley <shelley@exe.dev>
Co-authored-by: Shelley <shelley@exe.dev>
This was referenced Feb 17, 2026
bambam955
requested changes
Feb 18, 2026
Contributor
bambam955
left a comment
There was a problem hiding this comment.
The bulk of this looks great. The harnesses look really good...I really like the optimizations with ensuring the bot only runs when it actually needs to. The *-code-review skills look really good too.
Just a few CI-related suggestions and then we should be good to go 👍
Amp-Thread-ID: https://ampcode.com/threads/T-019c7266-55fb-7492-bf73-96949d6329b1 Co-authored-by: Amp <amp@ampcode.com>
bambam955
approved these changes
Feb 19, 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.
Summary
Replaces the custom Python code review bot with OpenCode, a mature AI coding agent. Instead of implementing our own agent loop and tools, we now provide skills (markdown files) that guide OpenCode to review PRs/MRs.
Changes
llm, PyGitHub, python-gitlab, tests, system prompts)--fileshould_review.sh) skips trivial commits based on delta analysis[review]commit message tag to force a review regardless of delta<!-- reviewed-sha:... -->in bot comments to track what was reviewednode:22-slimwith OpenCode, gh, and glab CLIs-setupsuffix; update README linksminimax/minimax-m2.5via OpenRouterArchitecture
github_code_review.sh/gitlab_code_review.shshould_review.sh[review]force tag supportskills/github-code-review/SKILL.mdskills/gitlab-code-review/SKILL.mdDockerfilenode:22-slimwith OpenCode, gh, glab, jqHow It Works
should_review.shcomputes delta — skips if trivial, forced if[review]in commit message.bots/files--file.bots/review-body.mdSkip Logic
[review]Closes #67