# Request a review

> Abstract: Post `/review` on an open GitHub pull request or GitLab merge request. The poller checks who asked, reviews the change once, and posts one comment on the reviewed head. The command line does the same for a change address or a local branch.

## Post the comment

Post a new comment containing just `/review` on an open GitHub pull request or GitLab merge request. The service polls the configured projects every two minutes by default, and accepts new requests from the human accounts you configure.

The result is posted on the reviewed head: one comment, naming the commit it describes. A poll uses zero model tokens. Requests run one at a time, with the existing prompt budget and cache.

> The comment's text, with surrounding whitespace removed, must equal `/review` exactly. `/review please`, and a reply that quotes the command, do not start a review.

## What the poller skips

| A comment is skipped when | Because |
|---|---|
| Its author is not one of the project's requesters | Only the accounts you list may spend a model call. |
| Its text is not exactly `/review` | Anything more is an ordinary message. |
| It has been edited | The forge's created and updated timestamps differ. |
| It is older than the project's first activation | Requests from before the project was watched were never queued. |
| Its author is a bot, or it is a forge quick action | A bot must not be able to start a review. |
| It is already queued or already done | The same comment is never reviewed twice. |

Setup takes GitHub or GitLab usernames and stores their numeric account IDs. The poller compares each comment author's ID against that list.

Assay's `deskmonitor pr` supplies the open change numbers. Batched `deskread comments --change` calls read their conversations on every cycle, including changes with no new commits.

> For GitLab, Assay v1.0.94 omits the internal-note flag. Only a comment that already qualifies gets a single [note lookup](https://docs.gitlab.com/api/notes/#retrieve-a-merge-request-note), using the existing reviewer credential and instance. Internal and system notes cannot start a review.

## One at a time, across every project

Requests from all configured projects share one queue. It is drained oldest first, one review at a time, so a long review on one repository delays the next request on another.

The queue lives in a SQLite database on the state volume, with the cache and the request history. Keep the state volume across restarts, and requests posted during downtime on still-open changes are picked up on the next cycle. Queued reviews survive a restart.

A review that was interrupted after it started is not reissued. It needs a fresh `/review`.

> A deleted comment, or a change closed between two polls, may never be observed. Neither costs a model call.

## What reaches the pull request

The review runs the same steps as the command line with `--change`, plus `--post`. The posted comment has a fixed shape:

1. A header naming the provider and the full commit.
2. The review's state.
3. The model's findings, at most three, each with its path and line.
4. Each local check that could not run, and the findings of the checks that did.
5. The static checks, with a count for each tool.
6. The history advisories, where a history is available.
7. Each path that lies outside the review's coverage.

[Output and exit codes](output.md) lists every line the comment can contain. The [overview](index.md) quotes a real one.

## With the command line

The local form reviews a branch in a checkout. The forge form reviews a pull request or merge request by address:

```sh
cursor-review --repo /path/to/checkout --base main --estimate
cursor-review --repo /path/to/checkout --base main --max-input-tokens 4000
cursor-review --repo /path/to/checkout --change 'org/repo#42' --estimate
cursor-review --repo /path/to/checkout --change 'org/repo#42' --model MODEL
```

The local form compares the merge base to the committed `HEAD`, or to an explicit `--head`. Both commits and their common ancestor must be available locally.

The forge form uses the configured Assay backend for that repository. Both forges use the `owner/repo#number` address accepted by `deskread`. GitLab subgroup projects can also use CI mode, independent of `deskread`'s slug syntax. Forge access requires the installed desk tools and their normal role and repository configuration, which the container provides.

> The forge form reads metadata before and after the file list, and checks that the head and the file count agree. A file whose patch is missing is recorded as incomplete coverage, not skipped.

## Publish a summary

Add `--post` to the `--change` command to post the reviewed commit and its findings as a single ordinary comment. Assay handles GitHub and GitLab routing, reviewer custody, repeated identical comments and the current-head check through `deskpost comment ... --kind mr --head SHA`. A stale head is refused.

Publication requires the configured Assay reviewer role. No write happens by default.

> A failed post can be retried with the same model and cache, without paying again for an unchanged prompt.

The poller supports `/review`. The upstream PR-Agent chat commands such as `/ask` and `/improve` belong to its comment server, which is a separate entry point from this reviewer. See the upstream guides for [GitHub](https://docs.pr-agent.ai/installation/github/) and [GitLab](https://docs.pr-agent.ai/installation/gitlab/). GitLab pipeline jobs alone do not receive comment events.

## If nothing happened

Work down this list before changing anything:

1. Is the author one of the project's `requester_ids`?
2. Was the comment posted after the project was first activated, and left unedited?
3. Is the change still open, and is the comment a fresh one rather than a quick action?
4. Is another review ahead of it in the queue? Each poll waits 120 seconds by default, and reviews run one at a time.
5. Did the review start and get interrupted? Post `/review` again.

---

Source of this page: https://pr-agent.assay.guide/request
