More agents, fewer blind spots: Inside GitHub Copilot code review
How Copilot code review combines independent AI reviewers to find more bugs with less noise.
GitHub Copilot code review is an AI-powered tool designed to assist human reviewers in examining and reviewing code changes. However, the volume of code being reviewed is growing rapidly, making it challenging for human reviewers to read every line. To address this issue, GitHub has introduced AI reviewers that can help identify and flag potential bugs in the code.
The key challenge is to find the right balance between catching real bugs and minimizing false alarms. Running multiple reviewers independently and in parallel can significantly improve the detection rate of bugs. For instance, if each reviewer has a 60% chance of flagging a particular bug, running three independent reviewers increases the probability of catching the bug to 94%.
However, this approach also increases the cost and review time, as each reviewer must be completed before moving on to the next. GitHub has found that using multiple reviewers with complementary models can outperform a single reviewer powered by a stronger model. The company has rebuilt Copilot code review's Lite and Balanced tiers and launched a new Max tier to handle high-stakes pull requests.
This approach allows GitHub to leverage the strengths of different models while minimizing their blind spots. To further refine the review process, GitHub uses two strategies to combine the findings of multiple reviewers. The first strategy is voting, which deduplicates the findings and counts how many reviewers flagged each issue.
Findings with fewer votes than a set threshold are suppressed, as they indicate lower confidence. The second strategy is agentic aggregation, which uses an agent to reconcile the findings and resolve any disagreements. While this method takes longer and costs more, it results in a more cohesive review. Let's consider a pull request that changes a Python file called src/catalog/service.py.
Three independent reviewers examine the changes and produce the following findings: 1. Cache expiration uses the wrong units (True positive) 2. Renaming a product leaves stale cached data (True positive) 3. Missing products crash the endpoint (False positive) The first two findings are true positives, meaning they accurately identify issues in the code.
However, the third finding is a false positive, as an existing guard already returns a 404 for a missing product. By varying the voting threshold, which is the number of reviewers that must flag an issue before it is shown, GitHub can fine-tune the review process to balance accuracy and efficiency.
Rewritten by urgent.news; may contain errors — check the original.
Source: github.blog