Skip to content

fix(workflows): skip approved PRs in review reminders#3295

Merged
enyst merged 2 commits into
mainfrom
fix/assign-reviews-skip-approved
May 18, 2026
Merged

fix(workflows): skip approved PRs in review reminders#3295
enyst merged 2 commits into
mainfrom
fix/assign-reviews-skip-approved

Conversation

@enyst
Copy link
Copy Markdown
Member

@enyst enyst commented May 18, 2026

Summary

  • add a small note to the assign-reviews "Need Reviewer Action" prompt so it skips PRs that already have a human approval
  • keep bot/automation approvals ignored for that human-approval check
  • mirror the same wording in the example assign-reviews workflow

Why

PR #3237 already had a human approval, but the scheduled Assign Reviews workflow still posted a reviewer reminder because the prompt did not explicitly tell the agent to skip PRs that were already approved by a human reviewer.

Validation

  • uv run pre-commit run --files .github/workflows/assign-reviews.yml examples/03_github_workflows/01_basic_action/assign-reviews.yml

This PR was created by an AI agent (OpenHands) on behalf of the user.


Agent Server images for this PR

GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server

Variants & Base Images

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python amd64, arm64 nikolaik/python-nodejs:python3.13-nodejs22-slim Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:56905bd-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-56905bd-python \
  ghcr.io/openhands/agent-server:56905bd-python

All tags pushed for this build

ghcr.io/openhands/agent-server:56905bd-golang-amd64
ghcr.io/openhands/agent-server:56905bd9396811e41fe13eb4cd8fc164853b6fe8-golang-amd64
ghcr.io/openhands/agent-server:fix-assign-reviews-skip-approved-golang-amd64
ghcr.io/openhands/agent-server:56905bd-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:56905bd-golang-arm64
ghcr.io/openhands/agent-server:56905bd9396811e41fe13eb4cd8fc164853b6fe8-golang-arm64
ghcr.io/openhands/agent-server:fix-assign-reviews-skip-approved-golang-arm64
ghcr.io/openhands/agent-server:56905bd-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:56905bd-java-amd64
ghcr.io/openhands/agent-server:56905bd9396811e41fe13eb4cd8fc164853b6fe8-java-amd64
ghcr.io/openhands/agent-server:fix-assign-reviews-skip-approved-java-amd64
ghcr.io/openhands/agent-server:56905bd-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:56905bd-java-arm64
ghcr.io/openhands/agent-server:56905bd9396811e41fe13eb4cd8fc164853b6fe8-java-arm64
ghcr.io/openhands/agent-server:fix-assign-reviews-skip-approved-java-arm64
ghcr.io/openhands/agent-server:56905bd-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:56905bd-python-amd64
ghcr.io/openhands/agent-server:56905bd9396811e41fe13eb4cd8fc164853b6fe8-python-amd64
ghcr.io/openhands/agent-server:fix-assign-reviews-skip-approved-python-amd64
ghcr.io/openhands/agent-server:56905bd-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-slim-amd64
ghcr.io/openhands/agent-server:56905bd-python-arm64
ghcr.io/openhands/agent-server:56905bd9396811e41fe13eb4cd8fc164853b6fe8-python-arm64
ghcr.io/openhands/agent-server:fix-assign-reviews-skip-approved-python-arm64
ghcr.io/openhands/agent-server:56905bd-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-slim-arm64
ghcr.io/openhands/agent-server:56905bd-golang
ghcr.io/openhands/agent-server:56905bd9396811e41fe13eb4cd8fc164853b6fe8-golang
ghcr.io/openhands/agent-server:fix-assign-reviews-skip-approved-golang
ghcr.io/openhands/agent-server:56905bd-golang_tag_1.21-bookworm
ghcr.io/openhands/agent-server:56905bd-java
ghcr.io/openhands/agent-server:56905bd9396811e41fe13eb4cd8fc164853b6fe8-java
ghcr.io/openhands/agent-server:fix-assign-reviews-skip-approved-java
ghcr.io/openhands/agent-server:56905bd-eclipse-temurin_tag_17-jdk
ghcr.io/openhands/agent-server:56905bd-python
ghcr.io/openhands/agent-server:56905bd9396811e41fe13eb4cd8fc164853b6fe8-python
ghcr.io/openhands/agent-server:fix-assign-reviews-skip-approved-python
ghcr.io/openhands/agent-server:56905bd-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-slim

About Multi-Architecture Support

  • Each variant tag (e.g., 56905bd-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., 56905bd-python-amd64) are also available if needed

Clarify the assign-reviews prompt so reviewer reminder comments skip PRs that already have a human approval, even if another reviewer is still requested.

Mirror the same wording in the example workflow template.

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions github-actions Bot added the release-note-required PR requires explicit release-note coverage for behavioral or default changes label May 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

Python API breakage checks — ✅ PASSED

Result:PASSED

Behavioral default changes detected

These public Field(default=...) changes were auto-marked with the release-note-required label:

  • openhands.sdk.llm.llm.LLM.model: 'claude-sonnet-4-20250514''gpt-5.5'

Action log

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

REST API breakage checks (OpenAPI) — ✅ PASSED

Result:PASSED

Action log

Replace the broader assign-reviews prompt rewrite with a small note that reviewer reminders only apply when no human reviewer has already approved the PR.

