Skip to content

ci: daily stuck-PR detector (surface-only; notifies owner + agents)#1140

Merged
100yenadmin merged 3 commits into
mainfrom
ci/stuck-pr-report
Jun 21, 2026
Merged

ci: daily stuck-PR detector (surface-only; notifies owner + agents)#1140
100yenadmin merged 3 commits into
mainfrom
ci/stuck-pr-report

Conversation

@100yenadmin

Copy link
Copy Markdown
Member

What

A daily safety-net for the "agents shepherd their own PRs" discipline — catches PRs whose driving agent died/abandoned them. Surface-only (a scheduled job can't spawn a fixer), routed to both audiences:

  • Owner → upserts a single living issue + @mention (GitHub notification email), with an optional Resend real-email path if RESEND_API_KEY is set.
  • Agents → it's a GitHub issue, so any future/idle agent can adopt the orphan (the worldos-dev skill now points them at the stuck-pr-report issue as the shared queue).

Files

  • .github/scripts/stuck_pr_report.sh — flags open non-draft PRs that have a failing check, OR are blocked/conflicting AND stale (>24h). Excludes drafts + blocked-labelled PRs (the snooze). Upserts one issue (found by label), edits its body + posts a dated @mention comment.
  • .github/workflows/stuck-pr-report.yml — daily cron (23 15 * * *) + workflow_dispatch. Not a pull_request check, so it adds no merge gate.
  • worldos-dev skill: one-line pointer so agents treat the report issue as the orphan-PR queue.

Why

The "never push-and-abandon" rule is a behavioral promise that breaks when the agent dies. Live proof: #1025 sat 3+ days BLOCKED with a red qa-release-gate-tests + 2 unresolved threads while ~40 PRs merged past it. Nothing was watching.

Validated

Ran the script live against the repo → produced issue #1138 correctly flagging #1025 (and zero false-positives on the ~10 active PRs).

Notes

  • Zero setup to start (GitHub-notification email via the @mention). To get a guaranteed standalone email, set RESEND_API_KEY (secret) + STUCK_PR_EMAIL_TO/STUCK_PR_EMAIL_FROM (vars); the script fires Resend only if all three are present.
  • Additive (new workflow/script + 1 doc line). No code/test/schema touched. Merging via --squash --auto.

🤖 Generated with Claude Code

Safety net for the 'agents shepherd their own PRs' rule — catches PRs whose driving
agent died/abandoned them (e.g. #1025: 3+ days BLOCKED with a red required check +
2 unresolved threads while ~40 PRs merged past it).

- .github/scripts/stuck_pr_report.sh — flags open non-draft PRs that are failing a
  check OR blocked/conflicting AND stale (>24h); excludes drafts + `blocked`-labelled
  (snooze). Upserts ONE living issue + @mentions the owner (→ GitHub notification email);
  optional Resend email if RESEND_API_KEY is set. Surface-only (cron can't spawn a fixer).
- .github/workflows/stuck-pr-report.yml — daily cron + workflow_dispatch; NOT a PR check.
- worldos-dev skill: point agents at the `stuck-pr-report` issue as the shared orphan queue.

Validated live: produced issue #1138 flagging #1025. From the 2026-06-21 process review.
@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@100yenadmin, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 12 minutes and 3 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 85f926c7-261c-4568-b2b5-228aa58bdf9e

📥 Commits

Reviewing files that changed from the base of the PR and between fba8929 and 1373d3a.

📒 Files selected for processing (3)
  • .claude/skills/worldos-dev/SKILL.md
  • .github/scripts/stuck_pr_report.sh
  • .github/workflows/stuck-pr-report.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/stuck-pr-report

Comment @coderabbitai help to get the list of available commands and usage tips.

@100yenadmin 100yenadmin enabled auto-merge (squash) June 21, 2026 16:25

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5c9067e294

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/scripts/stuck_pr_report.sh
…x P2)

When no PRs are stuck, edit the open report issue to all-clear and CLOSE it, so an open
`stuck-pr-report` issue always means 'something is stuck now' — agents won't adopt
already-resolved PRs. Upsert now reuses+reopens the single canonical issue (open → else
reopen most-recent closed → else create). Addresses Codex P2 on #1140.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ec7b3a4a5a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/stuck-pr-report.yml
…ex P2)

The explicit permissions block sets unlisted scopes to none; statusCheckRollup reads
check runs + commit statuses + workflow-run data, which would fail under GITHUB_TOKEN
with 'Resource not accessible by integration' (the local PAT validation masked this).
Add checks:read + statuses:read + actions:read. Addresses Codex P2 on #1140.
@100yenadmin 100yenadmin merged commit e579ca6 into main Jun 21, 2026
22 checks passed
@100yenadmin 100yenadmin deleted the ci/stuck-pr-report branch June 21, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant