Skip to content

fix(skills/review-loop): triage existing reviews instead of double-requesting#15

Merged
sourcehawk merged 3 commits into
mainfrom
fix/review-loop-double-request
May 31, 2026
Merged

fix(skills/review-loop): triage existing reviews instead of double-requesting#15
sourcehawk merged 3 commits into
mainfrom
fix/review-loop-double-request

Conversation

@sourcehawk
Copy link
Copy Markdown
Owner

Description

review-loop opened every run by unconditionally requesting Copilot at Step 1.
When a complete but un-triaged review already sat on the current head — and
especially on a repo that auto-reviews on push — that stacked a redundant
request on top of work that was already there, and the "re-requesting is
unreliable, never assume it fired" guidance then provoked an immediate retry,
producing two explicit requests in a row. This makes the loop triage what is
already on the PR before asking for anything new.

Changes

  • Add an entry "take stock" gate: an un-triaged review on the current head
    is this round's review (triage it, Step 4); if the repo auto-reviews on push,
    pushing is the trigger and no explicit request is stacked on it.
  • Make Step 1 conditional on that gate rather than an unconditional request,
    with a matching branch added to the loop diagram.
  • Fix Step 6 so a background-wait timeout on an auto-review-on-push repo is
    treated as latent, not absent — stop and report the pending review instead
    of re-triggering and double-firing.
  • Two new Red Flags rows for the entry redundant-request and the
    timeout-driven re-trigger.

Challenges

The double-request had two distinct origins — the unconditional entry request
and a wait-timeout re-trigger on a repo whose auto-review simply lags the push
(by hours). The entry gate decapitates the first; the Step 6 rewrite closes the
second. Both were verified with isolated subagents: the pre-fix skill fires the
redundant request, the post-fix skill issues zero explicit requests under the
same impatience pressure and triages instead.

Testing

Developed via the writing-skills RED→GREEN→REFACTOR loop with isolated
subagents driving the skill text against the exact incident state (a 4h-old
un-triaged review on head, repo auto-reviews on push with ~2h latency):

  • RED: baseline agent fires gh pr edit --add-reviewer at Step 1 despite the
    existing review.
  • GREEN: with the entry gate, agent routes straight to triage, zero requests.
  • REFACTOR: confirmed the Step 6 timeout path no longer re-triggers on an
    auto-review repo, even under explicit time pressure.

🤖 Generated with Claude Code

…questing

The loop opened by unconditionally requesting Copilot at Step 1, even when
a complete un-triaged review already sat on the current head and the repo
auto-reviews on push — stacking duplicate requests. Add an entry "take
stock" gate, make Step 1 conditional, and fix Step 6 so a wait timeout on
an auto-review-on-push repo is treated as latent (stop) rather than absent
(re-trigger).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 31, 2026 00:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the review-loop skill to avoid redundant Copilot review requests by first triaging any already-present review on the current head and by treating auto-review-on-push timeouts as pending rather than absent.

Changes:

  • Add an entry “take stock” gate to detect and triage an un-triaged Copilot review on the current head before requesting anything new.
  • Make Step 1’s explicit reviewer request conditional (and update the loop diagram accordingly).
  • Refine Step 6 timeout handling to prevent double-triggering on repos that auto-review on push, and add matching “Red flags” guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread skills/review-loop/SKILL.md Outdated
Comment on lines +42 to +55
@@ -50,6 +51,8 @@ digraph review_loop {
"Done: clean" [shape=doublecircle];
"Stop, report what remains" [shape=box];

"Take stock: un-triaged review on current head?\nrepo auto-reviews on push?" -> "Triage every open comment\n(receiving-code-review)" [label="review already present"];
"Take stock: un-triaged review on current head?\nrepo auto-reviews on push?" -> "Capture watermark, request Copilot" [label="none to triage"];
Comment thread skills/review-loop/SKILL.md Outdated

1. **Capture the watermark, then request.** `SINCE=$(date -u +%Y-%m-%dT%H:%M:%SZ)` *before* `gh pr edit <pr> --add-reviewer "@copilot"`. The watermark is what distinguishes the new review from a stale one left by an earlier round.
1. **Capture the watermark, then request — only when the entry check says you need to.** `SINCE=$(date -u +%Y-%m-%dT%H:%M:%SZ)` *before* `gh pr edit <pr> --add-reviewer "@copilot"`. The watermark is what distinguishes the new review from a stale one left by an earlier round. Skip this step and go straight to triage (Step 4) when a current un-triaged review already exists, or when a push you are about to make will auto-trigger the review.
2. **Confirm Copilot attached.** `gh pr view <pr> --json reviewRequests`. If Copilot is **not** in the list, it is unavailable for this repo/plan (or `gh` is too old / this is GHES). Do **not** start waiting — there is no reviewer to produce a review. Instead do one triage pass over any human comments already on the PR (Step 3), state that Copilot review is unavailable, and exit. There is no loop without an automated reviewer to re-request.
sourcehawk and others added 2 commits May 31, 2026 02:49
The take-stock diamond asked about both an existing review and
auto-review-on-push but only branched on the former, so the "none to
triage" edge routed to an explicit request — contradicting the prose that
says an auto-review repo should wait for the queued review, not request.
Split it into two diamonds so the auto-review-on-push path waits instead.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Copilot-unavailable fallback pointed at "(Step 3)" for the triage
pass, but triage is Step 4 (Step 3 is the background wait).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sourcehawk sourcehawk merged commit a1ee58b into main May 31, 2026
@sourcehawk sourcehawk deleted the fix/review-loop-double-request branch May 31, 2026 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants