Sub topic 4
Reading Copilot's review comments
This chapter assumes you can open a pull request, read a diff, and leave or resolve a review comment on GitHub. It also assumes you have already requested a Copilot review from the Reviewers menu. Here you learn what Copilot's review contains, how to judge each comment, and which mistakes to avoid when you read one.
What a Copilot review contains
When Copilot finishes, it posts one review on the pull request. The review has two parts.
- A summary comment in the Conversation tab. It gives a short overview of the pull request and the files Copilot looked at.
- Inline comments attached to specific lines in the Files changed tab. Some of them include a suggested change that you can commit with one click.
Copilot always submits its review with the "Comment" status. It never uses "Approve" or "Request changes". This has two consequences:
- Its review does not count toward required approvals under branch protection.
- Its review cannot block a merge.
Treat the review as input for you and your human reviewers. It is not a decision.
Reading the summary first
Start with the summary. It tells you what Copilot thinks the pull request does. Compare that description with your own intent.
- If the summary matches your intent, Copilot probably understood the change, and its inline comments are more likely to be relevant.
- If the summary describes a different change, Copilot misread the diff. Be more skeptical of its inline comments. The pull request description may also be unclear, and a human reviewer could be confused in the same way.
The summary can also list files that Copilot did not comment on. Some files may be skipped because of size, type, or limits on how much the review can process. A lack of comments on a file is therefore not evidence that the file is correct. It may mean Copilot never examined it closely.
Anatomy of an inline comment
A typical inline comment has three elements:
- A location. The comment is attached to a line or a range of lines in the diff.
- A claim. Copilot states what it believes is wrong or risky, such as a missing null check, a query built by string concatenation, or a public function without a test.
- An optional suggested change. This is a code block you can apply directly.
Read the claim before you look at the suggested change. A suggested change is only as good as the claim behind it. If the claim is wrong, the code change is wrong too, even if it compiles and looks tidy.
If you have written repository custom instructions, you will often see Copilot's comments reflect them. For example, with the instruction "Keep each comment short and say why the change is needed", each comment should state the reason in a sentence or two. A comment that gives no reason is harder to judge. You can often improve those by tightening the instruction file, which a later chapter covers.
Judging each comment
Run every comment through the same four questions.
- Is the claim true? Open the surrounding code, not just the highlighted lines. Copilot sees the diff and some context, but it can miss a guard clause, a helper function, or a configuration value defined elsewhere.
- Does it matter here? A comment can be technically correct and still not worth acting on. A warning about an unhandled error is less important in a throwaway script than in a payment handler.
- Is the proposed fix right? Check that the suggested change does what the explanation says. Check that it keeps the existing behavior in cases the comment did not mention.
- Does it fit your conventions? The fix should match your code style, your dependencies, and the architecture of the project.
Then pick one outcome for each comment:
| Outcome | When to choose it | What to do |
|---|---|---|
| Accept | The claim is true and the fix is correct | Commit the suggestion or make the change yourself |
| Adapt | The claim is true but the fix is wrong or incomplete | Write your own fix and reply with a short note |
| Dismiss | The claim is false or irrelevant | Resolve the conversation, preferably with a reason |
| Escalate | You are unsure | Ask a human reviewer to look at that thread |
The next chapter covers the mechanics of applying and dismissing suggestions. For now, focus on deciding.
A worked example
Suppose a pull request adds this function to a Node.js service.
async function findUser(db, name) {
const sql = "SELECT * FROM users WHERE name = '" + name + "'";
const rows = await db.query(sql);
return rows[0];
}Copilot might leave a comment on the line that builds sql. In paraphrase, it would say that building a query by string concatenation allows SQL injection, and that a parameterized query should be used. Its suggested change would look like this:
async function findUser(db, name) {
const rows = await db.query("SELECT * FROM users WHERE name = $1", [name]);
return rows[0];
}Apply the four questions.
- Is the claim true? Yes. Concatenating user input into SQL is a real injection risk.
- Does it matter here? Yes, if
namecan come from a request. - Is the fix right? Partly. The
$1placeholder works with thepglibrary but not with every client. MySQL drivers use?. Check which library your project uses before committing. - Does it fit your conventions? Check whether your code uses a query builder or an ORM instead of raw SQL.
The result is probably "Adapt". The claim is correct, but you confirm the placeholder syntax before you commit the change. This is the typical pattern. The diagnosis is often useful, and the proposed code needs a quick check.
Common reading mistakes
Treating silence as approval. A review with no inline comments does not mean the code is correct. Copilot may have found nothing, or it may have missed the problem. Your human review and your tests still apply.
Trusting confident wording. Copilot writes in a steady, assured tone whether it is right or wrong. The tone says nothing about accuracy.
Accepting suggestions in bulk. It is tempting to commit every suggestion to clear the list. Suggestions can conflict with each other or with code elsewhere in the pull request. Apply them one at a time, or in small groups, and check the result.
Dismissing comments without reading them. The opposite mistake wastes the tool. Even a wrong comment sometimes points at code that is confusing. If Copilot misread it, a human might too, and a clearer name or a short comment in the code can help.
Expecting the same review twice. Copilot's output is non-deterministic, so two runs on the same diff can differ. A comment that disappears after a re-review was not necessarily fixed, and a new comment does not necessarily mean you introduced a problem. Judge each comment on its own merit.
Reading comments out of context. Inline comments only show part of the file. Use the Files changed tab to open the full file or the branch locally when a claim depends on code that is outside the diff.
Dealing with noisy or repetitive comments
Sometimes a review fills with comments about style, naming, or formatting that your linter already handles. This is a signal about your instructions, not about the code.
- If the comments repeat a rule that your linter enforces, add a line to your custom instructions saying that formatting is enforced by the linter and should not be commented on.
- If the comments are too vague, ask for a reason in each one. The example instruction file from this tutorial does this with "Keep each comment short and say why the change is needed."
- If the comments are consistently wrong for one kind of file, such as generated code or test fixtures, scope your guidance with a path-specific file. Both kinds of instruction files get their own chapters.
Changing the instructions affects future reviews. It does not rewrite the review you already have, so for the current pull request, resolve the noise manually.
Leaving a record
Your teammates will read the pull request later. A resolved thread with no explanation leaves them guessing whether a comment was addressed or ignored. A short reply helps:
- "Fixed in the next commit."
- "Not applicable. This function only receives values from our own config file."
- "Keeping as is. The
anytype is needed because the library has no type definitions."
Replies like these also help the human reviewer. They can see which Copilot findings you judged and spend their time on the parts that need human attention.
Exercise
Copilot posts a review on your pull request with no inline comments and a summary that describes your change accurately. A teammate says the pull request is now safe to merge without further review. Explain why this reasoning is flawed, and name two things that still apply.
Show answer
Copilot's review has the "Comment" status. It is not an approval and does not count toward required reviews. Having no comments only means Copilot did not report anything. It may have missed a problem or not examined every file closely. Two things that still apply are the required human review under your branch protection rules, and your CI checks, such as tests and the linter.
Exercise
Copilot comments on a line in your diff: "This function does not check whether user is null." The suggested change adds a null check. You open the full file and find that the caller already guarantees user is never null. Which outcome from the table do you choose, and what should you do on the thread?
Show answer
Dismiss. The claim is false in context, because the guard exists in the caller. Resolve the conversation with a short reply that explains where the guarantee comes from, for example "The only caller validates user before this call." If the guarantee is easy to miss, you could also add a brief code comment so a human reader is not confused in the same way.
Exercise
You re-request a review after pushing a commit. A comment from the first review does not appear in the second one, even though you did not change that code. Does this mean the original comment was wrong?
Show answer
No. Copilot's reviews are non-deterministic, so two runs on the same code can differ. The missing comment could mean the first claim was wrong, or the second run could have missed a real issue. Judge the original comment on its own merits by checking the code, instead of relying on whether it appears again.