Learning center

Before you click "Commit suggestion" on a bot's suggested change

A bot's committable suggestion replaces exactly the lines it is anchored to, and nothing else. Commit it as written only when that replacement is complete on its own and you can run your checks on the result. Apply it locally and edit it when it needs one more line, and decline it when the claim behind it is wrong.

What the button does#

GitHub's documentation describes the mechanics. You can apply a suggested change if you have write access to the repository, and "Applying one suggested change or a batch of suggested changes creates a single commit on the compare branch of the pull request." Each person who suggested a change becomes a co-author of that commit. GitHub: Incorporating feedback in your pull request

The button commits text that no one has run. Your CI sees the change only after it is on the branch. The suggestion also has a fixed footprint: the lines the reviewer selected. A suggestion that needs a matching edit outside those lines, such as a renamed variable used further down or a heading just above the range, cannot express it. The bot may also misjudge the boundary and repeat a line that sits just outside the range.

A suggestion that duplicated a heading#

In July 2026, a pull request in the tldw_chatbook repository added backlog tasks from an audit, and gemini-code-assist reviewed it. The branch picked up commits titled "Update backlog/tasks/task-197 - Index-ingested-content-into-the-RAG-v…", credited to gemini-code-assist as co-author, which is what committing a suggestion from the review produces. PR #610 The pull request merged on 12 July 2026, and its diff shows the result in the task file:

+## Acceptance Criteria
+## Acceptance Criteria
+<!-- AC:BEGIN -->

The bot's comment sits in a resolved thread whose text GitHub hides, so I could not see its exact range. A doubled first line is what you get when a suggestion's text starts with a line that sits just above its range. Five days later the author's follow-up pull request recorded the cleanup: "The committed AC suggestion had duplicated the ## Acceptance Criteria heading in the indexing task — removed." PR #649 description The same description notes the review follow-through was "verified against the code before applying". The fault was at the edge of the change, and a repeated Markdown heading is the kind of fault a test suite does not catch.

A suggestion that moved a parenthesis#

In November 2026, gemini-code-assist reviewed new Cloud Build samples in GoogleCloudSamples/client-library-samples and recommended renaming a parameter: "Specifically, it is recommended to rename the parameter id to build_id in the cancel and get build functions". Review The rename for each function was committed from the review, as a commit titled "Apply suggestion from @gemini-code-assist[bot]".

I fetched the sample file at each commit and compared them. The committed suggestion for cancel_build changed the lines from the signature to the end of the request call, and its last line put the closing parenthesis at column zero:

-        id=id,
-    )
+        id=build_id,
+)

Python accepts that, since indentation inside brackets does not matter (py_compile passes on that version of the file), so nothing failed. The get_build suggestion had the same fault. Two later commits restored the indentation by hand, the second titled "Fixing parenthesis issue left by gemini-code-assist[bot]". The pull request merged on 10 November 2026.

The same suggestion also stopped short of a line that mattered more. A reference to id further down the function was outside its range and kept the old name. That case is worked through in the guide to suggested fixes that change behavior.

Decide: commit, edit or decline#

What you findAction
The claim holds, the change is confined to the selected lines, and the lines just above and below are untouchedCommit the suggestion, then let CI run on the commit
The claim holds, but the change needs another line: a renamed name used elsewhere, a caller, an import, a testApply it locally with the extra edits, or commit it and push the rest at once before review continues
The suggestion repeats or drops a line at its boundary, or its indentation differs from the fileApply it locally and fix the boundary
The claim is wrong for this codeDecline it with the reason, as you would any finding
The claim holds but the change belongs elsewhereOpen an issue from the comment, which the documentation above describes

Several suggestions you accept together can go in one commit with "Add suggestion to batch", which keeps the branch history short. A batch still has to pass the same checks as one suggestion.

Check before you click#

  1. Read the anchored range in the Files changed view, then compare the suggestion's first and last lines with the lines just outside it. A repeated or missing boundary line is the most common mechanical fault.
  2. If the suggestion renames or removes anything, search the whole function and file for the old name. The suggestion cannot reach those lines.
  3. Run the formatter and the tests that cover the file on the result. If you cannot run them before committing, commit, then wait for CI before you resolve the thread.
  4. Read the diff of the commit the button created. It is short, and it shows what actually landed on the branch.

When you ask a coding agent to apply bot suggestions for you, hold it to the same steps; fixing a review finding with a coding agent covers how to check its work.

One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. Eligibility and fair-use terms.

Start free with GitHub

Related reading