Engineering

How to review an AI-written pull request fast

Editorial · Reveneau · December 5, 2026

How to review an AI-written pull request fast

Reviewing a pull request an agent wrote is a different exercise from reviewing one a human wrote, and most teams are still reviewing both the same way. The common faults are different. The time it takes to find them is different. The things a reviewer needs to look at first are different.

A review that is fluent in the specific failure modes of AI-written code takes 10 to 20 minutes for a typical PR. One that is not can take an hour, and often misses the issues that matter most because it spent the hour reading the lines that are fine. The difference is not effort, it is knowing what to read first.

Start with the tests, not the implementation

The first file to open is the test file. Not because the tests prove the change works, but because the tests reveal what the agent thought it was building.

Good tests check the acceptance criteria from the spec. They call the function with inputs that reflect real use cases and check what it returned against expected outputs. If the tests look like this, they tell the reviewer what the agent believed the function should do. If that belief matches the spec, the implementation is likely close to correct.

Bad tests check the implementation. They patch internal functions and assert that they were called in a specific order. They check that a specific line was reached. They set up mocks that mirror the structure of the code rather than the structure of the problem. If the tests look like this, they tell the reviewer almost nothing about whether the change does what the ticket asked for. A correct refactor would break these tests even though nothing was actually wrong.

Reading the tests first lets the reviewer answer two questions quickly. Does the agent understand the requirement, and are the tests structured in a way that will survive a reasonable refactor? If the answer to the first is no, the PR needs revision regardless of what the implementation looks like. If the answer to the second is no, the tests need to be rewritten before this change ships, or future changes to this code will be painful.

The five common faults

Once the tests are read, the reviewer can skim the implementation for the specific faults that AI-written code is most prone to. Five cover most of what shows up.

The first is unused imports and dead branches. The agent added a library it thought it might need, and did not end up using it. Or the agent wrote a conditional path that cannot actually be reached given the inputs the function sees. Both are signs that the agent was uncertain about which approach it wanted, and both leave clutter in the codebase. They are also fast to spot: a linter catches the imports, and the dead branches usually jump out when the reader asks what path could trigger this.

The second is over-broad error handling. The agent wraps a block in try/except Exception or the language's equivalent generic catch, swallows the exception, and returns a default value or logs a generic message. This is the most common serious issue in AI-written code. It makes production failures hard to diagnose because the information about what actually went wrong is thrown away. The fix is specific: catch only the exception types the code can meaningfully handle, and let the rest propagate.

The third is invented helper functions. The agent wrote a function to do something the standard library or an existing utility already does. The new function works, but now the codebase has two ways to do one thing, and future readers have to decide which. The fix is to replace the invented helper with the existing one. Catching this requires knowing what already exists in the codebase, which is why reviewing an agent's work on an unfamiliar area is slower.

The fourth is convention drift. The agent's output uses variable names, import order, file organisation, or formatting that diverges from the surrounding code. Each instance is small. In aggregate they signal that the agent was pattern-matching to a generic style rather than reading the codebase closely. Modern formatters catch most of this automatically; the parts that remain are usually about naming and structure, which a reviewer still has to flag.

The fifth is tests that pass but do not prove the change works. These are the tests of the implementation rather than the requirement, mentioned above. Spotting them requires reading the test to figure out what it would actually catch, and asking whether that is the same as what the ticket asked for. It usually is not.

What to decide after reading

Once the reviewer has read the tests and skimmed the implementation, they have enough information to decide what happens next. The decision has three options.

Merge. The change does what the ticket asks, the tests cover the acceptance criteria, and the common faults are either absent or minor enough to fix in a follow-up. The reviewer leaves comments on anything worth fixing later and approves.

Revise. The change has a specific issue the reviewer can describe in one or two sentences. Over-broad error handling. Tests that do not check the requirement. An approach that is reasonable but wrong for this codebase. The reviewer sends a comment that states the problem specifically and asks the agent to fix it. "The error handler on line 47 swallows the underlying exception; re-raise with context instead" is specific enough to act on. "This could be better" is not.

Rewrite the ticket. The change is correct given the ticket, but the ticket did not actually describe what the team wanted. This is the case where the agent did good work on the wrong problem. The fix is not to tell the agent to try again, it is to rewrite the ticket so that the next PR has a clearer target. For related reading, see how to write a bug report an agent can act on and how to brief an agent on a legacy codebase.

When to fix it yourself versus send it back

A reviewer often reaches a point where the fix is small and they know exactly what to type. The question is whether to make the fix in the PR directly or send it back to the agent.

The answer depends on communication cost. If the reviewer can state the fix in a sentence or two and the agent has enough context to apply it, sending it back is usually faster overall. The reviewer spends less time, and the agent learns a specific pattern that will transfer to the next PR. If the fix is more context than it is work, making the change directly is faster.

The borderline case is a fix that is simple but covers five places in the diff. Sending it back with "do this in all five places" works if the five places are easy to identify. If the agent might miss one, making the change directly is safer.

Teams that always fix things themselves in the PR end up doing most of the work the agent was supposed to do. Teams that always send things back end up with slow review cycles. The right mix is to send back the fixes that are communicable and make the fixes that are not. Over time, the communicable ones train the agent and shrink future review time; the non-communicable ones stay the reviewer's job.

Local run or trust the tests

For a small change with clear tests, running the code locally is usually unnecessary. The tests pass in CI, the change is focused, and the reviewer can see the shape of it from the diff.

For a change that touches integration points, could have side effects the tests do not cover, or changes a behaviour that is not easily testable (a performance characteristic, a user-facing interaction), running the code is worthwhile. The reviewer either checks out the branch locally or opens a preview environment, and exercises the specific path the change affects.

