AI at Work
GitHub Copilot Code Review: Verify a Suggested Fix Before You Accept It
Verify a review finding separately from its suggested patch using a synthetic incomplete fix, a false positive, actual regression results, and a recorded decision.
Before accepting a GitHub Copilot code-review fix, identify the claimed defect, reproduce it against the intended behavior, and test the proposed change for regressions. A valid comment can still contain an incomplete patch. An incorrect comment can also persuade you to remove behavior that callers need. Decide separately whether the finding is valid and whether its suggested implementation is acceptable.
This LandOffer.ai guide combines current GitHub documentation with a self-created Python demonstration actually executed locally. The example comments and patches are editorial constructions, not output obtained from Copilot. We did not request a live review, change a GitHub repository, merge a pull request, or measure Copilot's detection quality.

Turn the comment into a checkable claim
GitHub's code-review overview describes review feedback and suggested fixes. It also says feedback needs validation and human review. The feature's existence does not establish that a particular finding is correct for your application's contract.
Start by restating the comment in testable terms. What input reaches the affected line? What happens now? What should happen instead, and which requirement establishes that expectation? If the comment depends on an assumption about valid inputs, locate that assumption in the caller, schema, tests, or agreed design.
GitHub's responsible-use documentation identifies missed problems, false positives, and incorrect or insecure suggestions as limitations. Examine each finding against the relevant contract and code. A useful comment may reveal a genuine boundary error even when its proposed fix needs revision.
Separate a correctness defect from a preference. Renaming a variable may be useful, but it has a different verification burden from changing permission checks or persistence behavior. Base the acceptance decision on the behavior changed and the evidence supporting it.
Establish the contract before writing the regression
Our synthetic function checks whether two intervals overlap. The declared contract uses integer offsets from an arbitrary reference point. Each interval includes its start and excludes its end. Negative offsets are valid, and an interval must have positive length.
That means an interval from 1 up to 3 and one from 3 up to 5 touch but do not overlap. An interval beginning before the reference point is not invalid merely because its start is negative. These are editorially defined requirements for this demonstration, not facts about every scheduling application.
Here is the original implementation, saved as a small standalone module:
def overlaps(a_start, a_end, b_start, b_end):
"""Half-open integer offsets; negative offsets are valid."""
if a_start >= a_end or b_start >= b_end:
raise ValueError("intervals must have positive length")
return a_start <= b_end and b_start <= a_end
The length guard is intentional. Replacing the overlap expression should not silently remove it. The function does not parse calendar dates, manage time zones, or validate arbitrary object types. Those concerns remain outside this example's declared input contract.
In a real pull request, inspect the callers before treating a comment as proof that the contract is wrong. If the documentation and callers disagree, resolve that disagreement with the responsible maintainer. Do not choose whichever interpretation makes a suggested patch easiest to apply.
Worked finding: a real defect with an incomplete patch
The first constructed review comment says: “Touching half-open intervals are classified as overlapping. Use a strict comparison.” The finding is valid for our contract. The original function returns True for overlaps(1, 3, 3, 5), although the expected result is False.
The constructed patch changes only one comparison:
- return a_start <= b_end and b_start <= a_end
+ return a_start < b_end and b_start <= a_end
This patch improves one ordering of the boundary case but misses the other. For overlaps(3, 5, 1, 3), the first comparison becomes false and the result is correct. For overlaps(1, 3, 3, 5), the second comparison still permits equality, so the result remains wrong.
The revised implementation keeps the original guard and makes both comparisons strict:
- return a_start <= b_end and b_start <= a_end
+ return a_start < b_end and b_start < a_end
The completed finding record is: valid defect; suggested patch requires revision. The evidence is the pair of touching cases with reversed argument order. Passing only the example that the patch happens to repair would leave the function asymmetric at the boundary.
This illustrates why a regression should represent the requirement independently of the proposed code. If you read the patch first and write only its convenient example, you can confirm the change without checking the behavior that matters.
Worked false positive: a guard that breaks valid input
The second constructed comment says: “Negative interval offsets are invalid; reject them before checking overlap.” That claim contradicts the demonstration's contract. The values are offsets from a reference, not an absolute timestamp format that must begin at zero.
The executed local suite includes overlaps(-10, -2, -5, 0). The intervals share positions before zero, so the expected result is True. The revised overlap expression returns True, as intended.
To test the suggested restriction, we added a negative-value guard to the otherwise corrected implementation:
if min(a_start, a_end, b_start, b_end) < 0:
raise ValueError("negative offsets not allowed")
That variant raises ValueError for the valid negative-offset case. The completed decision is: reject the restriction for this contract. Retain the existing positive-length validation, which rejects zero-length and reversed intervals for a different reason.
A rejected finding still deserves an explanation. Record the governing requirement and a reproducible valid input. “The AI is wrong” gives a later reader less information than “negative offsets are permitted by this function's contract, and this proposed guard rejects an overlapping valid pair.”
In a real repository, the same guard could be appropriate under a different contract. Our result demonstrates a specific false-positive scenario; it does not estimate how often Copilot produces one.
Run the same checks against every candidate
We executed the original, partial, revised, and negative-guard variants using Python 3.12.14. Each variant ran the same nine-case suite twice, in separate temporary directories, with a ten-second subprocess timeout. No network service, production system, or real user data was involved.

The suite included ordinary overlap, containment, identical intervals, a gap, both touching orders, valid negative offsets, zero length, and reversed endpoints. The last two cases expected ValueError; the negative-offset case expected a Boolean overlap result.
| Candidate | Actual local result on both runs | Decision supported by the evidence |
|---|---|---|
| Original implementation | Seven of nine cases passed; both touching orders failed. | Confirm the boundary defect. |
| Constructed one-comparison patch | Eight of nine passed; touching on the right still failed. | Revise the incomplete patch. |
| Two-comparison revision | All nine passed. | Accept this bounded correction for the demonstration. |
| Corrected code plus proposed negative guard | Eight of nine passed; valid negative offsets raised an error. | Reject that additional restriction. |
The original, partial, and negative-guard test processes exited with status 1 because the suite contained failed expectations. The revised variant exited with status 0. This matters: a harness that prints failures but exits successfully can make a broken candidate look green to an automated caller.
Interpret the suite by the behaviors it checks. Nine deliberate checks support these specific decisions; they do not establish complete security, integration compatibility, or correctness for undeclared input types. Repeating the suite in fresh directories checks that this small demonstration does not depend on a previous variant's imported module. It does not recreate a production runtime.
A second, independently defined check compared every positive-length interval whose integer endpoints lie between -3 and 3. There are 21 such intervals and 441 ordered pairs. For each pair, the expected result came from intersecting the sets of occupied integer positions, rather than copying the proposed comparison expression into the test.
In that finite comparison, the original implementation disagreed with the expected result for 70 pairs. The partial patch disagreed for 35 pairs and produced different results when arguments were swapped in 70 ordered pairs. The revised implementation had no mismatches or swap inconsistencies within that domain. Those are actual local results saved alongside the nine-case suite.
The two checks serve different purposes. Named examples explain the intended boundaries to a reviewer, while the small-domain comparison checks more combinations against a separately expressed expectation. Neither replaces the contract: if touching intervals were meant to conflict, both the expectation and the decision would change.
This additional comparison remains limited to positive-length integer intervals in the stated range. It does not prove behavior for floating-point values, date objects, or every application input. Keep that domain beside the result when using it in a review note.
Inspect what the patch changes beyond the reported line
After the targeted regression passes, read the complete diff and inspect callers that depend on its return value or exceptions. A plausible fix may also change return types, exception behavior, default values, logging, dependencies, or access to data. Those changes need their own justification rather than inheriting approval from the original finding.
For this demonstration, the accepted diff changes two comparison operators and preserves the length guard. The negative-input behavior remains valid, and invalid-length inputs still raise the expected exception. No additional package, configuration change, or external action is required.
For actual application work, run the relevant existing checks as well as the new regression. A pure helper test cannot establish that a caller interprets the result correctly. If an untested integration or environment remains material, name it in the review and keep the necessary acceptance pending.
GitHub's suggestion workflow allows suggestions to be incorporated into commits or passed to the cloud agent. Applying a change is a code mutation, not proof of its behavior. Review the resulting diff even when another tool implements the suggestion for you.
The same guide says a new push does not automatically receive another Copilot review unless the applicable automatic-review configuration includes new pushes. Check what actually ran against the current revision. Resolving a comment or receiving an earlier review is not evidence that the latest patch was examined.
Record an accept, revise, or reject decision
Here is the completed editorial review note for our locally tested example. It is a model of what to record, not a comment posted to a real pull request:
Decision: Revise the proposed boundary fix; accept the two-comparison correction for the declared integer-offset contract. Reject the separate negative-offset guard.
Evidence: The original implementation fails both touching-order cases. The one-comparison patch still fails the right-touch case. The revised expression passes all nine checks on two isolated Python 3.12.14 runs while preserving invalid-length exceptions. Adding the negative guard breaks the valid negative-offset case.
Remaining scope: This exercise does not test calendar parsing, time zones, concurrency, persistence, application callers, or arbitrary input types. It is not a security review or a production approval. A real repository needs its maintainer's review and applicable project checks before integration.
Record the finding disposition and the patch disposition as separate decisions, with the failing or passing cases beside each. You may accept the reported defect, revise its patch, and reject an unrelated restriction in the same review. That is more informative than treating the whole automated review as a single approval decision.
A green result should identify what ran, against which candidate, under which assumptions. If a check could not run, state the reason and what decision it leaves open. Do not translate “no failing tests observed” into “no defects remain.”
Finally, follow the repository's actual review and merge requirements. GitHub currently documents configurable Copilot approvals in public preview, so avoid assuming every repository treats its review identically. Regardless of configuration, retain the evidence needed for the human decision. For more workplace verification guidance, return to LandOffer.ai after recording the tested patch and remaining risks in your project's own review system.


