From 95b3c920b72253ab30d66d2ea9c5fe86f3671df3 Mon Sep 17 00:00:00 2001 From: openhands Date: Thu, 23 Apr 2026 17:17:47 +0000 Subject: [PATCH 1/2] iterate skill: add review thread reply and resolve guidance The iterate skill previously told the agent to fix code and push when addressing review feedback, but never mentioned replying to individual review threads or resolving them. This left threads dangling in the GitHub UI even after the code was fixed. Changes: - Updated the actionable/non-actionable comment workflows to include reply and resolve steps - Added a new 'Replying to and resolving review threads' subsection with concrete gh CLI commands (REST for reply, GraphQL for resolve) - Added a GraphQL query for discovering unresolved threads and their IDs - Added rules: reply to every thread, resolve addressed threads, verify zero unresolved threads before marking PR ready - Updated 'When done' section to require thread verification - Added 'Review threads resolved (count)' to final summary output Co-authored-by: openhands --- skills/iterate/SKILL.md | 74 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 69 insertions(+), 5 deletions(-) diff --git a/skills/iterate/SKILL.md b/skills/iterate/SKILL.md index 49114611..9bd11183 100644 --- a/skills/iterate/SKILL.md +++ b/skills/iterate/SKILL.md @@ -223,15 +223,76 @@ Review items come from: When a comment is actionable and correct: 1. Fix the code. -2. Commit with `chore: address PR review feedback (#)`. -3. Push and continue the loop. +2. Reply to the review thread explaining what you changed (be specific). +3. Resolve the thread. +4. Commit with `chore: address PR review feedback (#)`. +5. Push and continue the loop. When a comment is non-actionable, already addressed, or you disagree: -continue the loop. +reply briefly explaining why, then resolve the thread. Do not leave +threads dangling without a response. If a review thread is already resolved in GitHub, ignore it unless new unresolved follow-up appears. +### Replying to and resolving review threads + +Every inline review comment creates a thread. After addressing a comment +(or deciding it's non-actionable), you must: + +1. **Reply** to the thread so the reviewer can see how you addressed it: + + ```bash + gh api "repos/{owner}/{repo}/pulls/{number}/comments" \ + -F "body=Fixed — " \ + -F "in_reply_to=" + ``` + + Use `-F` (not `-f`) for `in_reply_to` so it is sent as a number. + +2. **Resolve** the thread via GraphQL: + + ```bash + gh api graphql \ + -f query='mutation($id: ID!) { + resolveReviewThread(input: { threadId: $id }) { + thread { isResolved } + } + }' \ + -f id="" + ``` + +To discover unresolved threads and their IDs: + +```bash +gh api graphql -f query=' +query($owner: String!, $repo: String!, $pr: Int!) { + repository(owner: $owner, name: $repo) { + pullRequest(number: $pr) { + reviewThreads(last: 100) { + nodes { + id + isResolved + path + line + comments(first: 1) { + nodes { databaseId author { login } body } + } + } + } + } + } +}' -f owner="{owner}" -f repo="{repo}" -F pr="{number}" \ + --jq '.data.repository.pullRequest.reviewThreads.nodes[] + | select(.isResolved == false)' +``` + +**Rules:** +- Reply to every thread, even nits. A brief "Done" or "Kept as-is because…" is fine. +- Resolve threads you have addressed. Do not leave resolved-in-code threads + showing as unresolved in the GitHub UI. +- Before marking the PR ready, verify zero unresolved threads remain. + ### Requesting re-review If the PR is green but blocked on review approval and you've addressed all @@ -286,8 +347,10 @@ Stop **only** when: ## When done — mark PR ready -Once all present verification layers pass on the current SHA, convert the -draft PR to ready for review: +Once all present verification layers pass on the current SHA: + +1. Verify all review threads are resolved (zero unresolved remaining). +2. Convert the draft PR to ready for review: ```bash gh pr ready @@ -327,6 +390,7 @@ Final summary should include: - Mergeability / conflict status - Fixes pushed - Flaky retry cycles used +- Review threads resolved (count) - Remaining unresolved failures or review comments ## References From c72919c81d75655d8ac4e63b9783e0eb7068d382 Mon Sep 17 00:00:00 2001 From: openhands Date: Thu, 23 Apr 2026 17:23:51 +0000 Subject: [PATCH 2/2] chore: address PR review feedback (#206) - reorder workflow steps Commit and push before replying to review threads, so the reply can reference the actual commit SHA (e.g. 'Fixed in abc1234'). Co-authored-by: openhands --- skills/iterate/SKILL.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/skills/iterate/SKILL.md b/skills/iterate/SKILL.md index 9bd11183..30a077bf 100644 --- a/skills/iterate/SKILL.md +++ b/skills/iterate/SKILL.md @@ -223,10 +223,10 @@ Review items come from: When a comment is actionable and correct: 1. Fix the code. -2. Reply to the review thread explaining what you changed (be specific). -3. Resolve the thread. -4. Commit with `chore: address PR review feedback (#)`. -5. Push and continue the loop. +2. Commit with `chore: address PR review feedback (#)`. +3. Push and continue the loop. +4. Reply to the review thread referencing the commit SHA. +5. Resolve the thread. When a comment is non-actionable, already addressed, or you disagree: reply briefly explaining why, then resolve the thread. Do not leave