Reviewer Agent
A code review agent that automatically reviews open pull requests, runs checks, fixes failures, and merges approved PRs.Setup
- Copy
agent-config.tomlandACTIONS.mdintoagents/reviewer/in your project - Edit
agent-config.toml:- Set
orgsto your GitHub organization - Set
authorin[params]to filter PRs by author (optional)
- Set
- Run
al doctorto verify credentials
Trigger modes
Webhook (recommended): Fires on PR events (opened, synchronize, ready_for_review) and when check suites complete. Requires a GitHub webhook configured in config.toml — see Webhooks docs.
Scheduled: Runs on a cron schedule (default: hourly). Searches for open PRs across the configured organization.
How it works
Each run, the agent works on one PR:- Finds a PR to review (from webhook trigger or scheduled search)
- Acquires a resource lock to prevent duplicate reviews
- Clones the repo and checks out the PR branch
- Reviews code for security issues and quality
- Runs tests, lint, and build — fixes failures (up to 3 rounds)
- Squash-merges if all checks pass, or comments with issues found
Custom Dockerfile
The reviewer agent uses thegh CLI, which isn’t in the base image. Add a Dockerfile to the agent directory (only needed for Docker mode):