Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ Reviewers run **in the order listed**, and whatever you list is exactly what run

**Per-reviewer iteration caps** (`~max=<n>` suffix): caps how many **review → fix → re-review cycles** that one reviewer runs. It is the per-entry form of `--review-iterations`, and unlike that flag it reaches every reviewer type — including `codex`/`agy`/`claude`/`grok`/`cursor` and `ollama`, whose caps are otherwise fixed at 3 — so a single run can budget each reviewer separately: `--review-with claude~max=2,ollama~max=1,codex~max=3`. `<n>` is a non-negative integer; `0` means "loop until clean", bounded by a 10-iteration safety guardrail. A reviewer that stops because it spent a cap *you* set reports `capped`, which counts as clean for the merge gate — as opposed to `guardrail`, which is what a *built-in* cap reports when it cuts off a reviewer that was still finding real problems, and which blocks the merge.

**Per-reviewer reasoning effort** (`~effort=<level>` suffix): specifies the reasoning effort level (`low`, `medium`, `high`, `xhigh`, `max`) for that reviewer: `--review-with codex[gpt-5.6-luna]~effort=max~opt`, `--review-with claude~effort=high~max=2`, `--review-with cursor[gpt-5]~effort=max`. For Cursor the suffix is folded into `--model` as `[effort=<level>]` (the CLI has no `--effort` flag); pair it with a `cursor[<model>]` bracket or a saved `--review-models cursor=…` default so there is a model to attach the variant to.
**Per-reviewer reasoning effort** (`~effort=<level>` suffix): specifies the reasoning effort level (`low`, `medium`, `high`, `xhigh`, `max`) for that reviewer: `--review-with codex[gpt-5.6-luna]~effort=max~opt`, `--review-with claude~effort=high~max=2`, `--review-with cursor[gpt-5]~effort=max`. Each reviewer receives it in the form its own CLI accepts — `--effort` is **not** universal. `claude` and `grok` take the flag; **codex** takes `-c model_reasoning_effort=<level>`; **Cursor** folds it into `--model` as `[effort=<level>]`, so pair that one with a `cursor[<model>]` bracket or a saved `--review-models cursor=…` default; and **agy** picks the matching model variant from whatever `agy models` lists. Where a reviewer offers no such control — or no level matching what you asked — the effort falls back to prompt guidance rather than failing the review.

`~max` applies in `series` mode (the default). In `--review-mode parallel` each reviewer runs a single review-only pass and the orchestrator applies the union once, so there are no per-reviewer cycles to cap — `~max` is ignored there with a warning.

Expand Down
4 changes: 2 additions & 2 deletions commands/do/rpr.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Parse `$ARGUMENTS` for `--issues` / `--no-issues` / `--issues-label <name>`: whe
Note whether **any** completed review exists (from a copilot bot, a human, or another bot) — call this `HAS_EXISTING_REVIEW` — and specifically whether a **completed** `copilot-pull-request-reviewer` review exists (a node in `reviews.nodes`, NOT merely a pending review request) — call this `HAS_COPILOT_REVIEW`. Track a Copilot review that is only **pending** (Copilot present in `reviewRequests.nodes[].requestedReviewer` with no completed Copilot review yet) separately as `COPILOT_REVIEW_PENDING` — a pending-only review must NOT set `HAS_COPILOT_REVIEW`, or the "completed review exists" branch below would fire and resolve threads before Copilot has posted anything. Then dispatch on `REVIEW_AGENTS`:

