feat: enhanced PR rescue — resolve threads, request reviews, handle conflicts#121
feat: enhanced PR rescue — resolve threads, request reviews, handle conflicts#121
Conversation
…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>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Enhances the repository’s PR Rescue automation to unstick agent-created PRs across multiple failure modes (missing Copilot review, unresolved review threads, behind-main rebases, and merge conflicts), and updates documentation/changelog to reflect the new behavior.
Changes:
- Expand
.github/workflows/pr-rescue.ymlto: run on a 15-min cron, prioritize approved PRs, request Copilot reviews when missing, resolve addressed threads via GraphQL, and label/comment conflicted PRs (aw-conflict). - Update
docs/agentic-workflows.mdto document the new PR Rescue stages and the thread-ID limitation background. - Add an append-only changelog entry describing the enhanced rescue workflow.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
.github/workflows/pr-rescue.yml |
Implements the enhanced rescue logic (cron, sorting, review request, thread resolution, conflict labeling). |
docs/agentic-workflows.md |
Updates pipeline documentation to match the new rescue behavior and known limitations. |
docs/changelog.md |
Records the new PR Rescue capability in the repo-level changelog. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ad limit to 100 Address Copilot review comments on PR #121: - Guard GraphQL calls for unresolved_threads and remaining count - Guard re-queries of mergeStateStatus/reviewDecision - Use git checkout -B to handle fresh runners deterministically - Bump reviewThreads pagination from 50 to 100, add totalCount field Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add -- separator to git fetch/checkout/push to prevent branch names starting with - from being interpreted as flags - Add totalCount check to warn when threads exceed pagination cap Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the PR Rescue automation to handle multiple “stuck PR” scenarios (missing Copilot review, unresolved threads, behind main, conflicts), and documents these workflow behaviors in the repo docs/changelog.
Changes:
- Expanded
.github/workflows/pr-rescue.ymlto add a 15-minute cron, thread resolution via GraphQL, Copilot review requests, and conflict labeling/comments. - Updated workflow documentation in
docs/agentic-workflows.mdto reflect the new rescue behavior and label-gating rationale. - Added changelog entries describing the label-gate fix and the enhanced PR rescue workflow.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
.github/workflows/pr-rescue.yml |
Implements the enhanced rescue modes (review request, thread resolution, rebase, conflict handling) plus cron scheduling and sorting. |
docs/agentic-workflows.md |
Documents the updated PR rescue behavior and related workflow activation details. |
docs/changelog.md |
Records the new rescue workflow behavior and recent workflow gating changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- git checkout -B doesn't use -- separator (not a path operation) - GitHub GraphQL may reject first:0; use first:1 for totalCount only Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Review-responder posts replies using GH_AW_WRITE_TOKEN (a PAT), so replies appear as 'microsasa', not 'github-actions[bot]'. Without this fix, rescue would never resolve any thread. Found by OpenAI Codex review. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Enhances the repo’s “PR Rescue” automation to unstick agent-created PRs across multiple failure modes (missing Copilot review, unresolved threads, behind main, conflicts) and updates repo documentation/changelog to reflect the new behavior.
Changes:
- Expand PR Rescue workflow to (1) request Copilot review, (2) resolve review threads via GraphQL, (3) rebase approved PRs that are behind main, plus conflict labeling and 15-min cron.
- Update agentic workflow docs to describe the new PR Rescue behavior and related operational findings.
- Add changelog entries documenting the workflow enhancements and label-gating discovery/fix history.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/workflows/pr-rescue.yml |
Implements multi-mode rescue logic (review request, thread resolution, rebase, conflict labeling) and adds cron scheduling. |
docs/agentic-workflows.md |
Updates the pipeline documentation to match the enhanced PR Rescue behavior and recent workflow gating learnings. |
docs/changelog.md |
Records the new PR Rescue behavior and related workflow gating findings in the repo-level changelog. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Resolve PAT owner login at runtime via gh api user - Remove hardcoded 'microsasa' from thread-resolution check - Fix log message: 'bot' → 'responder (login)' Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Abandoning bash-based approach. Rewriting as gh-aw agent workflow for better maintainability and error handling. |
Enhanced PR Rescue Workflow
Three rescue modes for stuck agent PRs, sorted by progress (approved first):
1. No Copilot review
2. Unresolved threads
3. Behind main
review-response-attemptedlabel BEFORE push so responder can run on new commentsaw-conflictlabel, posts comment, skips in future runsOther changes
aw-conflictPRs excluded from processingReview feedback incorporated (from closed PR #118)
Closes #116. Refs #114.