AI code review for GitHub, GitLab and Bitbucket

Every pull
request gets a

first pass.

Firstpass reads each pull request before your team does. It runs the tests, finds the bug and leaves the fix as a suggestion you apply in one click.

Reviewed in 01:34

Retry failed captures with backoff

+48 −12 3 files

src/capture/retry.ts

37

 

export async function captureWithRetry(id: string) {

38

 

  let attempt = 0;

39

−

  for (; attempt < MAX_ATTEMPTS; attempt++) {

39

+

  while (attempt < MAX_ATTEMPTS) {

40

 

    const res = await gateway.capture(id);

41

 

    if (res.ok) return res;

42

+

    await sleep(backoff(attempt));

firstpass

BLOCKING

line 42

​attempt is never incremented inside the loop, so a failed capture retries forever. The test retries stop after 5 attempts times out.

−

await sleep(backoff(attempt));

+

await sleep(backoff(attempt++));

43

 

  }

44

 

  throw new CaptureError(id, attempt);

2 more comments · 1 should fix · 1 nit

94 s

Median time to first review

1 in 3

Reviews end in an applied fix

0 lines

Of your code kept after review

Sample data, last 30 days

Sample data, last 30 days

Used by engineering teams at

Fennwick

Maren Labs

Orrin Health

Kestrel Works

Brightwater

Tallis Reed

01 What it catches

Four kinds of problem,
found before a person looks.

Firstpass does not comment on style. It reports what breaks, what slows down and what leaks.

Bugs it can prove.

It checks out your branch, builds it and runs the tests. A comment arrives with the failing test attached, not a guess.

test output

1 failed

$ pnpm test capture

captures on the first attempt (38 ms)

backs off between attempts (112 ms)

retries stop after 5 attempts (timeout 5000 ms)

  at src/capture/retry.test.ts:58

41 passed · 1 failed · 12.4 s

Slow queries and loops.

N+1 queries, missing indexes and work repeated inside a loop, with the measured cost.

Before

201 queries

1,840 ms

After

2 queries

38 ms

Secrets and unsafe input.

Keys in a diff, SQL built from strings, unchecked redirects. Blocked before merge.

config/payments.env

9

 

# payments

10

 

PAYMENTS_PROVIDER=stripe

11

 

PAYMENTS_CURRENCY=usd

12

 

PAYMENTS_REGION=eu-west-2

13

 

PAYMENTS_TIMEOUT_MS=8000

14

 

STRIPE_KEY=sk_live_••••••••••••4f2a

Secret found · push blocked

config/payments.env:14

Stripe live key

Your own rules.

Write the team’s rules once in plain words. Firstpass applies them to every pull request and cites the rule.

firstpass.yml

1

 

rules:

2

 

  - “Money is stored as integer cents, never floats”

3

 

  - “Every new endpoint needs an auth test”

4

 

  - “No direct imports from /internal in /web”

5

 

ignore:

6

 

  - “**/*.snap”

7

 

severity: block_on_bug

firstpass

Rule 1

​amount is parsed with parseFloat

billing/invoice.ts · line 88

02 One review, start to finish

From push to review
in the time it takes to get coffee.

00:00

00:12

00:47

01:34

00:00

00:10

00:20

00:30

00:40

00:50

01:00

01:10

01:20

01:30

01:34

Step 4 of 4

Pick a stop to move the red line.

review summary

01:34

Risk: high

1 blocking, 1 should fix, 1 nit

Safe to merge after the retry fix.

blocking

retry.ts:42

attempt is never incremented

should fix

retry.ts:58

backoff has no upper limit

nit

retry.test.ts:12

unused import

00:00

00:12

00:47

01:34

00:00

00:10

00:20

00:30

00:40

00:50

01:00

01:10

01:20

01:30

01:34

Step 4 of 4

Pick a stop to move the red line.

review summary

01:34

Risk: high

1 blocking, 1 should fix, 1 nit

Safe to merge after the retry fix.

blocking

retry.ts:42

attempt is never incremented

should fix

retry.ts:58

backoff has no upper limit

nit

retry.test.ts:12

unused import

00:00

Pull request opened.

Firstpass picks up the webhook. Nothing to configure per repository.

webhook

00:00

POST /hooks/github 202

pull_request.opened payments-api #4127

signature verified

queued in 0.2 s · runner eu-west-2

Pull request opened

picked up in 0.2 s

00:12

Checked out and built.

Your branch is built in an isolated container that is destroyed afterwards.

build

00:12

$ git fetch origin pull/4127/head

$ pnpm install --frozen-lockfile

$ pnpm build

build ok · 9.8 s

Checked out and built

exit 0 · 9.8 s

00:47

Tests and analysis run.

The changed code paths are traced, the affected tests run first.

tests

00:47

$ pnpm test --changed

backs off between attempts

retries stop after 5 attempts

42 tests · 41 passed · 1 failed

Tests and analysis run

exit 1 · 12.4 s

01:34

Review posted.

One summary, comments on the exact lines, a suggestion where there is a safe fix.

review summary

01:34

Risk: high

1 blocking, 1 should fix, 1 nit

Safe to merge after the retry fix.

blocking

retry.ts:42

attempt is never incremented

should fix

retry.ts:58

backoff has no upper limit

nit

retry.test.ts:12

unused import

Sample data. Replace with your own.

94 s

Median time to first review

From push to posted review, across 412 teams in October.

94 s

Median time to first review

From push to posted review, across 412 teams in October.

38%

Of blocking comments lead to a code change

Measured by the next commit touching the flagged lines.

6.2 h

Review wait saved per developer, per week

Reported by 23 teams that measured before and after.

0

Lines of code stored

Branches are deleted when the review is posted.

04 Works with

Installs in two minutes.
No pipeline changes.

Add the app to your organisation, pick the repositories, open a pull request.

1

Install the app

2

Choose repositories

3

Open a pull request

Hosts

GitHub

GitLab

Bitbucket

Azure Repos

Languages

TypeScript

Python

Go

Ruby

Java

Kotlin

Rust

C#

PHP

Swift

Tests

Jest

Vitest

pytest

go test

RSpec

JUnit

cargo test

05 Pricing

Priced per developer.
Reviews are unlimited.

Open source

$0

For public repositories.

Unlimited public repos

Bug and security comments

Community support

Team

$24

per developer / month

For private repositories.

Everything in Open source

Runs your tests

Team rules file

14-day trial, no card

Enterprise

Custom

For 100+ developers.

Self-hosted runners

SSO and audit log

Data residency in US or EU

Named support engineer

Not used for training

Your code never trains a model, ours or anyone’s.

Not used for training

Your code never trains a model, ours or anyone’s.

Deleted after review

Branches and build containers are destroyed when the review is posted.

Audited

SOC 2 Type II report available under NDA. Sample claim: replace with your own.

07 Questions

Asked before
every install.

No. It does the first pass so people can spend their review on design and intent. You decide whether a blocking comment stops the merge.

Open a pull request.

Get your

first pass.

Free for public repositories · 14-day trial for private ones · no card

Open a pull request.

Get your

first pass.

Free for public repositories · 14-day trial for private ones · no card

Open a pull request.

Get your

first pass.

Free for public repositories · 14-day trial for private ones · no card

Create a free website with Framer, the website builder loved by startups, designers and agencies.