- **If `REVIEW_AGENTS` is empty** (no `--review-with`, no saved default, or an explicit `none`): request **no** review — not Copilot, not anything else. Proceed straight to step 3 and resolve whatever unresolved threads the PR already carries.
- **If `REVIEW_AGENTS` contains a local CLI (`codex`/`agy`/`claude`/`grok`/`cursor`):** run the **local-agent review loop** (`lib/local-agent-review-loop.md`, referenced below) for each such agent against the PR branch, forwarding `REVIEWER_APPLIES`, that entry's resolved `{REVIEW_MODEL}` (bracket, else saved `review-models[slug]` default, else empty → built-in default — see the loop reference below), that entry's `{REVIEW_EFFORT}` (from its `~effort=<level>`; empty when it carried none — Cursor folds this into `--model`, the other CLIs take it as `--effort`), and that entry's `{MAX_ITERATIONS}` / `{MAX_EXPLICIT}` (from its `~max=<n>`; the built-in `3` / `false` when it carried none). This produces findings (and, in reviewer-applies mode, fixes) locally — it does **not** request a Copilot cloud review for those slugs. Then proceed to step 3 to fetch and resolve any pre-existing unresolved threads as well. (If `REVIEW_AGENTS` also contains `copilot`, additionally run the Copilot path below.)
- **If `REVIEW_AGENTS` contains a local CLI (`codex`/`agy`/`claude`/`grok`/`cursor`):** run the **local-agent review loop** (`lib/local-agent-review-loop.md`, referenced below) for each such agent against the PR branch, forwarding `REVIEWER_APPLIES`, that entry's resolved `{REVIEW_MODEL}` (bracket, else saved `review-models[slug]` default, else empty → built-in default — see the loop reference below), that entry's `{REVIEW_EFFORT}` (from its `~effort=<level>`; empty when it carried none — the loop maps it to each CLI's accepted carrier), and that entry's `{MAX_ITERATIONS}` / `{MAX_EXPLICIT}` (from its `~max=<n>`; the built-in `3` / `false` when it carried none). This produces findings (and, in reviewer-applies mode, fixes) locally — it does **not** request a Copilot cloud review for those slugs. Then proceed to step 3 to fetch and resolve any pre-existing unresolved threads as well. (If `REVIEW_AGENTS` also contains `copilot`, additionally run the Copilot path below.)
- **If `REVIEW_AGENTS` contains `ollama`:** run the **Ollama review loop** (`lib/ollama-review-loop.md`, referenced below) for each `ollama` entry against the PR branch (which must be checked out locally — the loop reviews a local `git diff`), forwarding that entry's `{OLLAMA_MODEL}` (empty = auto-select), its `{OLLAMA_EFFORT}` (from its `~effort=<level>`; empty when it carried none), and its `{MAX_ITERATIONS}` / `{MAX_EXPLICIT}` (from its `~max=<n>`; the built-in `3` / `false` when it carried none). Like the local-CLI path it produces findings the orchestrator applies locally (Ollama is always review-only) and does **not** request a Copilot review. Then proceed to step 3 to resolve any pre-existing threads. (If `REVIEW_AGENTS` also contains `copilot`, additionally run the Copilot path below.)
- **If `REVIEW_AGENTS` contains `copilot`** (only ever because you asked for it — typed or saved): a `copilot~max=<n>` cap applies to this path too — see the cap-accounting rule in step 8. rpr accepts no `--review-iterations`, so `~max` is the only budget signal here, and each Copilot round below counts against it.
- **A completed Copilot review exists** (`HAS_COPILOT_REVIEW`): skip requesting a new one — proceed to step 3 to address its threads.
Expand Down Expand Up @@ -128,7 +128,7 @@ Parse `$ARGUMENTS` for `--issues` / `--no-issues` / `--issues-label <name>`: whe

## Local-Agent Review Loop (for `--review-with codex|agy|claude|grok|cursor`)

When `REVIEW_AGENTS` names a local CLI, step 2 (and the step-8 re-request) runs that agent's review against the PR branch via the shared local-agent loop. Pass `{REVIEW_AGENT}`, `{REVIEWER_APPLIES}`, that entry's resolved `{REVIEW_MODEL}` (the `<agent>[<model>]` bracket if the token carried one, else the saved `review-models[slug]` default resolved above — project over global, else empty → the reviewer's built-in default), that entry's `{REVIEW_EFFORT}` (from its `~effort=<level>`; empty when unset — without it Cursor cannot fold effort into `--model` and the other CLIs cannot pass `--effort`), the PR branch (`headRefName`), the base branch (`baseRefName`), and the project `{BUILD_CMD}`. Forwarding `{REVIEW_MODEL}` is what makes `--review-with=codex[o3]` and a saved `review-models` default actually pin the model on rpr's local passes — without it those passes would silently run the CLI's default model. The loop verifies build + tests in the main thread before pushing; afterward, continue to step 3 to resolve any pre-existing threads.
When `REVIEW_AGENTS` names a local CLI, step 2 (and the step-8 re-request) runs that agent's review against the PR branch via the shared local-agent loop. Pass `{REVIEW_AGENT}`, `{REVIEWER_APPLIES}`, that entry's resolved `{REVIEW_MODEL}` (the `<agent>[<model>]` bracket if the token carried one, else the saved `review-models[slug]` default resolved above — project over global, else empty → the reviewer's built-in default), that entry's `{REVIEW_EFFORT}` (from its `~effort=<level>`; empty when unset — the loop's effort-carrier table maps it to each CLI's accepted form), the PR branch (`headRefName`), the base branch (`baseRefName`), and the project `{BUILD_CMD}`. Forwarding `{REVIEW_MODEL}` is what makes `--review-with=codex[o3]` and a saved `review-models` default actually pin the model on rpr's local passes — without it those passes would silently run the CLI's default model. The loop verifies build + tests in the main thread before pushing; afterward, continue to step 3 to resolve any pre-existing threads.

!`cat ~/.claude/lib/local-agent-review-loop.md`

Expand Down
Loading