Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
eca8fa4
wip: zen
fwang Jan 9, 2026
77da9ee
Add multi-provider code review to GitHub Action
keithah Jan 9, 2026
6580719
Add multi-review-script.ts for GitHub Actions
keithah Jan 9, 2026
7cb1c72
Add provider attribution to review comments
keithah Jan 10, 2026
875b32b
Update template with provider attribution
keithah Jan 10, 2026
491d817
Add Claude Code style formatting and provider confidence scores
keithah Jan 10, 2026
9d07eae
Add OpenCode branding and remove persistent review messages
keithah Jan 10, 2026
438e15b
Remove OpenCode branding, keep clean multi-provider identity
keithah Jan 10, 2026
f3003e3
Add Claude Code style output with live checklist updates
keithah Jan 10, 2026
f727c60
Improve checklist timing and workflow branding
keithah Jan 10, 2026
4fd2c89
Fix GH_TOKEN environment variable for gh commands
keithah Jan 10, 2026
cc94a04
Fix script download URL and add error handling
keithah Jan 10, 2026
355ea34
Add error handling for PR data reading and fix prompt building
keithah Jan 10, 2026
e33c6e4
Fix PR data reading by using environment variables instead of file
keithah Jan 10, 2026
8d5c6d0
Fix PR body extraction with proper escaping and multiline output
keithah Jan 10, 2026
7034c27
Fix buildPrompt to use PR_BODY environment variable
keithah Jan 10, 2026
2f3b3b0
Fix multi-provider review script and workflow
keithah Jan 10, 2026
fd00cec
Add retry logic to opencode installation
keithah Jan 10, 2026
fbb9ad9
Fix Bun compatibility and GitHub token issues
keithah Jan 10, 2026
146c29b
Fix Bun compatibility with child_process
keithah Jan 10, 2026
7228b6c
Update to use multi-provider-code-review GitHub Action
keithah Jan 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,15 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENCODE_PERMISSION: '{ "bash": { "*": "deny", "gh*": "allow", "gh pr review*": "deny" } }'
PR_TITLE: ${{ steps.pr-details.outputs.title }}
REVIEW_PROVIDERS: "opencode/big-pickle,opencode/grok-code,opencode/minimax-m2.1-free,opencode/glm-4.7-free"
run: |
PR_BODY=$(jq -r .body pr_data.json)
opencode run -m anthropic/claude-opus-4-5 "A new pull request has been created: '${PR_TITLE}'
PR_NUMBER="${{ steps.pr-number.outputs.number }}"

export REVIEW_PROMPT="A new pull request has been created: '${PR_TITLE}'

<pr-number>
${{ steps.pr-number.outputs.number }}
$PR_NUMBER
</pr-number>

<pr-description>
Expand All @@ -64,20 +67,22 @@ jobs:
Please check all the code changes in this pull request against the style guide, also look for any bugs if they exist. Diffs are important but make sure you read the entire file to get proper context. Make it clear the suggestions are merely suggestions and the human can decide what to do

When critiquing code against the style guide, be sure that the code is ACTUALLY in violation, don't complain about else statements if they already use early returns there. You may complain about excessive nesting though, regardless of else statement usage.
When critiquing code style don't be a zealot, we don't like "let" statements but sometimes they are the simplest option, if someone does a bunch of nesting with let, they should consider using iife (see packages/opencode/src/util.iife.ts)
When critiquing code style don't be a zealot, we don't like \"let\" statements but sometimes they are the simplest option, if someone does a bunch of nesting with let, they should consider using iife (see packages/opencode/src/util.iife.ts)

Use the gh cli to create comments on the files for the violations. Try to leave the comment on the exact line number. If you have a suggested fix include it in a suggestion code block.
If you are writing suggested fixes, BE SURE THAT the change you are recommending is actually valid typescript, often I have seen missing closing "}" or other syntax errors.
If you are writing suggested fixes, BE SURE THAT the change you are recommending is actually valid typescript, often I have seen missing closing \"}\" or other syntax errors.
Generally, write a comment instead of writing suggested change if you can help it.