The judgement is about what the tests actually cover. If the tests give full confidence the change works end to end, trust them. If the tests cover the unit but not the integration, run the change in a setting that exercises the integration. Most AI-written PRs have tests that cover the unit well and the integration less well, so running integration-heavy changes is usually right.

What good review comments look like

A review comment for an agent looks different from a review comment for a human.

The agent will do what the comment asks. A human might push back, ask a follow-up, or interpret the comment loosely. The agent will take the comment literally and apply the stated change. This means the comment has to be precise about what the asker actually wants.

"This could be more robust" is a comment a human can act on and an agent probably cannot. The agent does not know what the reviewer means by robust in this context. "This error handler should catch only the specific database connection errors and re-raise the rest with the original stack trace" is a comment an agent can act on.

The bar is not "would a competent engineer understand this". The bar is "does this comment specify the change concretely enough that someone who does not know the broader context could apply it". Comments that meet that bar produce fast, correct revisions. Comments that do not produce revisions that miss the point, which cost another round of review.

For related reading, see what good code review looks like and why AI generated code fails code review.

How to scale this to many PRs

A team that was reviewing one human PR per day now reviews ten agent PRs per day. The review time per PR has to come down proportionally, or the team becomes the bottleneck.

The techniques above help. Starting with the tests, scanning for the specific faults, writing precise comments, choosing between fixing directly and sending back, are all ways to spend less time per PR while still catching what matters. A fluent reviewer can clear a typical PR in 10 to 20 minutes.

The other lever is deciding which PRs get what depth of review. Not every PR needs the same treatment. A routine change to a well-covered module can go through quickly. A change to authentication or data migrations deserves more time. Deciding which is which, and reading each PR at the right depth, is what makes the review process scale.

The teams that do this well treat review as a filter rather than as a full re-read. The filter catches what the eval and the automated checks do not. It is tuned for the specific faults AI code is prone to, and it moves fast because it is not trying to do the job of the eval over again. The teams that do this poorly read every line, take an hour per PR, and still miss things, because reading every line is not the same thing as catching the problems that are there.

Common questions

What is the fastest way to review an AI-written pull request?

Start with the test file, not the implementation. If the tests cover the scenarios the ticket describes and the tests pass, the implementation is probably close to correct. Then skim the implementation for the specific failure modes that AI code is prone to: imported but unused dependencies, over-broad try/catch blocks, dead branches, silent fallbacks. These are faster to find and more informative than reading the diff line by line.

Why is reviewing AI-written code different from reviewing human-written code?

Because the common failure modes are different. A human engineer makes specific mistakes based on gaps in their knowledge. An AI makes a different set of mistakes, mostly related to pattern matching on code that was not quite the right pattern. An AI will produce code that looks reasonable but uses the wrong library function, catches the wrong exception type, or handles a case that cannot happen. Knowing the specific pattern of AI mistakes lets the reviewer scan for them quickly.

What are the most common faults in AI-written pull requests?

Unused imports, over-broad error handling that swallows information, invented helper functions when a standard one exists, inconsistent naming that drifts from the codebase conventions, and tests that test the implementation rather than the requirement. These five cover most of the issues on a given PR, and a reviewer who checks for them explicitly will catch most of what matters without reading every line.

How do you know if the tests are good enough?

The tests should check the acceptance criteria from the spec, not the specific lines of code in the implementation. A test that calls the function and checks what it returned against the expected output is testing the requirement. A test that patches internal functions and checks they were called in a specific order is testing the implementation, which means a correct refactor will break the test even though nothing is actually wrong. Prefer the first kind.

When should a reviewer ask the agent to revise instead of fixing the change themselves?

When the fix requires context the reviewer can state. If the reviewer can explain why the current approach is wrong in one or two sentences, the agent can usually act on that. If the fix is small and the reviewer knows exactly what to type, fixing it directly is faster. The split is about communication cost. For related reading, see how to brief an agent on a legacy codebase.

How long should an AI-written PR review take?

For a typical change (a few hundred lines, focused on one feature), a fluent reviewer can complete the review in 10 to 20 minutes. Longer reviews usually signal either a PR that is too large (should have been split) or a reviewer who is reading every line (should be checking the specific failure modes instead). If a review consistently takes an hour, the bottleneck is usually one of those two.

What should a reviewer do about a PR that looks correct but does not match the intent?

Send it back with a clearer intent statement. The most common cause of a correct-looking but wrong PR is that the ticket was ambiguous, the agent picked a reasonable interpretation, and the interpretation was not the one the team wanted. Rewriting the ticket in a form the agent can act on unambiguously fixes the underlying problem and prevents the same mistake on the next PR.

What belongs in the review comment to an agent?

A specific statement of the problem and a specific action to take. "This error handler swallows the underlying exception; re-raise with context instead" is actionable. "This could be better" is not. The agent will do what the comment asks, so the comment has to be precise about what the asker actually wants.

Should the reviewer run the code locally?

For a small change with clear tests, no. For a change that touches integration points or that could have side effects the tests do not cover, yes. The rule of thumb is: if the tests give full confidence the change works, trust them; if the tests are narrow, run the change against a staging or local environment that exercises the parts the tests do not.

What happens if the review queue backs up?

The quality of reviews drops and the team ships more broken code. The fix is to improve the throughput of each review (the techniques above) and to narrow what gets reviewed (not every PR needs the same depth). A review process that does not scale with the number of PRs is a process that stops being a real check and becomes a rubber stamp.

Start a project