Skip to content
All guides

How to review an AI agent's code and send it back

Code and review7 steps6 minUpdated

Switch on Code review and name a reviewer. Each pull request is then reviewed when its task reaches review and on every push. Read the findings by severity and send the task back with the ones that matter.

Step by step

  1. Switch on Code review

    Open the project, choose Settings and the Agent access tab, and switch on Code review. The diff is sent to a model provider to be reviewed, and the review writes nothing back to the repository.

  2. Name a reviewer

    On the same tab, under Who reviews the work, open Reviewer and pick an agent. One task can override it in its own rail, where the default reads Project's choice. An agent cannot review its own work.

  3. Let a review run

    A review starts when the task enters a stage the reviewer picks up from, and again on every push to the branch. While one is running, the task says a reviewer is judging it now. Review again starts one by hand.

  4. Open the Code review screen

    Open the review from the task. Each row is one review: the pull request number, the commit, a count of findings at each severity, what triggered it and the date.

  5. Read the findings

    Expand a row. Each finding has a severity (critical, high, medium or low), the file and line range, a category such as security, bug or maintainability, and a sentence saying what is wrong. The footer names the model, the files and tokens read, the cost and the version of the done test it was judged against.

  6. Send the task back

    On the task, in the Code review band, choose which findings to cite or cite all of them, add a note under What matters most here? and press Send back. The task returns to the assignee with those findings, and a counter shows how many times it has been sent back.

  7. Read the verdict on the definition of done

    The Definition of done band at the top of the task shows how many clauses were met, not met or could not be told, with the version of the done test that was used.

Which findings should you send back?

Sending everything back teaches an agent nothing about priority, and each task has a limit on how many times it can go back. Cite the findings that change whether the work is correct.

SeverityUsual call
criticalAlways send back. In the screenshot above it is a way to read another tenant's ledger
highSend back. It is wrong behaviour a customer would see
mediumSend back when it is cheap to fix now and expensive later
lowLeave it, or raise a separate task

Use the note to say which one matters most. The note and the cited findings go back to the assignee with the task.

What is the reviewer judging against?

Two things. The code review reads the diff and reports findings. The definition of done verdict reads the finished work against each clause of the task's done test and marks it met, not met or cannot tell. The footer of each review names the version of the done test it used, so a later edit to the definition of done cannot quietly change what an old review meant.

What to check before you merge

  • The newest review is for the newest commit on the branch.
  • No critical or high finding is still open.
  • The definition of done band shows every clause as met.

Questions

What people ask about code review

When does a code review run?

When the task enters a stage the reviewer picks up from, and again on every push to its branch. Review again runs one by hand.

What do the severities mean?

There are four: critical, high, medium and low. Each finding also has a category from this list: bug, security, performance, maintainability, test, style, documentation or other.

Does the reviewer block a merge?

No. The findings and the verdict are advice for the person deciding. The reviewer does not move cards or refuse a status change by itself.

How many times can a task be sent back?

Three by default. An owner or admin changes the limit under After review on the Process tab, from never to 10 times. At the limit, a person decides the task by hand.

Are findings posted to GitHub?

No. Findings stay in Cognibl as records on the task. The review writes nothing back to the repository.

Why does the task say nothing checked the work?

Because no reviewer is set for the project, the reviewer was the same agent that did the work, or Code review is switched off. The band says which one.

Have a question we did not answer? Ask us.

Try Cognibl free

Free for one person. $5 per seat for teams.