Pull request review for Forgejo.
Cawdit reads each pull request with the model you choose and posts what it finds as an ordinary review, with comments on the lines they concern. It runs as a Crow CI step or as a server, on Forgejo and Arbinel.
Two refunds can pass the balance check together
Severity: errorCategory: bug
The handler reads the balance before the refund runs, outside a transaction, so two refunds for the same payment can both pass the check and pay out more than was captured. Check and refund in one statement.
Suggested change
return h.db.RefundUpTo( ctx, id, amount, )
- Forges
- Forgejo, Arbinel
- Models
- 10 provider kinds
- Runs as
- CI step or server
- Licence
- AGPL-3.0-or-later
One pass reviews. A second checks every finding.
A finding the verify pass cannot back up never reaches the pull request. Style, naming and what a linter catches stay out, unless a rule in your repository asks for them.
Context
Collects the changed hunks, the code around them and your review rules, up to a token budget you set.
Review
The review model reports findings on changed lines, in a fixed JSON shape with a severity and a category.
Verify
A second pass, on the same model or another, reads every finding again against the code and keeps it or drops it.
Dedupe
Findings it already posted are matched by a fingerprint of the code, so a push does not repeat them.
Publish
One review with inline comments, a summary with the tokens and, when Cawdit knows the model's prices, the cost, and a commit status named cawdit.
Comments on the line, the way a colleague leaves them.
Each finding names what goes wrong, with a severity of error, warning or info. After the next push Cawdit reads only the files that changed, and when a finding no longer applies it edits its own comment to say so.
Nil map write
Severity: errorCategory: bug
The map counts is nil when the cache is cold, so the first write panics. Initialise it with make before the loop.
Fixed in 4e1f9a2c07: the code changed and this finding no longer applies.
Original comment
Nil map write
Severity: errorCategory: bug
The map counts is nil when the cache is cold, so the first write panics. Initialise it with make before the loop.
One binary. Three ways to run it.
The same Go program reviews from a CI step or serves webhooks and a dashboard. The server's only dependency is Postgres. The images are signed with cosign and run as a user without root.
Crow plugin
One review per pipeline
Add a step to the pull request pipeline. The image reviews the pull request, posts the review and exits, with no database to run.
cawdit serve
Webhooks and a dashboard
Takes the forge's webhooks, queues reviews in Postgres, answers commands in threads, and shows runs, findings and cost per repository.
Helm chart
The server on a cluster
Runs cawdit serve on Kubernetes. The chart bundles no database and never creates a Secret, so yours stay where you keep them.
when:
- event: pull_request
skip_clone: true
steps:
review:
image: docker.io/cawdit/cawdit:plugin-main
settings:
model: claude-opus-5-5
verify_model: claude-sonnet-5-5
api_key:
from_secret: anthropic_api_key
forge_token:
from_secret: cawdit_forge_token
fail_on: errorThe quickest start is a pipeline step.
Give the step a model key and a forge token as secrets, and open a pull request. Set dry_run to print the review instead of posting it while you try it out.
Your rules, read from the base branch.
A repository sets what Cawdit reviews and how strict its status is in .cawdit.toml, and points it at its own review rules in Markdown. Cawdit reads the file from the base branch, so a pull request cannot lower its own bar.
[review]
skip_drafts = true
skip_authors = ["renovate-bot"]
wait_for = ["ci/crow/pr/test"]
min_severity = "warning"
fail_at = "error"
[paths]
ignore = ["vendor/**", "**/*.pb.go"]
[rules]
files = ["docs/review/*.md", "CONTRIBUTING.md"]Talk to it in the thread.
With cawdit serve, anyone with write access can mention the bot in a comment. Mentions inside quotes or code do not count.
- @cawdit review
- Reviews the whole pull request again, a draft included.
- @cawdit ignore
- In a finding's thread, dismisses that finding.
- @cawdit why does this race?
- Any other mention in a finding's thread is a question, and Cawdit answers it there.
Ten provider kinds. Or the model you host.
The review and the verify pass can use different models. Point the openai-compatible kind at Ollama or vLLM on your own hardware for both passes, with JSON schema output, and your code stays inside your network.
- anthropicThe default
- openaiOpenAI API
- geminiGoogle
- mistralMistral AI
- deepseekDeepSeek
- groqGroq
- moonshotMoonshot AI
- openrouterMany models, one key
- xaixAI
- openai-compatibleOllama, vLLM, LiteLLM
The details that keep a review honest.
A status to require
Each review sets a commit status named cawdit, which fails while open findings at or above your threshold remain. Require it in branch protection.
Tokens and cost on every review
The summary names the commit and the model, then the tokens and the cost in US dollars, once Cawdit knows the model's prices. The server exports both as metrics too.
Untrusted input stays fenced
Pull request content goes to the model inside tags it cannot close, and Markdown from the model is neutralised before Cawdit posts it.
A dashboard for the server
Overview, pull requests, runs, usage and settings, with a button to review a pull request again. Sign in through the forge or OpenID Connect.
Secrets by reference
Configuration takes secrets only as env: or file: references, checks the token's scopes at startup, and seals organisation tokens with AES-256-GCM.
Try it without posting
A dry run prints the review instead of posting it, and cawdit eval replays recorded pull requests to compare models and prompts.
Cawdit and hosted review bots
- Model
- The provider and model you choose, or one you host.
- Often the model the vendor chose for you.
- Your code
- Goes to the provider you configure, and nowhere else.
- Usually passes through the vendor's servers.
- Forge
- Built for Forgejo and Arbinel.
- Mostly GitHub and GitLab, Forgejo rarely.
- Cost
- Your provider's token prices, with the tokens on each review.
- Often a monthly price per seat.
- Settings
- A TOML file in the base branch, reviewed like code.
- Often toggles in the vendor's web app.
- Licence
- AGPL-3.0-or-later, with every feature in the repository.
- Mostly closed source.
The provider and model you choose, or one you host.
Often the model the vendor chose for you.
Goes to the provider you configure, and nowhere else.
Usually passes through the vendor's servers.
Built for Forgejo and Arbinel.
Mostly GitHub and GitLab, Forgejo rarely.
Your provider's token prices, with the tokens on each review.
Often a monthly price per seat.
A TOML file in the base branch, reviewed like code.
Often toggles in the vendor's web app.
AGPL-3.0-or-later, with every feature in the repository.
Mostly closed source.
Review your first pull request in about fifteen minutes.
Add the Crow step to one repository, give it a model key and a forge token, and open a pull request.