> ## Documentation Index
> Fetch the complete documentation index at: https://developer.upsun.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Code review

> Use Upsun Dispatch Code review to review GitHub pull requests and GitLab merge requests with an LLM-backed review agent.

The **Code review** workflow reviews GitHub pull requests and GitLab merge requests with an LLM-backed review agent. It inspects the change in a read-only checkout, then publishes integration-native review artifacts such as check runs, review comments, merge request notes, and commit statuses.

Use Code review when you want Upsun Dispatch to:

* review a new or updated pull request or merge request,
* post inline findings and body-only findings,
* summarize the change when configured to do so,
* recognize previously reviewed file sets so unchanged work is not reviewed again unnecessarily, and
* show progress and terminal status in GitHub or GitLab.

You can review workflow runs and their logs in the [Upsun Dispatch console](/dispatch/docs/dashboard). Manage trigger mode, summary mode, and repository overrides in [Workflows in Upsun Dispatch](/dispatch/docs/workflows#workflow-settings).

## GitHub and GitLab reviews

<Tabs>
  <Tab title="GitHub">
    For connected GitHub repositories, Upsun Dispatch listens for pull request changes and pull request conversation comments.

    #### Automatic reviews

    When Code review is configured for automatic triggering, opening or pushing to a GitHub pull request starts a review.

    If another push arrives while a review is already running, Upsun Dispatch waits instead of starting several overlapping reviews. After the active review finishes, Upsun Dispatch drains one fresh follow-up run against the latest pull request head. This collapses push storms into a single current review.

    #### Manual commands

    You can control reviews from a pull request comment. GitHub commands must be the whole comment message and addressed to the Upsun Dispatch bot.

    ```text theme={null}
    @upsun-dispatch review
    @upsun-dispatch full review
    @upsun-dispatch cancel
    @upsun-dispatch help
    ```

    Supported command behavior:

    * `review` requests a review. If a review is already active, Upsun Dispatch waits for it to finish, then runs a fresh review.
    * `full review` forces a full review instead of an incremental review. If a review is already active, Upsun Dispatch waits for it to finish, then runs a fresh full review.
    * `cancel` stops the active review.
    * `help` can post command help.

    Upsun Dispatch ignores ordinary pull request comments that do not match a supported command. Plain GitHub issue comments are handled by [Issue to code](/dispatch/docs/workflows/issue-to-code), not Code review.

    #### Progress and results

    While the review runs, Upsun Dispatch creates a GitHub check run so contributors can see that work is in progress. When the review completes, Upsun Dispatch concludes the check run and publishes the review result to GitHub.

    Depending on the review result, GitHub may receive:

    * a completed check run,
    * pull request review feedback,
    * inline comments,
    * body-only findings, and
    * summary text when summaries are enabled.

    If a run fails or is canceled before the final review step completes, Upsun Dispatch attempts to update the GitHub check run so GitHub does not show stale in-progress status.
  </Tab>

  <Tab title="GitLab">
    For connected GitLab projects, Upsun Dispatch listens for merge request changes, merge request notes, and reviewer changes.

    #### Automatic reviews

    When Code review is configured for automatic triggering, opening or updating a GitLab merge request starts a review. GitLab merge request review uses the same wait behavior as GitHub: if a review is already active, a newer change waits and Upsun Dispatch runs one current follow-up review after the active review ends.

    Closing or merging a merge request cancels an in-flight review instead of starting a new one.

    #### Manual commands

    You can control reviews from a merge request note by mentioning the bot username configured for that GitLab connection.

    ```text theme={null}
    @<configured-bot-username> review
    @<configured-bot-username> full review
    @<configured-bot-username> cancel
    @<configured-bot-username> help
    ```

    Supported command behavior:

    * `review` requests a review. If a review is already active, Upsun Dispatch waits for it to finish, then runs a fresh review.
    * `full review` forces a full review instead of an incremental review. If a review is already active, Upsun Dispatch waits for it to finish, then runs a fresh full review.
    * `cancel` stops the active review.
    * `help` can post command help.

    Upsun Dispatch classifies GitLab commands against the connection-specific bot username. Bot notes, system notes, self-triggered notes, and unrelated notes are ignored.

    Assigning or re-requesting the GitLab service account as reviewer on a merge request also requests a review.

    #### Progress and results

    While the review runs, Upsun Dispatch publishes GitLab progress indicators such as a merge request note and commit status. When the review completes, Upsun Dispatch updates or concludes those artifacts and publishes the review result to GitLab.

    Depending on the review result, GitLab may receive:

    * merge request notes,
    * inline findings,
    * body-only findings,
    * commit statuses, and
    * summary text when summaries are enabled.

    If a run fails or is canceled before the final review step completes, Upsun Dispatch attempts to conclude or recover the GitLab progress note and status.
  </Tab>
</Tabs>

## Review limits

Automatic Code review runs are capped at 10 completed automatic reviews per pull request or merge request. When that cap is reached, Upsun Dispatch posts a notice on the pull request or merge request. Manual review requests bypass this cap, including `review` and `full review` commands.

Reopening a pull request or merge request resets the automatic review cap for that item.

## How Code review decides what to review

Before the LLM review begins, Upsun Dispatch assesses the current pull request or merge request. It reads the latest GitHub or GitLab data, checks prior Upsun Dispatch review markers and unresolved threads, and decides whether to:

* skip the review,
* perform a full review, or
* perform an incremental review.

If the `assess-changes` step determines there is nothing new to review, Upsun Dispatch ends the run as `skipped` instead of starting the LLM review step.

Upsun Dispatch passes the assessment to the sandboxed review step together with review settings such as the selected model, effort level, token limit, and summary mode.

## Summary behavior

Code review can publish summary text as part of the GitHub or GitLab result. The exact summary behavior depends on workflow settings and the integration receiving the review.

When summary mode is set to `auto`, the review agent can mark a summary as optional if the pull request or merge request description already summarizes the change. In that case:

* GitHub publishes the optional summary only when an existing Upsun Dispatch summary comment needs updating.
* GitLab can omit an optional summary from a new note.

When summary mode is `off`, Upsun Dispatch stops rendering and publishing new summary text. It does not delete older summary comments or notes that were already posted.

Manage summary mode and repository overrides in [Workflows in Upsun Dispatch](/dispatch/docs/workflows#workflow-settings).
