Skip to content

feat: enhanced PR rescue — resolve threads, request reviews, handle conflicts#118

Closed
microsasa wants to merge 1 commit intomainfrom
feat/enhanced-rescue
Closed

feat: enhanced PR rescue — resolve threads, request reviews, handle conflicts#118
microsasa wants to merge 1 commit intomainfrom
feat/enhanced-rescue

Conversation

@microsasa
Copy link
Owner

Enhanced PR Rescue Workflow

Three rescue modes for stuck agent PRs, sorted by progress (approved first):

1. No Copilot review

  • Rebases first if behind main (so Copilot reviews fresh code)
  • Requests Copilot review
  • Stops — lets pipeline run, next cycle picks up

2. Unresolved threads

3. Behind main

  • Approved + threads clear + BEHIND: rebases
  • Removes review-response-attempted label BEFORE push so responder can run on new comments
  • Merge conflicts: adds aw-conflict label, posts comment, skips in future runs

Other changes

  • 15-min cron schedule (catches stuck PRs between merges)
  • PRs sorted by approval status (approved first = closest to done)
  • aw-conflict PRs excluded from processing
  • Re-queries merge state after thread resolution
  • Updated docs and changelog

Review feedback incorporated

  • Gemini 3 Pro: rebase before review, conflict labels, explicit sorting, label removal ordering
  • GPT-5 Codex: check last comment author not just any reply, re-query state after changes

Closes #116. Refs #114.

Copilot AI review requested due to automatic review settings March 15, 2026 23:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Enhances the PR Rescue automation to unstick agent-created PRs across more pipeline stages (missing Copilot review, unresolved threads, behind-main rebases), aligning with the repo’s autonomous PR flow and conversation-resolution requirements.

Changes:

  • Expand PR Rescue into a 3-stage rescuer: request Copilot review, resolve eligible review threads via GraphQL, and rebase approved BEHIND PRs (with conflict labeling).
  • Add a 15-minute cron trigger and prioritize processing PRs closest to merge (approved first), skipping aw-conflict PRs.
  • Update workflow documentation and changelog to reflect the new rescue behavior and thread-ID root cause context.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/pr-rescue.yml Adds cron trigger, progress-sorted processing, GraphQL-based thread resolution, conflict labeling, and expanded rebase logic.
docs/agentic-workflows.md Updates PR Rescue documentation to describe the expanded multi-stage rescue behavior and scheduling.
docs/changelog.md Records the enhanced rescue behavior and related operational notes in the append-only changelog.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…onflicts

Three rescue modes, sorted by progress (approved PRs first):
1. No Copilot review: rebase if behind main, then request review
2. Unresolved threads: resolve if bot reply is last comment (real
   GraphQL thread IDs, not hallucinated)
3. Behind main: rebase, remove review-response-attempted label
   BEFORE push so responder can run on new comments

Plus: 15-min cron schedule, aw-conflict label on merge conflicts,
skip conflicted PRs in future runs.

Incorporates review feedback from Gemini 3 Pro and GPT-5 Codex:
- Rebase before requesting review (not after)
- Remove label before push (not after)
- Label merge conflicts instead of silent retry loop
- Explicit sort by approval status
- Check last comment author (not just any reply exists)

Closes #116

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@microsasa microsasa force-pushed the feat/enhanced-rescue branch from 716da8a to 89de389 Compare March 16, 2026 02:10
@microsasa
Copy link
Owner Author

Pulling back — need to fix workflow triggers first (workflows firing on non-agent PRs).

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.

Enhanced PR Rescue: resolve threads + request reviews + rebase behind-main

2 participants