Code Reviewer
Code Reviewer reviews pull requests on GitHub and comments on them as the TokHive bot. Reviews run in your repository's own GitHub Actions, and model calls are billed by tokens from your balance like any other request. The pull request's code is only read, never built or run.
Set up
- In the console, open Code Reviewer and click Connect GitHub.
- Install the TokHive GitHub App on your account or organization, choose its repositories, and authorize it. You return to the console with GitHub connected. In an organization, an owner may need to approve the App first.
- Find the repository in the list and click Turn on. TokHive opens a pull request that adds
.github/workflows/tokhive-review.yml. - Merge that pull request. The repository then shows Reviewing.
GitHub Actions must be enabled for the repository. On private repositories, reviews use your own Actions minutes.
What happens on a pull request
When a pull request is opened, updated, reopened or marked ready for review (drafts are skipped):
- 👀 appears on the pull request when the review starts, and is removed when it ends.
- One summary comment lists every finding, most severe first. Each review updates this same comment.
- Inline comments are added only for new findings. Findings already commented on, where the code hasn't changed, aren't repeated.
A review has 30 minutes; a small pull request usually takes 2 to 5.
Settings
Settings apply to every repository. Change them on the Settings tab and click Save settings.
| Setting | Default |
|---|---|
| Model: any text model available to you | gpt-6.2-sol |
| Review style: Strict, Balanced, Lenient or Roast | Balanced |
| Focus areas: security, performance, bugs, code style, test coverage, documentation | Security, performance, bugs |
| Skip pull requests from bots such as Dependabot | On |
If the default model isn't available to you, choose another, or reviews fail.
Repository rules: REVIEW.md
Put a REVIEW.md at the root of your repository to give reviews your own rules, for example:
- Every exported function needs a JSDoc comment.
- Flag any SQL built by string concatenation.
It is read from the pull request's base branch, so a pull request can't change the rules it is reviewed by. Only the first 10,000 characters are used.
Run a review again
Comment /tokhive review on the pull request. It works for the pull request's author and anyone with write access to the repository: TokHive reacts 👀 and starts a review. Anyone else gets 😕 and nothing runs.
If TokHive replies that the workflow "predates /tokhive review", turn the repository off and on again in the console, and merge the pull request that updates the workflow.
Review history
The Review History tab lists every review: time, pull request and status (Running, Completed, Failed or Skipped). Failed and skipped reviews say why, for example a timeout, no available model, or a pull request from a bot.
Turn it off
Click Turn off for the repository in the console, then delete .github/workflows/tokhive-review.yml. If you uninstall the GitHub App instead, delete the workflow file too, or it keeps starting an Actions job that ends without reviewing.
Related
- Deposits: add funds to pay for reviews.
- Consumer FAQ: pricing and billing.