Code Review Is Becoming a Routing Problem
Teams asked AI to write more code. The awkward part is that somebody still has to review it.
That sounds obvious, but it changes the shape of the whole workflow. A team that used to receive a handful of human-written pull requests can now receive faster, broader, and more uneven streams of change. Some diffs are tiny cleanup patches. Some touch product behavior. Some are generated by a coding agent that followed a reasonable plan. Some are generated by a coding agent that wandered into a nearby problem and came back with a confident explanation.
The review queue becomes the pressure point.
For a while, the default mental model for AI code review was simple: put a model on the pull request and let it leave comments. That can help. A model can spot suspicious patterns, missed edge cases, inconsistent naming, missing tests, or obvious security smells. But the naive version falls apart quickly in a real repository. It comments on the wrong line. It misses the reason a change exists. It treats a style nit and a release-blocking bug with the same voice. It floods the thread with things a linter should have handled before a human ever opened the PR.
The problem is not that AI cannot review code. The problem is that code review is not one job.
It is routing.
The pull request is the wrong unit of work
A pull request looks like a single object in the UI, so we often talk about reviewing it as one task. That is too crude.
Inside one PR, there may be several different kinds of review work:
- deterministic checks that should run every time
- security probes that need tool use and patience
- consistency checks against the surrounding codebase
- ownership questions about who should approve the change
- architecture judgment about whether the change belongs here at all
- product judgment about whether the behavior is correct
Those jobs do not deserve the same reviewer, the same latency, or the same evidence.
This is where the current research direction around agentic code review gets interesting. The useful work is moving past "make the model smarter at commenting." It treats review as a staged system, with agents doing repeatable inspection and humans remaining at the gates where judgment matters.
That framing feels much closer to how real teams work. A senior engineer does not review a database migration, a typo fix, a dependency bump, and a cross-service permissions change with the same mental checklist. The review lane changes based on blast radius, ownership, reversibility, and the kind of proof available.
AI review systems need to learn that distinction.
A commenter is not a reviewer
The easiest AI review product to build is a commenter. It reads a diff and writes notes.
The harder product is a dispatcher. It decides what kind of review the change deserves before it decides what to say.
That difference matters because plenty of bad AI review experiences are really misplaced-work problems. The model comments on a formatting issue after CI already checked formatting. It proposes a refactor in a file owned by another team. It flags a theoretical risk without showing how the code path is reachable. It writes a confident suggestion that does not match the current diff context.
In those cases, the failure is not "the model should be more articulate." The failure is that the system let an ungrounded comment reach the human review surface.
A better review system would ask routing questions first:
- Is this a mechanical issue that belongs in CI?
- Is this a security-sensitive path that deserves agentic probing?
- Does the finding include enough evidence to be worth showing?
- Who owns the surrounding code?
- Is the change small enough for normal review, or does it need design review?
- Does the agent know the repository conventions, or is it guessing from the diff?
That sounds less glamorous than an all-knowing reviewer bot. It is also more useful.
The review thread is expensive. Every comment asks a human to stop, parse context, decide whether the comment matters, and either act on it or dismiss it. If AI review adds ten low-confidence comments to every PR, it has not reduced review load. It has moved the load into triage.
Agents are useful because they can do boring review work well
The strongest case for agentic review is not that agents have taste. It is that they can do patient, repetitive, evidence-gathering work.
An agent can navigate the repository, inspect related files, run tools, compare patterns, trace call sites, and repeat a check across a wider surface than a human reviewer wants to cover manually. In security-focused review, that matters. A useful agent can look beyond the changed lines and ask whether a dangerous pattern is reachable, whether a sanitization assumption holds, whether a permission check is consistent, or whether similar code elsewhere handles the case differently.
That is different from asking a model to produce a clever paragraph about a diff.
The agentic part matters because review often requires movement. The reviewer has to leave the changed file, read the caller, inspect a schema, check tests, search for precedent, or run a small reproduction. A one-shot model call has a hard time with that. A staged agent has a better chance, provided the workflow constrains it and records what it actually checked.
This is where review comments should start to look more like evidence packets.
Not:
This may cause a security issue.
Better:
This path accepts user-controlled input from X, reaches Y without the existing normalization used in Z, and the agent reproduced the case with this command. Human review needed because the intended trust boundary is unclear.
That second version is still not automatic truth. A human may reject it. But it is reviewable. It gives the reviewer a trail to inspect instead of a vibe to interpret.
Humans still own the judgment layer
There is a tempting story where AI review gets good enough that humans fade out of the loop. I do not buy it for serious software.
Humans are not central because they are better at spotting every null check. They are central because they own context the system cannot reduce to a diff. They know why the feature exists, how much risk the business can tolerate, what the team is trying to simplify this quarter, which dependency is already being replaced, and which ugly local convention is ugly for a reason.
That judgment shows up in boring ways:
- approving a temporary workaround because the migration is already scheduled
- rejecting a technically elegant change because it splits ownership across teams
- asking for a smaller patch because the release window is tight
- accepting a risk because the affected path is behind a kill switch
- refusing a risk because the path touches user data
An agent can help surface the facts that make those decisions easier. It should not pretend those decisions are just another classification task.
This is why routing is the right mental model. Deterministic checks can run without ceremony. Agentic probes can gather evidence. Reviewers can receive fewer, better-framed findings. Senior humans can spend more time on the questions where responsibility actually lives.
The goal is not to replace review judgment. The goal is to stop wasting it.
The next review system needs lanes
If I were evaluating an AI review system today, I would care less about whether it writes fluent comments and more about whether it has lanes.
One lane is mechanical. Formatting, obvious type errors, generated file drift, dependency policy, test coverage thresholds, dead links, and basic static analysis should be handled before the pull request becomes a conversation. Humans should not be asked to read AI prose about things a tool can reject directly.
Another lane is agentic inspection. This is where a code-aware agent can navigate, run targeted checks, compare patterns, and produce evidence. Security review belongs here. So do consistency checks across a codebase that has too much local knowledge for a single diff view.
A third lane is ownership. Some changes need the right person, not the fastest person. A model can help identify touched domains, previous authors, risky modules, or files with special rules. It can suggest who should review. It should not quietly approve a change just because the diff looks tidy.
The final lane is human accountability. This is where architecture, product intent, release risk, and maintainability get decided. AI can summarize, gather proof, and point at conflicts. The human still signs the decision.
That structure is not heavy process for its own sake. It is a way to keep review from collapsing under faster code generation.
Confidence is not enough
AI systems love confidence scores. Review systems need something better: attached proof and explicit handoff rules.
A useful finding should say what was checked, what evidence supports the claim, what uncertainty remains, and what kind of human decision is needed. If the agent could not run tests, it should say that. If it only inspected the diff and not the surrounding call graph, it should say that. If the finding depends on an assumption about product behavior, it should name the assumption.
That makes the reviewer faster because the reviewer is no longer reverse-engineering the agent's reasoning from a polished comment.
It also makes the agent safer. A system that has to attach evidence is less likely to spray speculative advice across every PR. It has to earn its place in the review thread.
This is the bar I want from AI code review:
No comment reaches a human unless the system can explain why this reviewer, this finding, this evidence, and this moment belong together.
That is a routing requirement, not a model benchmark.
The real bottleneck moved
The old question was whether AI could generate code.
The current question is whether teams can absorb that code without turning review into a junk drawer.
That is why code review is becoming a routing problem. More code is only useful if the review system can separate cheap checks from hard judgment, evidence from speculation, and ownership from noise. The model matters, but the model is only one piece. The workflow around it decides whether AI review becomes a useful filter or another source of interruption.
The best version of AI code review will probably feel less like a chatty teammate and more like a disciplined dispatcher.
It will run the boring checks before the human arrives. It will send security-sensitive changes through deeper inspection. It will attach proof when it makes a claim. It will know when a finding needs a domain owner instead of a generic approval. It will leave humans with fewer comments, better questions, and clearer responsibility.
That is not as flashy as a bot that comments on every pull request.
Good. The review queue has enough noise already.
Source notes
- Rethinking Code Review in the Age of AI - supports the staged, workflow-oriented framing for AI-assisted code review.
- Human-AI Synergy in Agentic Code Review - supports the distinction between agent participation and human judgment in review.
- AgenticSCR: An Autonomous Agentic Secure Code Review for Immature Vulnerabilities Detection - supports the idea that tool-using agents fit security and evidence-gathering review work better than one-shot comments.
- Practitioner discussion on AI code review comment failures - used as community color around line-level and diff-context failure modes, not as the factual backbone.
Comments
Post a Comment