Skip to content
Cawdit
Quick start

Open source, in early development before v1. Your model, your forge.

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.

internal/payments/refund.go+4 −0
38func (h *Handler) Refund(
39 ctx context.Context,
40 id string, amount int64,
41) error {
42 bal, err := h.db.Balance(ctx, id)
43 if err != nil {
44 return err
45 }
46Added: if amount > bal.Captured {
47Added: return ErrRefundTooLarge
48Added: }
49Added: return h.db.Refund(ctx, id, amount)
cawdit-botcommented a minute ago

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,
)
50}
Forges
Forgejo, Arbinel
Models
10 provider kinds
Runs as
CI step or server
Licence
AGPL-3.0-or-later
§ How a review runsTwo passes per finding

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.

  1. 01

    Context

    Collects the changed hunks, the code around them and your review rules, up to a token budget you set.

  2. 02

    Review

    The review model reports findings on changed lines, in a fixed JSON shape with a severity and a category.

  3. 03

    Verify

    A second pass, on the same model or another, reads every finding again against the code and keeps it or drops it.

  4. 04

    Dedupe

    Findings it already posted are matched by a fingerprint of the code, so a push does not repeat them.

  5. 05

    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.

How Cawdit reviews →
§ ReviewOne review per push

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.

cawdit-botcommented 2 hours ago

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.

The comment on the first push
cawdit-botedited a minute ago

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.

After the fix. On Arbinel it also resolves a thread that only it and the author wrote in
With cawdit serve, the dashboard lists every pull request and its open findings
§ Run itChoose one per setup

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/cawdit.yamlYAML
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: error

The 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.

Quick start →
§ Configuration.cawdit.toml

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.

.cawdit.tomlTOML
[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"]
Every key of .cawdit.toml →

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.
§ ModelsBring your own key

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
Configure a model provider →
§ Details06 highlights

The details that keep a review honest.

§ Six categoriesCawdit and hosted review bots

Cawdit and hosted review bots

Us
Cawdit.
Them
Hosted bots.
01Model
Cawdit

The provider and model you choose, or one you host.

Hosted

Often the model the vendor chose for you.

02Your code
Cawdit

Goes to the provider you configure, and nowhere else.

Hosted

Usually passes through the vendor's servers.

03Forge
Cawdit

Built for Forgejo and Arbinel.

Hosted

Mostly GitHub and GitLab, Forgejo rarely.

04Cost
Cawdit

Your provider's token prices, with the tokens on each review.

Hosted

Often a monthly price per seat.

05Settings
Cawdit

A TOML file in the base branch, reviewed like code.

Hosted

Often toggles in the vendor's web app.

06Licence
Cawdit

AGPL-3.0-or-later, with every feature in the repository.

Hosted

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.