feat(iterate-pr): acknowledge top-level feedback with a reaction - #78
Conversation
A top-level review comment has no thread to resolve, so the skill had to dedupe by scanning existing comments for a reference marker citing the same author and snippet. That is fragile, and it failed in practice — on #75 and again on #77 the summary comment kept reporting as unaddressed after it had been answered, leaving a permanent needs_attention to reason about by hand every pass. A hooray reaction on the original is a machine-readable acknowledgement. fetch_pr_feedback now reads reactions.hooray, marks the item acknowledged, and buckets it as resolved, so a re-run reports zero instead of re-surfacing it. Verified on #77: needs_attention went 2 to 0 with no other change. The reaction step is documented against the PR-scoped comments endpoint specifically. The repo-wide repos/{owner}/{repo}/issues/comments returns every comment in the repository, and selecting from it will eventually react on another PR's comment — I did exactly that here and got the right answer by luck. Items now carry comment_id so the id comes from the feedback data rather than from matching body text. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CDv57zHq7abms3RReSQw6q
|
@claude /review |
|
Claude finished @thecodedrift's task in 3m 5s —— View job Review complete
SummaryThe core mechanism is sound: reading I left 3 inline comments with concrete, verifiable issues:
Nothing here blocks the core idea — #1 is the one I'd actually want addressed (or explicitly scoped out of this PR's claims) before merge, since the PR description currently implies full coverage of "top-level comments" including review summaries. |
Review found the raw count trusts anyone: a maintainer reacting 🎉 to a review comment for unrelated reasons would bucket it resolved and drop real feedback silently — the one direction this must never fail in. Now confirmed against the authenticated user, and fails closed: if the viewer cannot be identified or the lookup errors, the item resurfaces. Answering twice beats dropping something. The per-comment reactions lookup is skipped when the count is zero, so the common case costs no extra call. Two more from the same review. The 🎉 dedupe only ever worked for issue comments, but the docs implied it covered review_summary items too — GitHub exposes no reactions endpoint for a review body, so those have no reaction target and keep the reference-marker scan. And the documented lookup query lacked --paginate, which defaults to 30 per page and would silently miss a comment on a later page. Verifying this caught a bug in the fix itself: the viewer lookup used `gh api user --jq .login`, but run_gh json.loads() its stdout and --jq emits a bare unquoted string. It threw, failed closed, and every item resurfaced — correct behavior from a broken lookup, which is the good kind of failure but still wrong. Reads the login off the object now. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CDv57zHq7abms3RReSQw6q
All three findings fixed; each has a reply on its thread. Unscoped reaction count — the important one, and the failure direction was right: anyone's 🎉 would have dropped real feedback silently. Now confirmed against the authenticated user and fails closed, so an unidentifiable viewer resurfaces the item rather than hiding it. Verified three ways: our reaction → true, viewer swapped to another login → false, zero count → false with no API call.
Missing Verifying the scoping fix also caught a bug inside it — — AI Coding Agent |
A top-level review comment has no thread to resolve, so the skill deduped by scanning existing comments for a reference marker citing the same author and snippet. That is fragile, and it failed in practice: on #75 and again on #77 the review summary kept reporting as unaddressed after it had been answered, leaving a permanent
needs_attentionthat had to be reasoned about by hand on every pass — exactly the "I see it but we dealt with it" loop this removes.A 🎉 reaction on the original comment is a machine-readable acknowledgement.
fetch_pr_feedback.pynow readsreactions.hooray, marks the itemacknowledged, and buckets it asresolved, so a re-run reports zero rather than re-surfacing it. GitHub returns the reactions object on comments by default, so this costs no extra API call.Verified on #77:
needs_attentionwent 2 → 0 with no other change.One thing the docs now call out explicitly. The reaction must be posted against the PR-scoped endpoint:
I used the repo-wide form while doing this and took the last match. It happened to be the right comment, but only by luck — with a busier repo it would have reacted on some other PR's review. Items now carry
comment_idso the id comes from the feedback data instead of from matching body text.The inline-thread path is unchanged: those still reply-then-resolve, which was already reliable.