Co-authored-by: openhands <openhands@all-hands.dev>
@enyst enyst marked this pull request as ready for review May 18, 2026 15:01
@enyst enyst enabled auto-merge (squash) May 18, 2026 15:01
Copy link
Copy Markdown
Collaborator

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Taste Rating: Good taste — this is a small, targeted prompt clarification mirrored in the example workflow. No issues found.

[RISK ASSESSMENT]

  • [Overall PR] ⚠️ Risk Assessment: 🟢 LOW
    Prompt-only workflow/example update; no runtime code, dependency, or API impact.

VERDICT:
Worth merging

This review was generated by an AI agent (OpenHands) on behalf of the user.

@enyst enyst merged commit 36e112e into main May 18, 2026
33 checks passed
@enyst enyst deleted the fix/assign-reviews-skip-approved branch May 18, 2026 15:02
Copy link
Copy Markdown
Collaborator

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ QA Report: PASS

Verified the workflow prompt change with the actual OpenHands workflow runner against real GitHub PR data; human-approved PRs are now skipped while bot-only approvals are still ignored.

Does this PR achieve its stated goal?

Yes. The PR set out to prevent the Assign Reviews workflow from posting Need Reviewer Action reminders on PRs that already have a human approval, without treating bot approvals as human approvals. Running the workflow's actual agent_script.py against real GitHub PRs showed PR #3237 changes from BASE_WAITING_FOR_REVIEW=YES to PR_WAITING_FOR_REVIEW=NO because human reviewer enyst approved it, while bot-only-approved PR #3252 remains PR_WAITING_FOR_REVIEW=YES because the only approval is from all-hands-bot.

Phase Result
Environment Setup uv run created/used the project environment; SDK workflow runner imports succeeded; changed YAML parsed.
CI Status ⚠️ At refresh: 32 success, 4 skipped, 1 failure (cleanup-on-approval), 4 in progress.
Functional Verification ✅ Actual workflow agent runner produced the expected before/after decisions on real PR data.
Functional Verification

Test 1: Human-approved PR is no longer considered waiting for review

Step 1 — Reproduce / establish baseline (without the fix):
Ran a base-vs-PR prompt comparison against the workflow YAML:

base: there are no open review comments or change requests
base_human_approval_skip_present=False
pr: there are no open review comments or change requests, and no human reviewer's latest submitted review is APPROVED; ignore approvals from automation/bot accounts for this check
pr_human_approval_skip_present=True

This shows the base workflow prompt did not instruct the agent to skip a PR with a latest human approval.

Step 2 — Apply the PR's changes:
Used the checked-out PR branch (56905bd9396811e41fe13eb4cd8fc164853b6fe8) and ran the same workflow entry point used by the GitHub Action, with a read-only QA prompt:

OPENHANDS_SUPPRESS_BANNER=1 GITHUB_TOKEN=*** LLM_API_KEY=***   LLM_MODEL=litellm_proxy/openai/gpt-5.5   LLM_BASE_URL=https://llm-proxy.app.all-hands.dev   PROMPT_STRING="$(cat /tmp/qa_assign_reviews_prompt.txt)"   uv run python /tmp/agent_script.py > /tmp/qa_agent_run.log 2>&1

Step 3 — Re-run with the fix in place:
The runner queried real PR #3237 and produced:

reviewDecision: APPROVED
reviewThreads: nodes=[]
reviews: all-hands-bot APPROVED/COMMENTED, enyst APPROVED
BASE_WAITING_FOR_REVIEW=YES
PR_WAITING_FOR_REVIEW=NO
EVIDENCE=There are no review threads or change-request reviews, and human reviewer enyst's latest submitted review is APPROVED.

This confirms the changed prompt makes the actual workflow runner skip a PR that the old waiting-for-review criterion would still treat as waiting.

Test 2: Bot-only approvals remain ignored

Step 1 — Reproduce / establish baseline (without the fix):
Found a real open PR with only a bot approval:

PR #3252: feat(sdk): allow custom FileStore injection
reviewDecision: APPROVED
botApprovals: ["all-hands-bot"]
latestReviews: all-hands-bot APPROVED

This is the edge case from the PR description: GitHub may report an approval, but it should not count as a human approval.

Step 2 — Apply the PR's changes:
Ran the same workflow runner against PR #3252 with the PR prompt variant.

Step 3 — Re-run with the fix in place:
The runner produced:

reviewThreads: nodes=[]
reviews: all-hands-bot APPROVED
BASE_WAITING_FOR_REVIEW=YES
PR_WAITING_FOR_REVIEW=YES
EVIDENCE=There are no review threads/change requests, and the only submitted approval is from all-hands-bot, with no human reviewer latest APPROVED.

This confirms automation/bot approvals are ignored by the new human-approval check.

Test 3: Changed workflow files remain parseable

Ran YAML parsing against both changed workflow files:

.github/workflows/assign-reviews.yml: YAML parsed; PROMPT_STRING length=6327; human-approval skip present=True
examples/03_github_workflows/01_basic_action/assign-reviews.yml: YAML parsed; PROMPT_STRING length=3728; human-approval skip present=True

This confirms the folded multiline prompt still loads as valid YAML in both the real workflow and mirrored example.

Issues Found

None.

This QA review was created by an AI agent (OpenHands) on behalf of the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note-required PR requires explicit release-note coverage for behavioral or default changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants