feat(pr-review): enable sub-agent delegation for file-level reviews#2839
Conversation
Point pr-review workflow at the extensions feature branch (feat/pr-review-sub-agent-delegation) and enable use-sub-agents: true. This enables the experimental sub-agent delegation mode where the main review agent acts as a coordinator, delegating per-file reviews to file_reviewer sub-agents via the TaskToolSet, then consolidating findings into a single PR review. Companion to OpenHands/extensions#164. Co-authored-by: openhands <openhands@all-hands.dev>
Python API breakage checks — ✅ PASSEDResult: ✅ PASSED |
REST API breakage checks (OpenAPI) — ✅ PASSEDResult: ✅ PASSED |
all-hands-bot
left a comment
There was a problem hiding this comment.
🟡 Acceptable - Reasonable experimental approach with proper documentation.
This workflow change enables sub-agent delegation for PR reviews by pinning to the feature branch. The approach is sound, but requires tracking to ensure the feature branch pin is reverted after the companion PR merges.
all-hands-bot
left a comment
There was a problem hiding this comment.
✅ QA Report: PASS
Workflow configuration successfully enables experimental sub-agent delegation with valid syntax and correct parameter passing.
Does this PR achieve its stated goal?
Yes. The PR achieves its goal of enabling experimental sub-agent delegation for file-level PR reviews. The changes correctly:
- Point the workflow to the extensions feature branch (
feat/pr-review-sub-agent-delegation) where sub-agent delegation is implemented - Enable the
use-sub-agents: 'true'parameter that activates the experimental mode - The workflow runs successfully and correctly passes the parameter to the action
| Phase | Result |
|---|---|
| Environment Setup | ✅ Repository checked out, dependencies verified |
| CI & Tests | |
| Functional Verification | ✅ Workflow syntax valid, feature branch exists, parameter accepted, workflow runs successfully |
Functional Verification
Test 1: Workflow YAML Syntax Validation
Verified the workflow file syntax:
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/pr-review-by-openhands.yml'))" && echo "✅ YAML syntax is valid"Output:
✅ YAML syntax is valid
This confirms the workflow YAML is syntactically correct.
Test 2: Feature Branch Exists in Extensions Repo
Verified the target branch exists:
gh api repos/OpenHands/extensions/branches/feat/pr-review-sub-agent-delegation --jq '.name'Output:
feat/pr-review-sub-agent-delegation
This confirms the feature branch exists and can be referenced by the workflow.
Test 3: Action Parameter Validation
Fetched action.yml from the feature branch:
gh api repos/OpenHands/extensions/contents/plugins/pr-review/action.yml?ref=feat/pr-review-sub-agent-delegation --jq '.content' | base64 -d | head -80Relevant excerpt:
use-sub-agents:
description: "When true, enable sub-agent delegation for file-level reviews. The main agent acts as a coordinator that delegates per-file review work to file_reviewer sub-agents via the TaskToolSet, then consolidates findings into a single PR review. Experimental."
required: false
default: 'false'This confirms:
- The
use-sub-agentsparameter exists in the action definition - It has the correct description matching the PR's stated goal
- Default is 'false', so it must be explicitly enabled (which this PR does)
Test 4: Workflow Execution with New Configuration
Verified the workflow ran with the new configuration:
gh api repos/OpenHands/software-agent-sdk/actions/runs/24480056764Key observations from workflow logs:
pr-review Run PR Review 2026-04-15T21:46:30.2888109Z Download action repository 'OpenHands/extensions@feat/pr-review-sub-agent-delegation' (SHA:0ef1afca0e699d043bab8e72b769fb1ca5993cc0)
pr-review Run PR Review 2026-04-15T21:46:32.3652071Z use-sub-agents: true
Workflow status:
{
"conclusion": "success",
"status": "completed"
}This confirms:
- The workflow correctly downloaded the feature branch
- The
use-sub-agents: trueparameter was passed to the action - The workflow completed successfully
Test 5: Diff Verification
Verified the changes match PR description:
git diff main pr-2839 -- .github/workflows/pr-review-by-openhands.ymlChanges:
- Line 43:
@main→@feat/pr-review-sub-agent-delegation✅ - Lines 49-50: Added
use-sub-agents: 'true'with comment ✅
Both changes match exactly what the PR description promises.
Issues Found
None. The configuration changes are correct and the workflow operates as expected. The CI failures are unrelated (they concern security_policy_filename API changes in a different part of the codebase).
Note: The PR description correctly mentions this is a companion to OpenHands/extensions#164 and that the workflow should be updated to point back to @main once that PR is merged. This temporary branch pinning is intentional and documented.
Co-authored-by: OpenHands Bot <contact@all-hands.dev>
all-hands-bot
left a comment
There was a problem hiding this comment.
🟡 Acceptable - Reasonable experimental approach, but requires human review due to agent behavior changes.
|
[RISK ASSESSMENT] Rationale:
Recommendation: Per repo guidelines, PRs that change agent behavior should not be auto-approved. A human maintainer should review and consider:
The workflow configuration itself is correct and properly documented with the TODO for reverting to @main. |
all-hands-bot
left a comment
There was a problem hiding this comment.
✅ QA Report: PASS WITH ISSUES
Workflow configuration correctly enables sub-agent delegation; feature branch exists and parameter is valid; temporary branch pin requires follow-up.
Does this PR achieve its stated goal?
Yes. This PR successfully enables experimental sub-agent delegation for PR reviews by (1) pointing the workflow to the feat/pr-review-sub-agent-delegation branch in OpenHands/extensions where the sub-agent feature is implemented, and (2) passing use-sub-agents: 'true' to activate it. The companion PR (OpenHands/extensions#164) exists and implements the corresponding functionality. All verification checks pass: YAML syntax is valid, the referenced branch exists (SHA: 0ef1afca), the use-sub-agents parameter is accepted by the action, and no unintended changes were introduced.
| Phase | Result |
|---|---|
| Environment Setup | ✅ Repo checked out, workflow file accessible |
| CI & Tests | |
| Functional Verification | ✅ YAML valid, branch exists, parameter accepted, diff matches description |
Functional Verification
Test 1: YAML Syntax Validation
Step 1 — Establish baseline:
The workflow file is a GitHub Actions YAML that must parse correctly. Ran:
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/pr-review-by-openhands.yml'))"Result: ✓ YAML syntax is valid
This confirms the workflow file is syntactically correct and will be accepted by GitHub Actions.
Test 2: Extensions Branch Existence
Step 1 — Verify referenced branch exists:
The workflow now references OpenHands/extensions/plugins/pr-review@feat/pr-review-sub-agent-delegation. Ran:
gh api repos/OpenHands/extensions/git/refs/heads/feat/pr-review-sub-agent-delegationResult:
{
"ref": "refs/heads/feat/pr-review-sub-agent-delegation",
"sha": "0ef1afca0e699d043bab8e72b769fb1ca5993cc0"
}This confirms the feature branch exists and is accessible. The workflow will successfully resolve the action reference when it runs.
Test 3: Parameter Validation
Step 1 — Verify use-sub-agents parameter exists in target action:
Fetched the action definition from the feature branch:
curl -s https://raw.githubusercontent.com/OpenHands/extensions/feat/pr-review-sub-agent-delegation/plugins/pr-review/action.ymlResult: Found input definition:
use-sub-agents:
description: "When true, enable sub-agent delegation for file-level reviews..."
required: false
default: 'false'This confirms:
- The parameter exists in the action
- Its description matches the PR's stated purpose ("enable sub-agent delegation for file-level reviews")
- Default is
'false', so the workflow'suse-sub-agents: 'true'will activate the experimental feature
Test 4: Change Precision
Step 1 — Verify diff contains only intended changes:
Ran:
git diff main .github/workflows/pr-review-by-openhands.ymlResult:
- Line 43-44: Added TODO comment and changed
@main→@feat/pr-review-sub-agent-delegation - Line 50-51: Added comment and
use-sub-agents: 'true'parameter - No other files changed (
git diff main --name-onlyreturned only the workflow file)
This confirms the changes are minimal, precise, and match the PR description exactly. No unintended modifications were introduced.
Test 5: Companion PR Verification
Step 1 — Verify companion PR exists:
Ran:
gh pr view 164 --repo OpenHands/extensionsResult: PR exists, state=OPEN, title="feat(pr-review): add sub-agent delegation for file-level reviews"
The companion PR's description states it "Add[s] experimental sub-agent delegation support to the pr-review plugin via use-sub-agents action input", which aligns with this PR's stated goal.
Issues Found
- 🟡 Minor: Workflow temporarily pins to feature branch
@feat/pr-review-sub-agent-delegation— must be reverted to@mainafter OpenHands/extensions#164 merges (TODO comment exists at line 43) - 🟢 Acceptable: CI checks "Python API" and "REST API (OpenAPI)" failed due to unrelated Field description changes in SDK code (not caused by this workflow-only PR)
| - name: Run PR Review | ||
| uses: OpenHands/extensions/plugins/pr-review@main | ||
| # TODO: Revert to @main after OpenHands/extensions#164 is merged | ||
| uses: OpenHands/extensions/plugins/pr-review@feat/pr-review-sub-agent-delegation |
There was a problem hiding this comment.
🟡 Suggestion: After OpenHands/extensions#164 merges, remember to update this line back to @main and remove the use-sub-agents parameter (or keep it if you want the feature enabled permanently).
Consider adding a GitHub issue or tracking task to ensure this follow-up happens.
Why
This is the companion PR to OpenHands/extensions#164, which adds experimental sub-agent delegation support to the pr-review plugin.
Per-PR code reviews can get too large for a single agent to handle well. By delegating file-level reviews to sub-agents, we can:
DelegateTool/TaskToolSetfor parallel file-level analysisSummary
pr-review-by-openhands.ymlto point at the extensions feature branch (feat/pr-review-sub-agent-delegation) instead ofmainuse-sub-agents: 'true'to activate the experimental sub-agent delegation modefile_reviewersub-agents viaTaskToolSet, delegates per-file review work, and consolidates findings into a single PR reviewHow to Test
Once both PRs are merged, the sub-agent review mode will be active on this repo's PR reviews. In the meantime, testing requires:
OpenHands/extensions@feat/pr-review-sub-agent-delegation@mainonce OpenHands/extensions#164 is mergeduse-sub-agents: 'false'This PR was created by an AI assistant (OpenHands) on behalf of a user.
@xingyaoww can click here to continue refining the PR
Agent Server images for this PR
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.13-nodejs22-slimgolang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:85ddc2b-pythonRun
All tags pushed for this build
About Multi-Architecture Support
85ddc2b-python) is a multi-arch manifest supporting both amd64 and arm6485ddc2b-python-amd64) are also available if needed