Bugbot
A GitHub App that reviews your pull requests with inline LLM comments. Webhook in, review out.
When a PR opens or updates, GitHub sends a webhook to the Bugbot server. The server validates the signature, enqueues a review job, and responds in milliseconds. A background worker then picks up the job, fetches the PR diff, runs an LLM analysis pipeline, and posts inline review comments directly on the PR.
The system is a TypeScript monorepo with two runnable apps (server and worker) and two shared packages (config and db), built for resilience: retries with backoff, per-chunk error isolation, token caps, and comment deduplication.
Millisecond webhooks
The Hono server verifies the HMAC signature, upserts a ReviewJob, enqueues to BullMQ, and acks GitHub in milliseconds. All heavy lifting is deferred.
Token-bounded chunking
Large diffs are split into model-sized chunks with global token caps, keeping OpenAI costs predictable on monster PRs.
Inline review comments
Findings are posted as file/line-anchored PR review comments through the GitHub App installation client.
Resilient by default
Exponential backoff with up to 3 retries per job, and per-chunk error isolation so one bad diff never sinks a review.
No duplicate noise
Existing PR comments get fetched before posting, so re-pushes never re-report the same issue.
- 01
GitHub App webhook → Hono server, HMAC signature verified
- 02
ReviewJob upserted via Prisma 7 (PostgreSQL 16) and enqueued to BullMQ on Redis
- 03
The worker fetches PR files through the installation-scoped Octokit client
- 04
Diff → token-bounded chunks → gpt-4.1-mini analysis via the Responses API
- 05
Findings post as a single inline review; totals are exposed at GET /stats