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

# Review a coding agent PR with GitHub and CodeRabbit

> Run a coding agent, review its PR with GitHub and CodeRabbit, and read one decision packet for the final commit.

**Use this recipe when:** your coding agent should open a PR and you want its GitHub checks and CodeRabbit review recorded against one final commit in a Millwork receipt.

**You are done when:** the packet names the PR, exact final SHA and the outcome of **both** sources. For the next task, keep the connected repository and agent, refresh the base SHA, and use a new request key.

<div className="cookbook-action-card">
  <Card title="Set up the first job" icon="git-pull-request" href="/guides/review-composer" arrow="true">
    Connect GitHub and your coding agent, set CodeRabbit's approval workflow, then submit and inspect one run.
  </Card>
</div>

## The review question

<div className="cookbook-review-question">
  > Did CodeRabbit approve the agent's final PR commit with its threads resolved, and did the named GitHub Actions job pass on that same commit?
</div>

This recipe uses `sources: [coderabbit, github]` and `combine: all`. Its CodeRabbit fact is a GitHub Bot review, **not** a reading of CodeRabbit prose or CLI JSONL. A missing approval, skipped review or unavailable source yields `no_verdict`. A failed required GitHub job blocks. The packet shows each source even when the aggregate is decided.

<div className="cookbook-reader-tabs">
  <Tabs>
    <Tab title="First job">
      1. [Connect the repository and register an async agent](/guides/review-composer#connect-the-repository). Connect as a person with repository write access; Millwork opens the PR in that person's name. The maintained adapter runs your chosen coding agent and pushes only the Millwork run branch.
      2. Add `reviews.request_changes_workflow: true` to `.coderabbit.yaml` as shown in the [setup step](/guides/review-composer#prepare-coderabbit-and-your-agent).
      3. Choose one required workflow ID and job name, read the current full base SHA, and [submit the sample request](/guides/review-composer#start-one-run).
      4. Inspect `decision_packet.artifact.final_sha`, both `sources` and `verdict` in the execution and receipt.
    </Tab>

    <Tab title="Next job">
      Keep the verified repository connection, registered agent, source list and combine rule. Refresh `base_sha`, write a new task objective, review its budget and charges, and send a **new** request key in `Idempotency-Key`. Millwork creates a new branch, opens a new PR, and binds review evidence to its new final SHA. The earlier decision packet remains the record for the earlier commit.
    </Tab>

    <Tab title="Adapt the rule">
      For two GitHub jobs, add another `{ "workflow_id": ..., "job_name": ... }` selector. If CodeRabbit is advisory for a team, change `combine` deliberately and inspect both source results; use `veto_sources` when a source's block must always stop the job. A source outage must never be interpreted as an approval. Each run freezes its selected checks, source rules and combine policy at acceptance.
    </Tab>
  </Tabs>
</div>

## Without CodeRabbit

Use the same run and receipt for a GitHub-only review. Install the Millwork GitHub App, connect your account, and register the coding agent as in the [setup guide](/guides/review-composer#connect-the-repository). You do not need a CodeRabbit setting or seat.

Replace the sample request's `review_composer` policy with one GitHub source:

```json theme={null}
{
  "version": "v1",
  "repository": "team/repo",
  "base_ref": "refs/heads/main",
  "base_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "agent_arm_id": "<ready-agent-arm-id>",
  "sources": [
    { "id": "github", "checks": [{ "workflow_id": 123456, "job_name": "test" }], "minimum_approvals": 0 }
  ],
  "combine": "all",
  "veto_sources": []
}
```

Choose your required workflow and job. This example requires the named check and no human approval. If you set `minimum_approvals: 1` or more, arrange for a reviewer **other than the connected person**: Millwork opens the PR in that connected person's name, and their own approval cannot satisfy GitHub's review rule. The decision packet lists the GitHub source and exact final SHA; the run and receipt flow are the same. A missing required approval or incomplete check is not a pass.

<Note>
  This recipe uses the team's existing GitHub Actions and, when selected, CodeRabbit installation. For private repositories using CodeRabbit, the connected person needs a CodeRabbit seat. A run branch and PR may consume CI and, when selected, CodeRabbit quota. The Review Composer fee defaults to **\$0.10 per accepted run**; your budget must cover it. Check `billing.review_composer_fee_usd_per_execution` in `GET /v1/account` for your configured fee. Millwork charges it **on top of** the coding-agent provider bill and any GitHub or CodeRabbit plan charges. Its receipt records the run and Millwork charge; a zero agent usage report is not a zero provider bill.
</Note>

Need a check for an already completed CodeRabbit **CLI** review instead? [Recipe E](/cookbook/output-checks/coderabbit-review) follows that separate customer-run path.
