feat(github): submit one review instead of posting comments one at a time - #15
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Slice 3. Pushing looped
POST /pulls/:n/comments, one call per comment, which meant:t.comments.length === 1, surfaced only as a countcreateReviewsubmitsPOST /pulls/:n/reviewsonce, with an event, a summary body and everycomment. Comments already on the PR are still filtered first, since GitHub does not deduplicate.
The dialog is now a review composer:
**Agent:** …), rather than making the thread unpushableghhas noviewerDidAuthorfield — I tried, it returnsUnknown JSON field— so authorship compares the PR author againstgh api user, asked once per processpushCommentsis removed; nothing called it, and it was the last shell-stringghinterpolationin 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:
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 cannotexpress — that needs
in_reply_toon the comments endpoint.Stacked on #14.
🤖 Generated with Claude Code
https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs