Documentation Index
Fetch the complete documentation index at: https://allhandsai-sync-llms-files-1780288392.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
View Example Plugin
Check out the complete PR review plugin with ready-to-use code and configuration.
Overview
The OpenHands PR Review workflow is a GitHub Actions workflow that:- Triggers automatically when PRs are opened or when you request a review
- Analyzes code changes in the context of your entire repository
- Posts inline comments directly on specific lines of code in the PR
- Provides fast feedback - typically within 2-3 minutes
How It Works
The PR review workflow uses the OpenHands Software Agent SDK to analyze your code changes:-
Trigger: The workflow runs when:
- A new non-draft PR is opened
- A draft PR is marked as ready for review
- The
review-thislabel is added to a PR openhands-agentis requested as a reviewer
-
Analysis: The agent receives the complete PR diff and uses two skills:
/codereview: Analyzes code for quality, security, data structures, and best practices with a focus on simplicity and pragmatism/github-pr-review: Posts structured inline comments via the GitHub API
-
Output: Review comments are posted directly on the PR with:
- Priority labels (🔴 Critical, 🟠 Important, 🟡 Suggestion, 🟢 Nit)
- Specific line references
- Actionable suggestions with code examples
Quick Start
Add your LLM API key
Go to your repository’s Settings → Secrets and variables → Actions and add:
LLM_API_KEY: Your LLM API key (get one from OpenHands LLM Provider)
Create the review label
Create a
review-this label in your repository:- Go to Issues → Labels
- Click New label
- Name:
review-this - Description:
Trigger OpenHands PR review
In a Conversation
You can also trigger a code review manually in any OpenHands conversation. First, install the skill:Composite Action
Action Path Updated: The PR review action has moved to the extensions repository. If your workflow still references the old path, update it:
- Old:
OpenHands/software-agent-sdk/.github/actions/pr-review@main - New:
OpenHands/extensions/plugins/pr-review@main
- Checking out the extensions repository at the specified version
- Setting up Python and dependencies
- Running the PR review agent (from extensions repo)
- Uploading logs as artifacts
Action Inputs
| Input | Description | Required | Default |
|---|---|---|---|
agent-kind | Review backend: openhands for the standard SDK agent or acp for an ACP-compatible agent server | No | openhands |
llm-model | LLM model(s). Comma-separated to run multiple reviews and compare results (A/B testing). In ACP mode this is passed to the ACP server when supported. | No | anthropic/claude-sonnet-4-5-20250929 |
acp-command | Command used to start the ACP server. Required when agent-kind is acp. Examples: npx -y @zed-industries/codex-acp@0.12.0, codex-acp, claude-agent-acp, npx -y @agentclientprotocol/claude-agent-acp | Yes for ACP mode | '' |
acp-prompt-timeout | Timeout in seconds for one ACP prompt turn | No | 1800 |
llm-base-url | LLM base URL (for custom endpoints) | No | '' |
review-style | [DEPRECATED] Previously chose between standard and roasted. Now ignored — the styles have been merged. | No | roasted |
require-evidence | Require the reviewer to enforce an Evidence section in the PR description with end-to-end proof | No | 'false' |
use-sub-agents | Enable sub-agent delegation for file-level reviews in openhands mode. Ignored in ACP mode. | No | 'false' |
extensions-repo | Extensions repository (owner/repo) | No | OpenHands/extensions |
extensions-version | Git ref for extensions (tag, branch, or commit SHA) | No | main |
openhands-sdk-package | Package spec passed to uv --with; override only when pinning a specific SDK build for testing or rollout control | No | openhands-sdk |
llm-api-key | LLM API key. Required when agent-kind is openhands; ignored in ACP mode. | Yes for OpenHands mode | - |
github-token | GitHub token for API access | Yes | - |
lmnr-api-key | Laminar API key for observability | No | '' |
enable-uv-cache | Enable setup-uv’s GitHub Actions cache for Python deps. Default false for security. | No | 'false' |
Use
extensions-version to pin to a specific version tag (e.g., v1.0.0) for production stability, or use main to always get the latest features. The extensions repository contains the PR review plugin scripts.Experimental: ACP Review Backend
The PR review action can run through an ACP-compatible agent server by settingagent-kind: acp. In this mode, OpenHands still loads the review skills
and plugin prompt context, but the ACP server owns model access,
authentication, and tool execution.
Use ACP mode when your runner already has an authenticated ACP CLI available.
The action does not install ACP CLIs for you; install and authenticate the ACP
server in workflow steps before invoking the PR review action.
Codex ACP Example
To use Codex ACP, first install the Codex CLI and complete device-code login on a trusted machine:CODEX_AUTH_JSON_B64. The workflow can then restore that file on a
self-hosted runner, start Codex ACP with npx, and run the review:
Customization
Repository-Specific Review Guidelines
Add repo-specific review rules by creating a skill file at.agents/skills/custom-codereview-guide.md:
The skill file must use
/codereview as the trigger so it activates alongside the default review behavior. See the software-agent-sdk’s own custom-codereview-guide for a complete example.Workflow Configuration
Customize the workflow by modifying the action inputs:Trigger Customization
Modify when reviews are triggered by editing the workflow conditions:Security Considerations
The workflow usespull_request_target so the code review agent can work properly for PRs from forks. Only users with write access can trigger reviews via labels or reviewer requests.
Example Reviews
See real automated reviews in action on the OpenHands Software Agent SDK repository:| PR | Description | Review Highlights |
|---|---|---|
| #1927 | Composite GitHub Action refactor | Comprehensive review with 🔴 Critical, 🟠 Important, and 🟡 Suggestion labels |
| #1916 | Add example for reconstructing messages | Critical issues flagged with clear explanations |
| #1904 | Update code-review skill guidelines | APPROVED review highlighting key strengths |
| #1889 | Fix tmux race condition | Technical review of concurrency fix with dual-lock strategy analysis |
Troubleshooting
Review not triggering
Review not triggering
- Ensure the
LLM_API_KEYsecret is set correctly - Check that the label name matches exactly (
review-this) - Verify the workflow file is in
.github/workflows/ - Check the Actions tab for workflow run errors
Review comments not appearing
Review comments not appearing
- Ensure
GITHUB_TOKENhaspull-requests: writepermission - Check the workflow logs for API errors
- Verify the PR is not from a fork with restricted permissions
Review taking too long
Review taking too long
- Large PRs may take longer to analyze
- Consider splitting large PRs into smaller ones
- Check if the LLM API is experiencing delays
Automate This
There are two ways to automate PR reviews with OpenHands: as a GitHub Action (per-repo) or as an OpenHands Automation (org-wide, event-driven). Choose the approach that fits your needs, or use both.Option A: GitHub Action (Per-Repo)
Use the pr-review plugin as a GitHub Actions workflow. Copy the example workflow into.github/workflows/pr-review.yml in your repository, add your LLM_API_KEY to Settings → Secrets and variables → Actions, and customize the trigger conditions and model as needed.
See the action.yml for all available inputs (llm-model, llm-base-url, use-sub-agents, require-evidence, and more).
When to use this: You want per-repo control, need to integrate with existing CI checks, or want to pin specific action versions per repository.
Option B: OpenHands Automation (Org-Wide)
OpenHands Automations is an event-triggered automation system that replaces per-repo GitHub Actions workflows. You define the trigger once and it covers all repositories matching your filter — no per-repo workflow files needed. It also leverages the full OpenHands runtime (browser, tools, sandbox), which GitHub Actions cannot. When to use this: You want a single configuration that covers all repos in your org, or you need the full OpenHands runtime for more advanced review workflows.Prerequisites: Bot Account
For org-level automations, you should create a dedicated bot account (a separate GitHub user) and add it to your OpenHands organization. The bot account is the identity that will approve pull requests, request changes, and post review comments — keeping automated actions separate from human activity. Team members can then request this bot as a reviewer to trigger on-demand reviews.Setup: Create the Automation via Prompt
Log in to OpenHands Cloud as your bot account (or under your team org) and send the following prompt in a new conversation. Replace the placeholders with your values:YOUR_ORG— your GitHub organization name (e.g.,mycompany)YOUR_BOT_LOGIN— the GitHub username of your bot account (e.g.,mycompany-bot)
Team review requests: The
requested_reviewer field is only populated for individual reviewer requests. When a team is requested as reviewer, GitHub uses requested_team instead. To also match team requests, add || requested_team.slug == 'YOUR_TEAM_SLUG' to the filter.How !label works: JMESPath treats absent fields as null, and !null evaluates to true. This means the third branch fires for opened and ready_for_review events (which have no label or requested_reviewer in the payload), while correctly staying silent for labeled and review_requested events where those fields are set.What This Produces
When the automation is created and a qualifying PR event occurs, the bot will:- Post a progress comment on the PR: ”🔍 Review in progress…” with a link to the live conversation
- Run the pr-review plugin which analyzes the diff and posts a structured code review with inline comments — approving clean PRs, requesting changes when there are blocking issues, or leaving an informational comment when the verdict is unclear
- Update the progress comment to ”✅ Review complete.” with the conversation link
opened— when a new non-draft PR is created (for established contributors only)ready_for_review— when a draft PR is marked ready (for established contributors only)review_requested— when your bot account is requested as a reviewer. This is the primary way team members trigger an on-demand review — they simply request the bot from the PR’s “Reviewers” sidebar. The bot then posts its review under its own GitHub identity, so approvals and change requests come from a clear, dedicated account.labeled— when thereview-thislabel is added to any PR
pull_request.synchronize is intentionally excluded to avoid noisy re-reviews). To request a follow-up review after addressing feedback, re-add the review-this label or re-request the reviewer.
The
$AUTOMATION_SESSION_URL variable is injected by the automation runtime and resolves to a direct link to the conversation (e.g., https://app.all-hands.dev/conversations/{uuid}). The prompt includes fallbacks ($AUTOMATION_API_URL, then the default app URL) for environments where the variable is not yet available.The $AUTOMATION_EVENT_PAYLOAD variable contains the full GitHub webhook event as JSON. The $GITHUB_TOKEN (from the configured GitHub integration) is also automatically available. No additional configuration is needed for any of these variables.Single-Repo vs Org-Wide
The prompt above usesglob(repository.full_name, 'YOUR_ORG/*') to cover all repos in your org. To target a single repo instead, replace the filter’s first condition:
The
review-this label and requested_reviewer branches do not exclude draft PRs — labeling a draft or requesting the bot on a draft will still fire the automation. This is intentional: explicit review requests should be honored regardless of draft status.Testing
After creating the automation:- Add the
review-thislabel to any open PR in a covered repo — this is the most reliable test since it works regardless of author history (you may need to create the label in your repo first if it doesn’t exist) - Alternatively, request your bot as a reviewer on any PR, or open a new non-draft PR (note: the auto-trigger on
openedrequires the PR author to already have contributor history in that specific repo —FIRST_TIME_CONTRIBUTOR,FIRST_TIMER, andNONEassociations are excluded) - Watch for the ”🔍 Review in progress…” comment — it should appear within a few seconds
- The full review will typically follow within a few minutes, depending on PR size
Related Resources
- PR Review Plugin - Full workflow example and agent script
- Composite Action - Reusable GitHub Action for PR reviews
- Software Agent SDK - Build your own AI-powered workflows
- GitHub Integration - Set up GitHub integration for OpenHands Cloud
- Skills Documentation - Learn more about OpenHands skills

