From cd6ffa5c697fa3e57bdd0a44593e8b77318347bb Mon Sep 17 00:00:00 2001 From: Jack Firth Date: Sun, 19 Jul 2026 23:04:52 -0700 Subject: [PATCH] Limit Autopilot to 3 open pull requests Fixes #770 Co-Authored-By: Claude Opus 4.8 --- .github/workflows/autopilot.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/autopilot.yml b/.github/workflows/autopilot.yml index 48f810de..9cc8acc9 100644 --- a/.github/workflows/autopilot.yml +++ b/.github/workflows/autopilot.yml @@ -18,6 +18,11 @@ jobs: uses: actions/checkout@v5 - name: Assign issue to copilot run: | + open_pull_requests=$(gh pr list --state open --author 'app/copilot-swe-agent' --json number --jq 'length') + if [ "$open_pull_requests" -ge 3 ]; then + echo "Copilot already has $open_pull_requests open pull requests, skipping assignment." + exit 0 + fi issue_number=$(gh issue list --state open --label 'autopilot-candidate' --search 'no:assignee -is:blocked' --json number --jq '.[].number' | shuf -n 1) gh issue edit $issue_number --add-assignee "@copilot" env: