refactor(code-review): replace Python implementation with OpenCode + skills#74
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>
|
Please update the script to avoid unbound-var expansions so it runs reliably in CI. |
OpenCode already knows OpenRouter models, and we pass --model and --provider explicitly in the scripts. Co-authored-by: Shelley <shelley@exe.dev>
|
Please update the Dockerfile to handle |
|
Please update the skill docs to instruct the agent to avoid duplicate overall review comments. |
Co-authored-by: Shelley <shelley@exe.dev>
Changes RequestedPlease address the high-impact items below before merging:
Summary of Changes
Overall Feedback
@Pertempto — make the requested updates and I will re-review. |
|
Please either:
Actionable: include a minimal |
|
I noticed the PR removes the entire Python implementation and tests (e.g., Please confirm this is intentional and:
This is a high-impact change (removing tests) and needs explicit confirmation or follow-up in the PR. |
|
Please update |
- 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>
|
|
- 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
- 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
- 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
- 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
- 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
- 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
|
@Pertempto Quick clarification: did you intend for OpenCode to discover skills implicitly from This will prevent runtime failures where |
|
@Pertempto Please authenticate # Authenticate gh CLI
echo "$GH_TOKEN" | gh auth login --with-token(or use |
Summary
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/glabCLIs directly.Changes
llmlibrary, PyGitHub, python-gitlab)node:22-slimbase imagegoogle/gemini-3-flash-previewvia OpenRouterOPENROUTER_KEYenv var for backwards compatibilityBenefits
Files
skills/github-code-review/SKILL.mdskills/gitlab-code-review/SKILL.mdopencode.jsonDockerfileTesting
The existing workflows are unchanged - they should work with the new implementation. The Docker image needs to be built and tested in CI.
Note
This PR does not modify the GitHub Actions workflows (would require
workflowscope). The existing workflows useOPENROUTER_KEYwhich is mapped toOPENROUTER_API_KEYin the scripts for backwards compatibility.Closes #67