calm-artist-7206
09/09/2026, 9:05 PMfresh-machine-37269
09/09/2026, 9:05 PMfresh-machine-37269
09/09/2026, 9:21 PM.pr/ PR-artifacts convention, but with two slightly different workflow shapes:
Convention (same everywhere):
β’ A temporary .pr/ directory at the repo root holds PR-only artifacts (design docs, live-test logs, screenshots, dev-only scripts).
β’ A PR Artifacts workflow (.github/workflows/pr-artifacts.yml) posts a comment on a PR when .pr/ exists.
β’ On approval (same-repo PRs) the workflow removes .pr/ with a follow-up commit; fork PRs are cleaned up from main after merge.
β’ Instructions live in a repo .md file (AGENTS.md, plus CONTRIBUTING.md / PR template where relevant).
State across the four repos:
β’ OpenHands β β
workflow + `AGENTS.md`/PR template docs
β’ software-agent-sdk β β
workflow (the fullest: notification + approval cleanup + after-merge cleanup) + `AGENTS.md`/`CONTRIBUTING.md`/PR template docs
β’ automation β β
workflow + AGENTS.md docs
β’ extensions β β missing everything (no workflow, no docs, and stale .pr/ artifacts sitting directly on main)
What I did Opened one PR to fix the single missing repo:
PR #545 β OpenHands/extensions β github.com/OpenHands/extensions/pull/545
β’ Added .github/workflows/pr-artifacts.yml (parity with software-agent-sdk).
β’ Documented the .pr/ convention in AGENTS.md.
β’ Removed five orphaned custom-automation-*.png screenshots that had been committed straight to main instead of living in a PR's temporary .pr/ directory.
The other three repos (OpenHands, software-agent-sdk, automation) already have the convention in place, so no changes were needed there.calm-artist-7206
09/09/2026, 9:24 PMfresh-machine-37269
09/09/2026, 9:25 PMautomation and OpenHands) against software-agent-sdk, which is the reference. I diffed the live main versions of all three workflows.
software-agent-sdk (the fullest) β 3 jobs 1. cleanup-on-approval β on pull_request_review (approved, same-repo) removes .pr/ with a commit.
2. check-pr-artifacts β on pull_request_target (not closed), inspects the PR head via the API (never checks out untrusted code) and posts/updates the notice comment. It also differentiates fork vs. same-repo in the comment text.
3. cleanup-after-merge β on pull_request_target (closed + merged), removes .pr/ from the base branch after merge. This is what covers fork PRs and same-repo PRs where approval cleanup was missed.
automation vs. agent-sdk Missing:
β’ β cleanup-after-merge job entirely β fork PRs are never auto-cleaned; they still say "manual removal required before merging."
β’ β pull_request_target trigger β uses plain pull_request (and its types are [opened, synchronize, reopened] β no closed), so fork/after-merge cleanup is impossible.
β’ β Fork-vs-same-repo distinction in the notice comment (always says "removed on approval; fork PRs need manual removal").
β’ Also uses actions/checkout@v6 vs. @v7 (minor).
OpenHands vs. agent-sdk Missing:
β’ β cleanup-after-merge job β fork PRs are never auto-cleaned (comment still says "Fork PRs require manual cleanup before merging").
β’ β pull_request_target trigger β check-pr-artifacts uses pull_request + checkout instead of API inspection.
β’ β Fork-vs-same-repo distinction in the notice comment.
Ahead of agent-sdk (worth keeping):
β’ β
cleanup-on-approval is actually more robust β it resolves the PR context via gh api (head_ref/head_sha/`has_pr_dir`), verifies the checked-out SHA matches, and has a rebase-and-retry (Γ3) loop on push failure. agent-sdk's version is a simpler single-push.
Net summary The one meaningful gap common to both is the cleanup-after-merge job + pull_request_target path β i.e., automatic cleanup of fork PRs from main after merge. automation is missing exactly that plus the fork-aware comment; OpenHands is missing that plus the fork-aware comment, but has a stronger approval-cleanup (SHA verification + retry).
Want me to open PRs to bring automation and OpenHands up to parity (add cleanup-after-merge, switch to pull_request_target API inspection, fork-aware notice) while preserving OpenHands' more-robust approval path?calm-artist-7206
09/09/2026, 9:31 PMfresh-machine-37269
09/09/2026, 9:38 PMsoftware-agent-sdk (the reference) and opened a PR for each of the two that were missing something.
PRs opened 1. OpenHands/automation β PR #435 β <https://github.com/OpenHands/automation/pull/435
Added|github.com/OpenHands/automation/pull/435_Added> the missing cleanup-after-merge job (fork PRs now auto-clean from main after merge) and switched check-pr-artifacts to pull_request_target API inspection with a fork-aware notice comment.
2. OpenHands/OpenHands β PR #17245 β <https://github.com/OpenHands/OpenHands/pull/17245
Same|github.com/OpenHands/OpenHands/pull/17245_Same> gap fixed (cleanup-after-merge + fork-aware notice), but I kept its existing more-robust approval-cleanup path (head-SHA verification + rebase-and-retry Γ3), which is actually stronger than agent-sdk's simpler single-push.
(extensions PR #545 from earlier remains open β it was the repo missing the entire convention.)
Why these are the "similar stuff from the best" β’ software-agent-sdk was the only one with a cleanup-after-merge job β the piece that auto-removes .pr/ from main after a fork PR merges. Both automation and OpenHands were missing it, so fork PRs could never be auto-cleaned (their notices still said "manual removal required").
β’ The other meaningful gap was the pull_request_target + API inspection approach, which avoids checking out untrusted fork code with a write token and lets the notice distinguish fork vs. same-repo.
One judgment call worth flagging: for OpenHands I did not blindly copy agent-sdk, because doing so would have replaced its stronger approval-cleanup logic with a weaker one. The OpenHands PR only adds what was missing and preserves the existing robustness.