Command MUST be like this.
\`\`\`
gh api \
--method POST \
-H \"Accept: application/vnd.github+json\" \
-H \"X-GitHub-Api-Version: 2022-11-28\" \
/repos/${{ github.repository }}/pulls/${{ steps.pr-number.outputs.number }}/comments \
gh api \\
--method POST \\
-H \"Accept: application/vnd.github+json\" \\
-H \"X-GitHub-Api-Version: 2022-11-28\" \\
/repos/${{ github.repository }}/pulls/$PR_NUMBER/comments \\
-f 'body=[summary of issue]' -f 'commit_id=${{ steps.pr-details.outputs.sha }}' -f 'path=[path-to-file]' -F \"line=[line]\" -f 'side=RIGHT'
\`\`\`

Only create comments for actual violations. If the code follows all guidelines, comment on the issue using gh cli: 'lgtm' AND NOTHING ELSE!!!!."

bun run github/multi-review.ts
49 changes: 49 additions & 0 deletions github/MULTI_REVIEW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Multi-Provider Code Review

This feature allows the GitHub Action to run code reviews simultaneously with multiple AI providers and then synthesize their results into a comprehensive review.

## How It Works

1. **Parallel Reviews**: The workflow runs reviews with multiple providers simultaneously using `Promise.all`
2. **Aggregation**: All individual reviews are collected and formatted
3. **Synthesis**: A designated synthesis model combines overlapping feedback, highlights unique insights, and removes duplicates

## Configuration

The providers are configured via the `REVIEW_PROVIDERS` environment variable in `.github/workflows/review.yml`:

```yaml
REVIEW_PROVIDERS: "opencode/big-pickle,opencode/grok-code,opencode/minimax-m2.1-free,opencode/glm-4.7-free"
```

### Current Free Providers

- `opencode/big-pickle` - Large reasoning model
- `opencode/grok-code` - Code-specialized model
- `opencode/minimax-m2.1-free` - Free tier model
- `opencode/glm-4.7-free` - Free GLM model

## Adding New Providers

To add or change providers:

1. Edit the `REVIEW_PROVIDERS` variable in `.github/workflows/review.yml`
2. Use the format `provider/model` (e.g., `opencode/big-pickle`)
3. Separate multiple providers with commas

## Script Details

The `github/multi-review.ts` script handles:

- Running parallel reviews with error handling
- 5-minute timeout per provider
- Graceful fallback if a provider fails
- Synthesis using the first provider in the list
- Proper logging and status reporting

## Benefits

- **Comprehensive Reviews**: Multiple perspectives catch different issues
- **Redundancy**: If one provider fails, others continue
- **Cost Efficiency**: Uses free providers
- **Quality Synthesis**: Combines the best insights from all reviews
87 changes: 87 additions & 0 deletions github/multi-provider-review-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: 🤖 Multi-Provider Code Review

on:
pull_request:
types: [opened, synchronize, reopened]
issue_comment:
types: [created]

jobs:
check-guidelines:
if: |
(github.event_name == 'pull_request') ||
(github.event.issue.pull_request &&
(startsWith(github.event.comment.body, '/review') ||
contains(github.event.comment.body, '@opencode') ||
contains(github.event.comment.body, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Get PR number
id: pr-number
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "number=${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT
else
echo "number=${{ github.event.issue.number }}" >> $GITHUB_OUTPUT
fi

- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Install opencode
run: curl -fsSL https://opencode.ai/install | bash

- name: Get PR details
id: pr-details
run: |
gh api /repos/${{ github.repository }}/pulls/${{ steps.pr-number.outputs.number }} > pr_data.json
echo "title=$(jq -r .title pr_data.json)" >> $GITHUB_OUTPUT
echo "sha=$(jq -r .head.sha pr_data.json)" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check for AGENTS.md
id: agents-md
run: |
if [ -f AGENTS.md ]; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi

- name: Get PR body
id: pr-body
run: |
PR_BODY=$(gh api /repos/${{ github.repository }}/pulls/${{ steps.pr-number.outputs.number }} --jq .body | tr '\n' ' ' | sed 's/"/\\"/g')
echo "body<<EOF" >> $GITHUB_OUTPUT
echo "$PR_BODY" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run Multi-Provider Review
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REVIEW_PROVIDERS: ${{ vars.REVIEW_PROVIDERS || 'opencode/big-pickle,opencode/grok-code,opencode/minimax-m2.1-free,opencode/glm-4.7-free' }}
PR_TITLE: ${{ steps.pr-details.outputs.title }}
PR_NUMBER: ${{ steps.pr-number.outputs.number }}
PR_BODY: ${{ steps.pr-body.outputs.body }}
HAS_AGENTS: ${{ steps.agents-md.outputs.exists || 'false' }}
run: |
cp github/multi-review-script.ts multi-review.ts

if [ "$HAS_AGENTS" = "true" ]; then
export INCLUDE_AGENTS=true
fi

bun run multi-review.ts
91 changes: 91 additions & 0 deletions github/multi-provider-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Multi-Provider Code Review

on:
pull_request:
types: [opened, synchronize, reopened]
issue_comment:
types: [created]

jobs:
review:
if: |
(github.event_name == 'pull_request') ||
(github.event.issue.pull_request &&
(startsWith(github.event.comment.body, '/review') ||
contains(github.event.comment.body, '@opencode') ||
contains(github.event.comment.body, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Get PR number
id: pr-number
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "number=${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT
else
echo "number=${{ github.event.issue.number }}" >> $GITHUB_OUTPUT
fi

- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Install opencode
run: |
for i in {1..3}; do
echo "Attempt $i of 3 to install opencode..."
if curl -fsSL https://opencode.ai/install | bash; then
echo "opencode installed successfully"
exit 0
fi
echo "Attempt $i failed, waiting 5 seconds before retry..."
sleep 5
done
echo "Failed to install opencode after 3 attempts"
exit 1

- name: Get PR details
id: pr-details
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api /repos/${{ github.repository }}/pulls/${{ steps.pr-number.outputs.number }} > pr_data.json
echo "title=$(jq -r .title pr_data.json)" >> $GITHUB_OUTPUT
echo "sha=$(jq -r .head.sha pr_data.json)" >> $GITHUB_OUTPUT

- name: Get PR body
id: pr-body
env:
GH_TOKEN: ${{ github.token }}
run: |
PR_BODY=$(gh api /repos/${{ github.repository }}/pulls/${{ steps.pr-number.outputs.number }} --jq .body | tr '\n' ' ' | sed 's/"/\\"/g')
echo "body<<EOF" >> $GITHUB_OUTPUT
echo "$PR_BODY" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: Check for AGENTS.md
id: agents-md
run: |
if [ -f AGENTS.md ]; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi

- name: Run Multi-Provider Review
uses: keithah/multi-provider-code-review@main
with:
GITHUB_TOKEN: ${{ github.token }}
REVIEW_PROVIDERS: ${{ vars.REVIEW_PROVIDERS || 'opencode/big-pickle,opencode/grok-code,opencode/minimax-m2.1-free,opencode/glm-4.7-free' }}
PR_TITLE: ${{ steps.pr-details.outputs.title }}
PR_NUMBER: ${{ steps.pr-number.outputs.number }}
PR_BODY: ${{ steps.pr-body.outputs.body }}
HAS_AGENTS: ${{ steps.agents-md.outputs.exists || 'false' }}
Loading