Skip to content

feat: pipeline orchestrator — shepherd agent PRs through the full lifecycle #129

@microsasa

Description

@microsasa

Problem

Agent PRs get stuck at multiple stages after creation. Individual workflows handle each stage (review-responder, quality-gate, ci-fixer) but nothing detects and fixes stalls. When Copilot never reviews, threads stay unresolved, or a PR falls behind main, it sits there until a human intervenes.

The old pr-rescue.yml (bash script) only handled rebasing and was brittle — tens of bugs across multiple review rounds.

Solution

Replace pr-rescue.yml with a pipeline orchestrator gh-aw agent that periodically sweeps open aw-labeled PRs and pushes each one forward.

Orchestrator logic per PR (first match wins)

  1. No Copilot review → request review from @copilot
  2. Unresolved threads → query real thread IDs via GraphQL, resolve threads where the responder (PAT owner) posted the last comment
  3. Behind main → comment that rebase is needed (human or future automation handles it)
  4. All clear → auto-merge should handle it, move on

Triggers

  • schedule: */15 * * * * — catches stuck PRs between merges
  • push: branches: [main] — fires when a PR merges
  • workflow_dispatch — manual trigger

Tools & safe-outputs

  • bash: ["gh:api:graphql", "gh:api:user"] for thread ID lookup and PAT owner detection
  • add-reviewer, resolve-pull-request-review-thread, add-labels, remove-labels, add-comment
  • No contents: write, no git access — pure reasoning agent

What this replaces

  • Deletes pr-rescue.yml (106-line bash script with repeated bug-fix cycles)

Also in scope

Review-responder thread ID fix (#117): Add bash: ["gh:api:graphql"] to review-responder so it can look up real PRRT_ thread IDs before resolving, instead of hallucinating them.

Closes

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions