The code review agent is a separate AI agent that Optio launches as a subtask once the coding agent has opened a pull request. It reads the PR diff, the original task description, and any test output, then posts structured review feedback — catching issues before a human reviewer ever looks at the code. The review agent runs in the same repository pod as the coding agent, scoped to the PR branch. While the coding task waits, the review subtask blocks the parent from advancing until the review is complete.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/jonwiggins/optio/llms.txt
Use this file to discover all available pages before exploring further.
Review flow
Coding agent opens a PR
The coding agent finishes its work and opens a pull request. The task transitions to
pr_opened.Review trigger fires
Depending on the repository’s review trigger setting, the review agent launches either immediately on PR open (
on_pr) or after all CI checks pass (on_ci_pass).Review subtask is created
A review subtask is created under the parent coding task, visible in the task detail view. It is marked as blocks parent — the coding task waits for it to complete.
Review agent runs
The review agent reads the rendered review prompt (which includes the PR number, task context, repo name, and test command) and examines the PR. It posts review comments on the pull request.
Outcome determines next step
- If the reviewer approves the PR (or requests no changes), the review subtask completes and the parent task continues toward auto-merge.
- If the reviewer requests changes, the task transitions to
needs_attention. If auto-resume on review is enabled, the coding agent is re-queued with the review comments as its prompt and pushes a fix.
Trigger modes
Two trigger modes control when the review agent starts:| Mode | When it runs | Best for |
|---|---|---|
on_ci_pass | After all CI checks pass | Recommended. No point reviewing code that already has failing tests. |
on_pr | Immediately when the PR is opened | Useful if CI is slow and you want early review feedback in parallel. |
Review model
The review agent can use a different model than the coding agent, configured separately in Repositories → [repo] → Settings → Review model. This lets you use a lighter, less expensive model for reviews while reserving a more capable model for coding.Review prompt template
The review agent receives a prompt built from a configurable template. The following variables are available:| Variable | Value |
|---|---|
{{PR_NUMBER}} | The pull request number (e.g., 42) |
{{TASK_FILE}} | Path to the review context file inside the worktree |
{{REPO_NAME}} | The repository name (e.g., your-org/your-repo) |
{{TASK_TITLE}} | The title of the original coding task |
{{TEST_COMMAND}} | The test command configured for the repository |
Triggering a review manually
If a task is inpr_opened state and no review has run yet (or you want to run another review after changes), you can trigger one manually:
- Open the task detail page.
- Click the Review button in the task actions panel.
- A new review subtask is created and queued immediately.
Enabling code review
Code review is disabled by default. Enable it per repository:- Navigate to Repositories and open the repository.
- Go to the Settings tab.
- Toggle Enable code review on.
- Choose a Review trigger (
on_ci_passis recommended). - Optionally select a Review model and customize the Review prompt template.
- Save settings.
Enabling code review for a repository affects all future tasks. Existing tasks that are already in
pr_opened state will not retroactively receive a review unless you trigger one manually.