Sub topic 11
Limitations: why Copilot's review can be wrong
This chapter assumes you can open and review pull requests on GitHub, and that you have already requested a Copilot review at least once. It explains why Copilot's feedback can be wrong or incomplete, and how to handle that in practice.
Why a review is not an approval
Copilot code review is a model that reads your diff and some surrounding context, then writes comments. It posts its review with the "Comment" status. It never approves a pull request and never blocks a merge. A human approval records that a person accepted responsibility for the change. Copilot's review does neither.
Treat it as a fast first reader. It is useful for catching typos, missed error handling, and obvious bugs. It is not a gate.
Non-determinism
Copilot's output comes from a language model, so two runs on the same diff can differ. You may see these effects:
- A comment appears on one review and not on the next, with no code change in between.
- The same problem is described with different wording or a different severity.
- A re-requested review raises new points about code it did not mention before.
Do not read silence as a sign that code is correct. A review with no comments means only that the model did not flag anything this time.
Common failure modes
Copilot's comments tend to go wrong in a few predictable ways.
| Failure mode | What it looks like | How to check |
|---|---|---|
| False positive | Flags correct code as a bug | Reproduce the problem or write a test for it |
| Missed issue | Skips a real defect | Rely on human review and your test suite |
| Limited context | Misses behavior defined in files outside the diff | Read the related code yourself |
| Plausible but wrong fix | A suggested change looks tidy but alters behavior | Run tests before committing it |
| Style noise | Comments on formatting the linter already handles | Add guidance to your custom instructions |
The limited-context case is the most common. The model sees your changes and some nearby code. It may not know about a caller in another module, a database constraint, or a convention your team follows. A comment such as "this value could be null" may be wrong because a validator upstream already guarantees it.
Suggested changes need verification
A suggestion can be applied with one click, which makes it easy to skip scrutiny. A suggested change can compile and still be wrong. Before you accept one:
- Read the explanation and confirm you understand the claimed problem.
- Check that the suggested code does what the original did, apart from the fix.
- Push the change and let your continuous integration (CI) run.
If CI fails after you apply a suggestion, revert it or fix it by hand. The suggestion does not carry any guarantee.
Reducing noise with instructions
You cannot make the model deterministic, but you can steer it. The repository instruction file from an earlier chapter already tells Copilot to prefer correctness and security over style. If you keep seeing the same unhelpful comment, add a line that addresses it directly. For example, if Copilot keeps flagging formatting, state that the linter enforces it.
# Review guidelines
- Do not comment on formatting or import order; the linter enforces both.
- Assume inputs to internal functions are validated at the API boundary.
- Keep each comment short and say why the change is needed.Instructions reduce repeated mistakes but do not remove them. Review a few weeks of Copilot's comments, note which kinds are consistently useless, and adjust the file.
A practical evaluation habit
For each comment, ask three questions:
- Is the claim true? Check the code, not the comment's tone.
- Does it matter in this project? A real but irrelevant issue can be dismissed.
- Is the proposed fix the right one? The problem may be real while the fix is wrong.
Dismiss comments that fail these checks. You do not need to justify every dismissal to the tool, but if a reviewer on your team might wonder why you ignored it, leave a short reply in the thread.
Key points
- Copilot posts comments only. It does not approve or block.
- Results vary between runs, so absence of comments proves nothing.
- Limited context is a main cause of wrong comments.
- Verify suggested changes with tests before accepting them.
- Use custom instructions to cut repeated noise.
Exercise
Copilot reviews your pull request and leaves no comments. A teammate says the code can merge without a human review. Give two reasons this reasoning is flawed.
Show answer
First, Copilot's review has the "Comment" status and is not an approval, so it does not replace a required human review. Second, its output is non-deterministic and limited by context, so no comments does not prove the code is correct. A re-run might raise issues, and it can miss defects that depend on code outside the diff.
Exercise
Copilot suggests a one-click change that renames a variable and also changes a loop condition from "<" to "<=". What should you do before accepting it?
Show answer
Read the explanation, confirm the loop condition change is justified and not an off-by-one error, then apply it on the branch and run the tests and CI. If the behavior change is not intended, reject the suggestion or make only the rename by hand.