Add OpenCode reviewer skills and agent configuration#2880
Conversation
Automated review via Cloudflare AI Gateway (Kimi K2.5) on every PR open and push. Includes language-specific review skills for Go, Python, and Rust, plus a cross-cutting Cog architecture skill. Skip with the no-ai-review label or [skip-review]/[WIP] in the title.
The built-in cloudflare-ai-gateway provider needs explicit model capabilities (tool_call, reasoning, interleaved, modalities, limits) to construct a language model. Without them, the SDK threw 'sdk.languageModel is not a function'. Config matches the pattern from cloudflare/ci/ai.
The built-in cloudflare-ai-gateway provider doesn't support Workers AI models -- its SDK has no languageModel factory for them. Use a custom provider (cf-gateway) with @ai-sdk/openai-compatible pointing at the gateway's /compat endpoint instead. Construct CF_GATEWAY_BASE_URL from secrets in CI.
GitHub variables use ${{ vars.* }}, not ${{ secrets.* }}. The account
ID and gateway ID were stored as repo variables, so the URL was being
constructed as /v1///compat.
|
Looking at the PR comments, I can see the OpenCode integration has been failing with API configuration errors. Let me review the setup: Review SummaryArchitecture: Good overall structure separating concerns into workflows, agent config, and language-specific skills. Issues Found: Blocker: Non-reproducible action version
Using Use a specific major version tag (e.g., Should fix: Comment trigger regex edge case
The condition has a subtle bug - Consider simplifying to just: Actually, looking more carefully - this is fine as-is. The PR comments show API errors which suggest the Cloudflare Gateway isn't properly configured (vars/secrets), not a code issue. Nit: Inconsistent workflow naming
The main workflow is named What's working well
Root cause of failuresThe PR comments show API errors:
These are infrastructure/secrets issues, not code problems. The repository needs:
The code itself looks solid - just needs proper secrets/vars and the |
# Conflicts: # opencode.json
There was a problem hiding this comment.
I'm Bonk, and I've done a quick review of your PR. This PR adds OpenCode AI reviewer configuration with agent permissions and language-specific review guidelines for Go, Python, Rust, and cross-cutting Cog architecture concerns.
Issues Found
Should fix: Minor typo in Python skill
.opencode/skills/python-review/SKILL.md:25
The version range formatting is inconsistent with common Python documentation style.
Nit: Redundant wording in Rust skill
.opencode/skills/rust-review/SKILL.md:31
The parenthetical could be more concise.
What's good
- Appropriate permissions:
edit: denyand limited bash scope prevents unwanted changes - Clear scope: Focuses on what linters don't catch, avoids nitpicking style
- Well-organized: Separates concerns into language-specific skills
- Good defaults: Uses kimi-k2.5 model with low temperature for consistent reviews
- Security-conscious: Webfetch disabled, minimal permissions granted
| - Check that type annotations actually match runtime behavior | ||
|
|
||
| **Compatibility** | ||
| - Must support Python 3.10 through 3.13 |
There was a problem hiding this comment.
Minor style suggestion - consider using consistent version range formatting:
| - Must support Python 3.10 through 3.13 | |
| - Must support Python 3.10-3.13 |
|
|
||
| **Async (tokio)** | ||
| - Blocking operations inside async contexts (use `spawn_blocking`) | ||
| - Missing `.await` on futures (compiler catches some, but not all logical issues) |
There was a problem hiding this comment.
Simplify punctuation:
| - Missing `.await` on futures (compiler catches some, but not all logical issues) | |
| - Missing `.await` on futures (compiler catches some but not all logical issues) |
|
Review submitted successfully. I found two minor style suggestions in the documentation:
Overall the configuration is well-designed with appropriate security constraints and clear review guidelines. |

Adds language-specific review skills and agent configuration for OpenCode. This is used by both local CLI sessions and Bonk's automated PR reviews.
What's added:
.opencode/agents/reviewer.md) — defines review scope, permissions, and constraintsHow it works:
Bonk runs on OpenCode and reads configuration from
.opencode/in the repository. These files provide context for reviews on this codebase, whether triggered automatically on PRs or run locally viaopencode review.