Code Review Bot | Open Library Docs
Skip to content Code Review Bot IMPORTANT Note: The content for this page is loaded at build time from the main GitHub Repo. Hence the double titles. How the code review bot works @openlibrary-bot reviews pull requests on this repository with Claude. It leaves one review per pass, with inline comments on the problems it finds, and posts the code-review check that a PR needs to merge. This page explains when it runs, what it checks, and what to do with its feedback.
The bot is a first reader, not a maintainer. Its approval is not a sign-off, and a person still reviews and merges every PR. When it reviews mermaid flowchart TD subgraph starts["What starts a review"] direction LR open["PR opened or marked ready for review"] push["New commits pushed"] ask["Someone comments @openlibrary-bot"] end open --> known{"Is the author a known contributor?"} known -- "yes, automatically" --> request["The review team is requested"] known -- "no, first-time contributor" --> manual["A maintainer requests the review by hand"] manual --> request push --> before{"Already reviewed by the bot?"} before -- "no" --> waitmaint["Waits for a maintainer to request the first review"] before -- "yes" --> quiet["Waits until 10 minutes pass with no new pushes"] quiet --> request ask --> allowed{"Is it a maintainer or the PR's author?"} allowed -- "yes" --> review allowed -- "no" --> nothing["No review; the bot replies once to say who can ask"] request --> review["Review runs"] review --> current{"Has the bot already reviewed this exact commit?"} current -- "no" --> posted["Review posted and the code-review check updated"] current -- "yes" --> matches{"Does the check match that review?"} matches -- "yes" --> same["Nothing new: no review runs, and the bot says so if you asked"] matches -- "no" --> repost["The check is re-posted from that review, without running the model"] A review starts in one of these ways: When a PR is opened or marked ready for review.
The review team ( openlibrary-agentic-code-reviewer ) is requested automatically if the author is a known contributor: an owner, member, collaborator or past contributor of this repository. A first-time contributor's PR waits for a maintainer to request the team, so drive-by PRs don't spend the bot's budget. After new commits, once the pushes stop. If the bot has reviewed the PR before, it reviews the new commits once 10 minutes pass with no further push ( push_review_delay_minutes in .pr_agent.toml ).
See What happens when you push . When someone asks. Request a review from the openlibrary-agentic-code-reviewer team, use the re-request button next to openlibrary-bot , or comment @openlibrary-bot on the PR. The bot adds 👀 to your comment when the review starts. It never reviews a draft or a closed PR. If you ask for a review and there's nothing to review (a draft, a closed PR, or a commit it already reviewed), the bot replies to say so.
What happens when you push Another push within the 10 minutes cancels the wait and starts it over, so the review starts 10 minutes after your last push. A burst of commits gets one review. A push while a review is running doesn't stop that review or waste it. When it finishes, the bot posts it on the commit it read, marked as superseded, as a comment that neither approves nor blocks. That commit's check changes to "Superseded by <commit> ".
Your new commit waits its own 10 quiet minutes, then gets its own review. That review also covers the changes the superseded one saw, so nothing it found is lost. A force-push while a review is running is the exception: the commit that review read is no longer part of the PR, so the review is dropped. The new head still gets its own review, of the whole PR. Asking for a review during the wait starts it right away instead.
No re-review for pushes made by bots, pushes that only merge the base branch in (the "Update branch" button), or PRs labelled no-automation . Ask for a review if you want one. mermaid sequenceDiagram participant You participant Bot as Review bot You->>Bot: Push commit A Note over Bot: Waits until 10 minutes pass with no new pushes Bot->>Bot: Starts reviewing A You->>Bot: Push commit B while A is being reviewed Bot-->>You: The review of A is posted on A as a comment.
A's check says Superseded by B Note over Bot: Waits until 10 minutes pass with no new pushes after B Bot->>You: A review of B, covering the changes in A and B Who can ask for a review mermaid flowchart TD who{"Who is asking?"} who -- "A maintainer" --> anyway["Any of the three ways works"] who -- "The PR's author" --> author["Comment @openlibrary-bot on your PR"] who -- "Anyone else" --> other["The bot replies once to say who can ask; ask a maintainer"] Commenting works for the PR's author and for these maintainers: mekarpeles , cdrini , hornc , scottbarnes , seabelis , RayBB and lokesh .
Requesting the review team or using the re-request button needs triage or write access to the repository. If anyone else comments @openlibrary-bot , the bot replies once on that PR to say who can ask. What a re-review covers A re-review looks only at the files changed since the bot's last review, so it doesn't repeat itself. Commits that only merge the base branch in are skipped. If nothing but base-branch merges arrived, no new review runs and the check keeps the previous verdict.
After a force-push that rewrites the history it reviewed, the bot reviews the whole PR again. On each re-review the bot also re-checks its own open comments, as described in Responding to a finding . If a review gets stuck or fails Ask again: comment @openlibrary-bot , or re-request the review. If the bot hasn't posted a review for the PR's latest commit (the review failed, or the check says "No clean review for this commit."), asking again runs a full review.
If it has, asking again doesn't review the same commit twice. It re-posts the code-review check from that review if the check is stuck or out of date, without running the model. To get a fresh review of a commit the bot already reviewed, push a new commit. A maintainer can also open the failed run in the Actions tab and use Re-run failed jobs . What it checks Every review covers five areas: Area What it looks for Correctness Bugs, unhandled edge cases, callers that rely on the old behaviour, blocking calls on the async path Security Anything touching auth, sessions, redirects, user input in SQL, shell, files or templates Accessibility Templates, JS and CSS against WCAG 2.1 AA: alt text, labels, keyboard access, contrast Test coverage A missing test that would catch a real bug, a test that can't fail, and tests that aren't worth keeping Styleguide Material problems only: unrelated edits, error-prone patterns, speculative abstractions It also checks the PR against the issues it links to and lists which of their requirements the PR meets, doesn't meet, or needs a person to verify.
Security concerns are never posted publicly. If the bot finds one, it withholds the whole review, and the code-review check fails with "A finding was delivered privately; maintainer review required." A maintainer needs to look at the PR before it can merge. The full instructions the bot follows are in .github/workflows/code_review.md . What you'll see The review. A short summary, then: Inline comments for findings that should be fixed before merging, each headed with its severity and area, for example MEDIUM · Correctness — … .
Where the fix is small, the comment includes a suggestion you can apply in one click. Suggestions (won't block) in the summary, for low-severity findings, findings the bot isn't sure about, and every test-coverage finding. Prompt for AI agents , a collapsed block under each finding that you can paste into a coding agent. The verdict. The review is one of: Request changes when there is at least one finding that blocks.
Approve when there are none and none of the bot's earlier comments are still open. Comment otherwise, and al
The rest of this page is on the live site.