I just provided this prompt to OpenHands and will ...
# proj-agent-canvas
l
I just provided this prompt to OpenHands and will be looking into how we can tighten our automatic validation of issues/PRs. Feedback welcome!
We are getting a lot of low-quality AI-generated PRs on org:OpenHands repos, particularly OpenHands/OpenHands. Review the recent PRs from external contributors, especially first-time contributors. I see a few issues:
1. Some don’t mention an existing issue, so they may be solving a problem that has not been clearly described.
2. Some existing issues do not have clear acceptance criteria. It is OK for issues to not have clear acceptance criteria, but perhaps we can make a rule/github CI enforcing this rule that an issue is not labeled as “ready-for-dev” until it achieves certain criteria.
3. For issues that are bug fixes, the user did not provide evidence that they reproduced the error in a live setting, and then fixed it afterwards. We need stronger guidelines about how they can actually run the software (e.g. using the “agent canvas” or “npm run dev” commands).
Examine the open issues, PRs, and recently closed and merged or closed and discarded PRs on this repo, and come up with a holistic strategy to make our process and automatic checks tighter, so that a PR that passes CI is more likely to be ready to receive a positive human review.
😂
😅 1
c
Re: 3 I suggest using the QA Agent skill, hopefully under the form of an automation, since this is exactly what it does so it covers the miss. WDYT? We could make it post in the PR description Evidence section, or in a comment of its own. Not linked to the reviews, it's a specific task (before / after etc)
l
I think that could be good!
Here’s my attempt at number 1, of making sure that issues are ready for development: github.com/OpenHands/OpenHands/pull/16449 It’d be great if I could get a review and get this merged so I can test if it’s working properly.
c
We can benefit from doing this, IMHO, and we can iterate on further details. I think using QA Agent as an Automation should simplify things both for authors and reviewers 🤔 Approved the PR, we can simplify or add in time, I suppose 🙏 https://github.com/OpenHands/OpenHands/pull/16449#pullrequestreview-4896516375
l
Yeah, I think the QA agent could actually help gather the evidence that we require that things are working
c
@fresh-machine-37269 Make a new Automation for QA Agent. Find it in openhands/extensions, I think it might be named qa-changes. The automation needs to run on PR opened or open for review, but only if the PR is opened for review; if the PR human author has more than 3 commits already in main; if there isn’t already a section in PR Description named “QA Agent”. The Automation should run the prompt from that skill, with a small tweak: it needs to tell the agent to not make a new comment, instead edit the PR Description to add a section at the end, after a horizontal line, titled “QA Agent”, where it posts its outcome as per the skill. To be clear, if the section already exists, the Automation script should NOT start a new conversation. Make the Automation disabled, and tell us the prompt you used.
👀 1
f
🤖 On it! View progress here: oss-agent-canvas.ngrok.dev/conversations/…
✅ Done! Done! Here's what I created: PR: github.com/OpenHands/extensions/pull/465 — adds the
qa-changes
automation catalog entry. How the automation works: • Trigger: GitHub
pull_request.opened
and
pull_request.ready_for_review
events • JMESPath filter (event-level):
!pull_request.draft && !icontains(pull_request.body, 'QA Agent') && glob(repository.full_name, '<repo>')
— only fires when the PR is not a draft, has no existing "QA Agent" section, and matches the configured repo • Prompt gate checks (agent-level): The prompt tells the agent to first verify (1) the PR is not a draft, (2) the PR's human author has more than 3 commits already in main (via GitHub API), and (3) no "QA Agent" section exists in the PR description. If any check fails, the agent stops without making changes — no conversation started. • Report delivery: Instead of posting a comment/review, the agent edits the PR description to append
---
followed by a
## QA Agent
section with the structured QA report. The prompt I used (adapted from the qa-changes skill's
prompt.py
, with the PR-description-editing tweak):
A pull request was opened or marked ready for review in {{form.repository}}. Before doing any QA work, run these gate checks and stop immediately (making no changes) if any fails:
1. The PR must not be a draft — it must be open for review. If the PR is a draft, stop.
2. The PR author (the human who opened it) must have more than 3 commits already merged into the {{form.ref}} branch. Use the GitHub API to count the author's commits in {{form.ref}}. If the count is 3 or fewer, stop without making any changes.
3. The PR description must not already contain a section named QA Agent (i.e., a header like ## QA Agent or ### QA Agent). If that section already exists, stop without making any changes or starting a conversation.
If all gate checks pass, proceed with the QA validation using the /qa-changes skill methodology:
• Phase 1: Understand the change. Read the PR diff, title, and description. Identify the goal of the PR. Classify every changed file. Form a hypothesis about what the PR should achieve.
• Phase 2: Set up the environment. Read the repo's bootstrap instructions, install dependencies, and build if needed. Note CI status but do not re-run tests.
• Phase 3: Exercise the changed behavior. Actually run the software the way a real user would — start servers, run CLI commands, make HTTP requests, open browsers. Do NOT run the test suite, linters, or code analysis. For bug fixes, reproduce the bug before and after the fix. Show before/after evidence.
• Phase 4: Report results.
IMPORTANT — how to post your report:
Do NOT post a new comment, review, or inline review comment. Instead, EDIT the PR description (the pull request body) to append your QA report at the very end, after a horizontal rule (---), under a new section titled QA Agent. Use the GitHub API (PATCH /repos/{owner}/{repo}/pulls/{pr_number} with a body field) to update the PR description. Append the following structure to the existing PR body:
———
QA Agent
{Your full QA report following the /qa-changes skill report format: verdict, summary, Does this PR achieve its stated goal? section, status table, collapsible evidence in details blocks, and issues found.}
Do not make any other changes to the PR description — only append the QA Agent section at the end. Do not post any comments or reviews.
About "disabled": I wasn't able to create the actual automation instance via the cloud API — the automation API key available to me is expired. Once PR #465 is merged, you can create the automation disabled by running:
Copy code
# Create the automation
curl -X POST "<https://app.all-hands.dev/api/automation/v1/preset/prompt>" \
  -H "Authorization: Bearer $OPENHANDS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"QA Changes Agent - OpenHands/OpenHands","prompt":"...","repos":[{"url":"OpenHands/OpenHands","provider":"github","ref":"main"}],"trigger":{"type":"event","source":"github","on":["pull_request.opened","pull_request.ready_for_review"],"filter":"!pull_request.draft && !icontains(pull_request.body, '\''QA Agent'\'') && glob(repository.full_name, '\''OpenHands/OpenHands'\'')"}}'

# Then disable it (replace {id} with the returned ID)
curl -X PATCH "<https://app.all-hands.dev/api/automation/v1/{id}>" \
  -H "Authorization: Bearer $OPENHANDS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled": false}'
The catalog entry in the manifest is ready to use from Agent Canvas once merged — it'll show up as "QA Changes Agent" in the Automations templates page.