Conversation
Exact match to the version that successfully addressed review threads (run 23117978475, 2026-03-15), with only two changes: 1. Added if: label gate for aw PRs 2. Removed resolve-pull-request-review-thread safe-output and step 6e (orchestrator handles resolution) No other changes. This commit should not be modified. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace pull_request_review trigger with workflow_dispatch + pr_number input. No more loops from stray review events. Orchestrator or manual dispatch controls when responder runs. Removed aw label check and triggering review check — no longer applicable with workflow_dispatch. Renumbered steps. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
If CI checks fail after addressing review comments, fix the issues and re-run until they pass. Do not push broken code. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The reply-to-pull-request-review-comment and push-to-pull-request-branch safe output handlers default to target 'triggering' which requires a pull_request event context. Setting target to '*' lets the agent specify the PR number in each message, enabling workflow_dispatch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Same fix as the responder: set target '*' on push-to-pull-request-branch so the agent specifies the PR number in its message (no event context needed). Added labels: [aw] to restrict pushes. Added checkout fetch config so all remote branches are available. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
MCP tools intermittently return empty results for review data. The agent sometimes falls back to REST API on its own (PR #152) but not always (PR #158). Explicitly instruct it to use the REST API endpoints for comments and reviews. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Intentionally imperfect code for testing the review-responder agent. DO NOT MERGE this branch to main.
Fix broken_function return type mismatch: wrap int result with str() to match declared return type. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR is a responder-agent sandbox/testing change set, introducing an intentionally imperfect Python “sandbox” module and altering gh-aw agent workflows to be manually dispatched (with expanded safe-output targeting and checkout ref fetching) for testing a REST-API-based review responder flow.
Changes:
- Add
tests/test_responder_sandbox.pywith simple helper functions intended to be “imperfect” for responder testing. - Convert
review-responderfrom a PR-review-triggered workflow to aworkflow_dispatchworkflow withpr_numberinput. - Update
review-responderandci-fixerworkflows (and compiled lock files) to fetch full history/refs and set safe-outputstarget: "*"(plus addawlabels via config).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_responder_sandbox.py | Adds a sandbox module under tests/ with intentionally imperfect code (but currently not real pytest tests). |
| .github/workflows/review-responder.md | Switches responder to manual dispatch and updates instructions + safe-output targeting. |
| .github/workflows/review-responder.lock.yml | Compiled workflow updates reflecting new trigger/config (fetch depth/refs, safe-output target). |
| .github/workflows/ci-fixer.md | Adds checkout ref fetching and safe-output targeting (and config label addition). |
| .github/workflows/ci-fixer.lock.yml | Compiled workflow updates reflecting checkout ref fetching and safe-output target. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| total = 0 | ||
| for i in lst: | ||
| total = total + i | ||
| return total | ||
|
|
||
|
|
There was a problem hiding this comment.
Fixed. Replaced the manual loop/accumulator with sum(lst) for simplicity.
Generated by Review Responder
| return result | ||
|
|
||
|
|
||
| def broken_function(value: int) -> str: |
There was a problem hiding this comment.
Fixed. Renamed broken_function to increment_to_string to accurately describe its behavior (increments an int and returns it as a string).
Generated by Review Responder
| push-to-pull-request-branch: | ||
| target: "*" | ||
| labels: [aw] | ||
| github-token: ${{ secrets.GH_AW_WRITE_TOKEN }} |
There was a problem hiding this comment.
Partially addressed. Added an explicit aw label gate as step 1 in the workflow instructions — the agent will now verify the target PR has the aw label and stop if it doesn't.
However, removing labels: [aw] from the push-to-pull-request-branch frontmatter config requires recompilation of the .lock.yml file via gh aw compile, which I cannot run. This should be done manually as a follow-up.
Generated by Review Responder
| push-to-pull-request-branch: | ||
| target: "*" | ||
| labels: [aw] | ||
| github-token: ${{ secrets.GH_AW_WRITE_TOKEN }} |
There was a problem hiding this comment.
Partially addressed. Added an explicit aw label gate as step 1 in the ci-fixer instructions — the agent will now verify the target PR has the aw label before proceeding.
Same as the review-responder: removing labels: [aw] from the push-to-pull-request-branch frontmatter config requires .lock.yml recompilation via gh aw compile, which I cannot run. This should be done manually as a follow-up.
Generated by Review Responder
| 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 |
There was a problem hiding this comment.
Fixed. Added step 4: "Fetch and checkout the PR's head branch before making any code changes. Use the PR number from $\{\{ inputs.pr_number }} to determine the head ref and switch to it." This ensures the agent explicitly checks out the correct branch rather than relying on the automatic checkout step (which doesn't fire for workflow_dispatch).
Generated by Review Responder
| checkout: | ||
| fetch: ["*"] | ||
| fetch-depth: 0 | ||
|
|
There was a problem hiding this comment.
Fixed. Added step 6: "Fetch and checkout the PR's head branch before making any code changes. Use the PR number from $\{\{ github.event.inputs.pr_number }} to determine the head ref and switch to it." This ensures the ci-fixer agent explicitly checks out the PR branch before applying fixes.
Generated by Review Responder
| # Responder Sandbox — intentionally imperfect code for testing | ||
|
|
||
|
|
||
| def calculate_total(lst: list[int]) -> int: |
There was a problem hiding this comment.
Fixed. Renamed the file from tests/test_responder_sandbox.py to tests/responder_sandbox.py (removed the test_ prefix) so pytest no longer collects it as a test module.
Generated by Review Responder
| result = "" | ||
| for item in data: | ||
| suffix = "\n" if verbose else ", " | ||
| result = result + str(item) + suffix | ||
| return result |
There was a problem hiding this comment.
Fixed. Replaced the quadratic string concatenation loop with separator.join(data). This also eliminates the trailing delimiter issue since join only places the separator between elements.
Generated by Review Responder
| 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 using the GitHub REST API: fetch `https://api.github.com/repos/$OWNER/$REPO/pulls/$PR_NUMBER/comments` and `https://api.github.com/repos/$OWNER/$REPO/pulls/$PR_NUMBER/reviews`. 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. |
There was a problem hiding this comment.
Fixed. Rewrote step 5 (previously step 3) to:
- Use
{owner}/{repo}/{pr_number}placeholder notation instead of non-existent$OWNER/$REPO/$PR_NUMBERenv vars - Note that the REST API doesn't expose thread resolution state, and instruct the agent to use
in_reply_to_idto identify top-level threads - Add guidance to fall back to REST when MCP tools return empty results
- Removed the
/reviewsendpoint reference since comments are sufficient for identifying threads
Generated by Review Responder
Quality Gate — Manual Review RequiredDecision: NOT auto-approving (HIGH impact + explicit "DO NOT MERGE") Evaluation Summary
High-Impact Areas
RecommendationThis is a test sandbox PR explicitly marked "DO NOT MERGE." A human reviewer should evaluate whether the workflow configuration changes (especially
|
Test PR for responder agent with REST API fallback instruction. DO NOT MERGE.