Skip to content
Closed
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
58 changes: 24 additions & 34 deletions .github/workflows/review-responder.lock.yml

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

44 changes: 24 additions & 20 deletions .github/workflows/review-responder.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
---
if: "contains(github.event.pull_request.labels.*.name, 'aw')"
on:
pull_request_review:
types: [submitted]
roles: all
bots: [Copilot, copilot-pull-request-reviewer]
workflow_dispatch:
inputs:
pr_number:
description: "PR number to address review comments on"
required: true
type: string

permissions:
contents: read
issues: read
pull-requests: read

checkout:
fetch: ["*"]
fetch-depth: 0

engine:
id: copilot
model: claude-opus-4.6
Expand All @@ -28,8 +33,11 @@ safe-outputs:
noop:
report-as-issue: false
push-to-pull-request-branch:
target: "*"
labels: [aw]
github-token: ${{ secrets.GH_AW_WRITE_TOKEN }}
reply-to-pull-request-review-comment:
target: "*"
max: 10
github-token: ${{ secrets.GH_AW_WRITE_TOKEN }}
add-labels:
Expand All @@ -39,32 +47,28 @@ safe-outputs:

# Review Responder

Address review comments on pull request #${{ github.event.pull_request.number }}.
Address review comments on pull request #${{ inputs.pr_number }}.

## Instructions

This workflow runs when a review is submitted on a pull request.

1. First, check if the PR has the `aw` label. If it does NOT have the `aw` label, stop immediately — this workflow only handles agent-created PRs.

2. Check the review that triggered this workflow. If the review has no comments (e.g., a plain approval with no inline comments), stop — there is nothing to address.
This workflow addresses unresolved review comments on a pull request.

3. Check if the PR already has the label `review-response-attempted`. If it does, add a comment to the PR saying "Review response already attempted — stopping to prevent loops. Manual intervention needed." and stop.
1. Check if the PR already has the label `review-response-attempted`. If it does, add a comment to the PR saying "Review response already attempted — stopping to prevent loops. Manual intervention needed." and stop.

4. Add the label `review-response-attempted` to the PR.
2. Add the label `review-response-attempted` to the PR.

5. Read the unresolved review comment threads on the PR (not just the latest review — get all unresolved threads). If there are more than 10 unresolved threads, address the first 10 and leave a summary comment on the PR noting how many remain for manual follow-up.
3. Read the unresolved review comment threads on the PR (not just the latest review — get all unresolved threads). If there are more than 10 unresolved threads, address the first 10 and leave a summary comment on the PR noting how many remain for manual follow-up.

6. For each unresolved review comment thread (up to 10):
4. For each unresolved review comment thread (up to 10):
a. Read the comment and understand what change is being requested
b. Read the relevant file and surrounding code context
c. Make the requested fix in the code (edit the file locally — do NOT push yet)
c. Make the requested fix in the code
d. Reply to the comment thread explaining what you changed

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`
5. 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". Reply to all threads BEFORE pushing — replies after a push will appear on outdated code.
6. If CI checks fail, fix the issues and re-run until they pass. Do not push broken code.

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. Push all changes in a single commit with message "fix: address review comments".

NOTE: Thread resolution is handled separately by the pipeline orchestrator after this workflow completes. Your job is to fix the code and reply to threads — do NOT attempt to resolve threads.
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.
16 changes: 16 additions & 0 deletions tests/test_responder_sandbox.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Responder Sandbox — intentionally imperfect code for testing


def calculate_total(lst: list[int]) -> int:
total = 0
for i in lst:
total = total + i
return total


def format_output(data: list[str], verbose: bool) -> str:
result = ""
for item in data:
suffix = "\n" if verbose else ", "
result = result + str(item) + suffix
return result
Loading