Skip to content

feat(github): submit one review instead of posting comments one at a time - #15

Merged
fiddur merged 2 commits into
developfrom
batched-review
Aug 21, 2026
Merged

feat(github): submit one review instead of posting comments one at a time#15
fiddur merged 2 commits into
developfrom
batched-review

Conversation

@fiddur

@fiddur fiddur commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Slice 3. Pushing looped POST /pulls/:n/comments, one call per comment, which meant:

  • the author got N notifications for one review, and no summary anywhere
  • a failure part-way through left half a review on the pull request
  • threads with replies were silently unpushable — filtered by t.comments.length === 1, surfaced only as a count
  • general comments were dropped entirely

createReview submits POST /pulls/:n/reviews once, with an event, a summary body and every
comment. Comments already on the PR are still filtered first, since GitHub does not deduplicate.

The dialog is now a review composer:

  • checkbox per comment, with select/deselect all. Everything open starts selected — deselecting is the deliberate act, and it is remembered so a thread arriving from the agent while the dialog is open cannot silently re-add itself
  • replies are folded into the one comment GitHub will hold, attributed (**Agent:** …), rather than making the thread unpushable
  • general comments seed the summary, editable, instead of being discarded
  • Approve / Request changes are offered but disabled on your own PR, which GitHub refuses. gh has no viewerDidAuthor field — I tried, it returns Unknown JSON field — so authorship compares the PR author against gh api user, asked once per process

pushComments is removed; nothing called it, and it was the last shell-string gh interpolation
in that file's write path.

Verified on a live instance against NCBackend3#14360 — without submitting anything, since posting
a review is the reviewer's call:

GET  /api/github/details      → PR #14360 | viewerDidAuthor=true | commentCount=7
POST /api/github/create-review {"comments":[],"body":""}
                              → 400 "A review needs a summary or at least one comment"

Mapping is a pure module with tests: side, line range, folded replies, resolved/dismissed and
general-comment exclusion, and summary assembly. 206 tests pass.

Still open, for when configuration lands: a default signature appended to the summary
(push.signature), and replying into an existing GitHub thread, which the reviews API cannot
express — that needs in_reply_to on the comments endpoint.

Stacked on #14.

🤖 Generated with Claude Code

https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs

fiddur and others added 2 commits August 21, 2026 11:28
…time

Pushing looped POST /pulls/:n/comments, so a review arrived as N separate comments and N
notifications, a failure part-way left half a review on the pull request, and there was
nowhere for a summary to live. Threads with replies were silently unpushable, and general
comments were dropped entirely.

createReview submits POST /pulls/:n/reviews once: an event, a summary body, and every
comment. Comments already on the pull request are still filtered first, since GitHub does
not deduplicate.

The dialog now selects what goes out. Everything open starts selected, deselecting is
remembered against later arrivals from the agent, a thread's replies are folded into the
one comment GitHub will hold, and general comments seed the summary rather than being
discarded. Approve and Request changes are offered but disabled on your own pull request,
which GitHub refuses - authorship comes from comparing the PR author with the
authenticated login, as gh has no viewerDidAuthor field.

Removes pushComments, which nothing calls now.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs
@fiddur
fiddur changed the base branch from diff-walkthrough to develop August 21, 2026 13:35
@fiddur
fiddur marked this pull request as ready for review August 21, 2026 13:35
@fiddur
fiddur merged commit 7affe45 into develop Aug 21, 2026
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.

1 participant