Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/issue-implementer.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/workflows/issue-implementer.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ safe-outputs:
protected-files: fallback-to-issue
auto-merge: true
draft: false
labels: ["aw"]
push-to-pull-request-branch:
github-token: ${{ secrets.GH_AW_WRITE_TOKEN }}

Expand Down
36 changes: 26 additions & 10 deletions .github/workflows/pr-rescue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissions:

concurrency:
group: pr-rescue
cancel-in-progress: true
cancel-in-progress: false

jobs:
rescue:
Expand All @@ -28,6 +28,11 @@ jobs:
fetch-depth: 0
token: ${{ secrets.GH_AW_WRITE_TOKEN }}

- name: Configure git identity
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Find and rebase stuck agent PRs
env:
GH_TOKEN: ${{ secrets.GH_AW_WRITE_TOKEN }}
Expand All @@ -50,11 +55,11 @@ jobs:
while IFS=' ' read -r pr_number branch; do
echo "::group::Processing PR #${pr_number} (branch: ${branch})"

# Check if PR is behind main
# Check if PR is specifically behind main (not blocked for other reasons)
merge_state=$(gh pr view "$pr_number" --json mergeStateStatus --jq '.mergeStateStatus')
echo "Merge state: ${merge_state}"

if [ "$merge_state" != "BEHIND" ] && [ "$merge_state" != "BLOCKED" ]; then
if [ "$merge_state" != "BEHIND" ]; then
echo "PR #${pr_number} is not behind main (state: ${merge_state}). Skipping."
echo "::endgroup::"
continue
Expand All @@ -70,17 +75,28 @@ jobs:

echo "PR #${pr_number} is approved but behind main. Rebasing..."

git fetch origin "$branch"
git checkout "$branch"
if ! git fetch origin "$branch" 2>&1; then
echo "::warning::Failed to fetch branch for PR #${pr_number}. Branch may have been deleted. Skipping."
echo "::endgroup::"
continue
fi

if ! git checkout "$branch" 2>&1; then
echo "::warning::Failed to checkout branch for PR #${pr_number}. Skipping."
echo "::endgroup::"
continue
fi

if git rebase origin/main; then
echo "Rebase successful. Pushing..."
git push --force-with-lease origin "$branch"
echo "✅ PR #${pr_number} rebased. CI will rerun, approval survives, auto-merge will fire."
rescued=$((rescued + 1))
if git push --force-with-lease origin "$branch" 2>&1; then
echo "✅ PR #${pr_number} rebased. CI will rerun, approval survives, auto-merge will fire."
rescued=$((rescued + 1))
else
echo "::warning::Push failed for PR #${pr_number}. Branch may have been updated. Skipping."
fi
else
echo "::warning::Rebase failed for PR #${pr_number} — likely has conflicts. Skipping."
git rebase --abort
git rebase --abort 2>/dev/null || true
fi

git checkout main
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/review-responder.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ This workflow runs when a review is submitted on a pull request.

7. After addressing all comments, run the CI checks locally to make sure your fixes don't break anything: `uv sync && uv run ruff check --fix . && uv run ruff format . && uv run pyright && uv run pytest --cov --cov-fail-under=80 -v`

8. Push all changes in a single commit with message "fix: address review comments".
8. **IMPORTANT**: You MUST reply to threads and resolve them BEFORE pushing code. Pushing code invalidates thread IDs and makes them unresolvable. The correct order is: reply → resolve → push.

9. Push all changes in a single commit with message "fix: address review comments".

If a review comment requests a change that would be architecturally significant or you're unsure about, reply to the thread explaining your concern rather than making the change blindly.
7 changes: 4 additions & 3 deletions docs/agentic-workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,11 @@ gh api repos/OWNER/REPO/branches/main/protection -X PUT --input - <<'EOF'
"required_status_checks": { "strict": true, "contexts": ["check"] },
"enforce_admins": true,
"required_pull_request_reviews": {
"dismiss_stale_reviews": true,
"dismiss_stale_reviews": false,
"required_approving_review_count": 1
},
"restrictions": null
"restrictions": null,
"required_conversation_resolution": true
}
EOF
```
Expand All @@ -381,7 +382,7 @@ gh api repos/OWNER/REPO/branches/main/protection/enforce_admins -X POST

# 5. Re-enable auto-merge on those PRs
for pr in <saved list>; do
gh pr merge --enable-auto --merge "$pr"
gh pr merge --auto --merge "$pr"
done
```

Expand Down
Loading