GitHub 解析 Copilot 代码审查的多智能体架构与新分层
More agents, fewer blind spots: Inside GitHub Copilot code review
GitHub 重构 Copilot 代码审查的 Lite 和 Balanced 层级,并推出面向高风险拉取请求的 Max 层级,通过多个独立且互补的模型审查代码,再以投票或智能体聚合合并结果。在 ReviewBench 上,$3 per pull request 时混合 GPT-6.1 Sol 与 Claude Opus 5.5 将关键缺陷检出率从 61.3% 提高到 66.2%。Lite 和 Balanced 通常约 4 分钟完成,Max 的中位耗时约 12 分钟、90th percentile 可达 20 分钟。
推荐理由
精选AI 评分 77
文章以成本、召回率和误报控制为主线,展示多模型并行审查与聚合机制如何取舍质量和延迟。
主题
正文
Agents are writing more of our code every day, and every pull request still needs a review before it merges. Human reviewers can’t read every line of that growing volume, so teams are using AI to help.
An AI reviewer has to clear a hard bar, though. If it misses real bugs, nobody trusts its silence. If it buries those bugs in false alarms, nobody reads its comments.
Getting both right means finding actionable bugs, keeping false positives low, and holding latency and cost in check. At a fixed price, we’ve found that several smaller, independent reviewers using complementary models often outperform a single reviewer powered by a stronger model. We used that idea to rebuild Copilot code review’s Lite and Balanced tiers and to launch a new Max tier for your highest-stakes pull requests. This post explains why that works, how we turn many reviewers’ findings into one review, and how we used the idea to rebuild Copilot code review’s tiers.
Why does this work? A simple example
Consider a review agent with a fixed prompt, model, and set of tools. Suppose it has a 60% chance of flagging a particular bug in a pull request. It might catch that bug on one pass and miss it on the next.
If we run that reviewer twice, independently and in parallel, the probability that at least one run finds the bug rises to 84%, while the cost doubles. With three independent runs, the probability rises to 94%, while the cost triples.
More generally, if each reviewer has probability p of finding a particular bug, the probability that at least one of n independent reviewers finds it is 1 − (1 − p )^ n . In our example, p = 0.6. The key is that only one reviewer needs to find the bug.
Running several reviewers also has a cost in time. Review time can increase modestly because we have to wait for the slowest reviewer to finish.
Same-model and mixed-model reviews
Repeatedly running the same reviewer only takes us so far. We start to see diminishing returns after the third run.
Each model also has biases shaped by its training. Some bugs remain difficult for a given model to flag, no matter how many times it reviews a pull request. Models have particular strengths when reviewing code, and they also have specific blind spots.
In the chart below, the dashed line shows the highest percentage of critical bugs found at each price point by repeatedly running either GPT-6.1 Sol or Claude Opus 5.5. The solid line shows the highest percentage found by combining the two models.
The solid line is always at or above the dashed line, because a mix can include the single-model option. What matters is the gap between them, which shows the improvement available from mixing models. At $3 per pull request, combining these two models raises the share of critical bugs caught on ReviewBench by 4.9 percentage points, from 61.3% to 66.2%.
Copilot code review can draw on models from different providers, so it isn’t limited to one model family’s strengths and blind spots. That flexibility lets us pick complementary reviewers that perform best at a given price point.
Cohesive reviews
When two independent reviewers examine the same code, they may find some of the same bugs, and each may find issues the other misses. To reduce noise and avoid reporting the same issue several times, we combine their findings into one cohesive review. That means deduplicating findings and removing false positives.
Copilot code review uses two strategies to do this: voting and agentic aggregation.
Voting deduplicates the findings from all reviewers and counts how many reviewers flagged each one. Findings with fewer votes than a set threshold are suppressed, on the assumption that fewer votes signals lower confidence. Voting is fast and cost-effective, because deduplication takes only one-shot LLM calls.
Agentic aggregation uses an agent to reconcile the findings from all reviewers into one review. The agent can curate and refine findings, resolve disagreements, and double-check that each finding is accurate. In exchange, the review takes longer and costs more.
Let’s look at an example of a pull request that changes src/catalog/service.py , a Python file:
Three independent reviewers examine the changes and produce these findings:
The first two findings are true positives. The cache expects expiration times in milliseconds, and renaming a product updates the database but leaves its cached snapshot unchanged. A closer look at src/api/products.py , a file this pull request didn’t change, tells a different story about the third finding:
An existing guard already returns a 404 for a missing product, so the third finding is a false positive. Now consider what happens as we vary the voting threshold, which is the number of reviewers that must flag an issue before we show it:
With a threshold of one vote, we flag two real bugs and one false positive. Raising the threshold to two removes the false positive and leaves only real bugs, which raises precision. Raising it to three drops one of the real bugs, which lowers recall.
Voting gives us a cheap, fast, and simple way to curate findings. The challenge is choosing the right threshold, which can vary between pull requests. Agentic aggregation lets a more capable model check each finding, remove false positives, and filter out low-severity nits. In this example, an aggregator that checked src/api/products.py could drop the false positive and keep both real bugs, at the cost of a longer, more expensive review.
Voting rewards agreement and controls noise, which makes it useful when cost and latency are tight. Agentic aggregation costs more and, in our experiments, produced higher-quality findings.
New review tiers
We used independent, complementary reviewers and aggregation to rebuild our existing Lite and Balanced tiers and to launch a new Max tier. At a high level, each tier reviews your pull request with these agents:
Lite: 4× GPT-5.6 Luna reviewers, combined with voting.
Balanced: 3× GPT-6.1 Sol reviewers, combined with agentic aggregation by GPT-6 Astra.
Max: 4× GPT-6.1 Sol, 2× Claude Opus 5.5, and 2× GPT-6 Astra reviewers, combined with agentic aggregation by GPT-6.1 Sol.
To develop and iterate on the initial configurations for all three tiers, we used ReviewBench , a benchmark for code review agents built on representative GitHub pull requests and production-aligned metrics. We then ran several rounds of online experiments on internal and external traffic.
How we measure
Online experiments: In total, 1.4 million pull requests, including external ones, were involved in the online experiments to design the lite and balanced tiers between September 16 and October 7. We used 30K internal reviews within GitHub and Microsoft between October 2 and 7 to design and test the Max tier.
Severity: Each finding is labeled critical, moderate, or low by a separate agent using a rubric. A critical comment is a concrete problem that should be fixed before merging; a moderate one is an issue that affects behavior but is unlikely to cause serious harm, while a low severity comment is one that describes a minor improvement that can safely be deferred.
Precision: The share of findings that are real issues.
Recall: The share of real issues that Copilot code review found. We estimate this at review time by looking at the comments and issues identified by other agents or humans and comparing them to those flagged by Copilot code review.
Addressed/Ignored/False positive: Just as we have a separate agent label severity, we also have an agent check whether a comment was addressed or ignored. An addressed comment is one which is fixed when the pull request merges, while an ignored one is one on which a user does not act upon. A false positive is a comment that a user has explicitly indicated is incorrect or invalid.
Here’s how the final tier configurations performed online:
What is the difference in coverage and quality?
First, let’s compare the average number of findings per review for each tier, broken down by severity:
Max provides the greatest coverage, especially of critical issues, which was our goal. Lite and Balanced produce a similar total number of findings per review, and Lite produces more critical and low-severity findings. Balanced finds fewer issues than Lite, but more of them are worth fixing.
The chart below shows the percentage of critical and moderate findings that developers addressed, ignored, or that were classified as false positives, for each tier:
Together, these form three distinct tiers. Developers act on more findings as you move from Lite to Balanced to Max. That makes Lite better for frequent review while you’re iterating, and moving to Balanced and Max as you get closer to final.
How much do the tiers cost?
Each tier targets a specific price and quality range, with target costs rising roughly 6× from one tier to the next. Lite is designed for frequent reviews as you iterate. Max is designed for a thorough pass before you merge.
Balanced sits between them, offering a middle ground between fast iteration and a final review.
Max also asks more of you. It leaves about two findings per review, compared with about 1.1 to 1.2 for Lite and Balanced, so there’s more to read. It’s worth using it where a missed bug would typically cost more than the review.
How long does each tier take?
Review time matters too. Sometimes you need fast feedback while you build. Other times, correctness and thoroughness matter more than speed.
Lite and Balanced typically finish in about four minutes. Max takes about 12 minutes at the median and can take 20 minutes at the 90th percentile, so it fits best as a final pass.
Just a starting point
This is a snapshot of where the tiers stand today. As new models become available and our approach improves, we’ll update each tier to deliver the best performance we can within its price range.
Next: Review effort that fits the change
Every tier uses the same tools and review prompt. The tier sets how hard Copilot code review looks. Your repository’s context sets what it knows to look for, including your team’s conventions, the exceptions you allow, and the mistakes your reviewers keep catching.
Different parts of a pull request may also need different levels of attention. Some may require a frontier model, while a smaller model may be sufficient for others. We’re working toward dynamic code review, dispatching reviewers from a roster of review personas to specific parts of a pull request and tailoring the review to its needs.
The goal remains one useful review: more chances to catch important issues, without handing the work of sorting through findings back to you.
AI 热点