Repository navigation
feat: include pull request review reaction counts - #3812
Daiyuanranfeng wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Both review methods undercount per-emoji reactions and total_count because ReactionGroup.users excludes bots and mannequins; querying reactors.totalCount would include them.
1 open issue
What changed in this PR
Adds opt-in reaction summaries to pull_request_read for reviews and review-thread comments, addressing #3780 with the compact format already used for issue comments.
Changes:
- Adds
include_reactions, defaulting to false, while preserving exported signatures and pagination. - Fetches review counts after lockdown filtering and comment counts within the existing thread query.
- Updates client-session tests, the tool schema snapshot, and generated documentation.
| File | Description |
|---|---|
| README.md | Documents the optional reaction-count flag. |
| pkg/github/typed_consolidated_pull_request_outputs_test.go | Tests reaction counts, empty results, and default outputs. |
| pkg/github/pullrequests.go | Fetches and summarizes opt-in reactions. |
| pkg/github/pullrequests_test.go | Updates expected GraphQL variables. |
| pkg/github/minimal_types.go | Adds reaction summaries to review and comment outputs. |
| pkg/github/consolidated_pull_request_types.go | Adds and validates the boolean input. |
| pkg/github/__toolsnaps__/pull_request_read.snap | Records the updated input and output schemas. |
Review effort: Balanced (auto)
| Content githubv4.ReactionContent | ||
| Users struct { | ||
| TotalCount githubv4.Int | ||
| } `graphql:"users(first: 1)"` |
There was a problem hiding this comment.
Thanks for catching this. The shared reaction-group query now uses reactors.totalCount, aliased to users so the existing Go field and output remain unchanged. This applies to both review comments and reviews.
The MCP client-session tests now assert that both query paths request reactors, in addition to checking the per-emoji and total counts. Those assertions failed against the previous query and pass after the change.
Validation: Go 1.27.3 on Windows; focused regression tests, script/lint, script/test (full race suite), and script/generate-docs. Documentation regeneration produces no additional changes.
There was a problem hiding this comment.
ReactionGroup.usersexcludes non-user reactors such as bots and mannequins, so both review methods undercount per-emoji reactions andtotal_countwhen those actors react. Queryreactors.totalCountinstead. Aliasingreactorstouserspreserves the existing Go field and response fixtures.
There was a problem hiding this comment.
Thanks for checking this. This was addressed in 8c8dfb3: the query now uses users: reactors(first: 1) { totalCount }, preserving the existing response shape while counting bots and mannequins too. Regression assertions cover the generated queries for both review methods. Could you please review the latest commit?

Summary
Add opt-in reaction summaries to
pull_request_readfor PR reviews and review-thread comments. Counts use the same compactreactionsshape as issue comments.Why
Fixes #3780. Callers can inspect feedback such as thumbs-up acknowledgements without reading individual reaction users.
What changed
include_reactions(default false) forget_reviewsandget_review_comments.MCP impact
Prompts tested (tool changes only)
MCP client-session tests call
pull_request_readwith both methods andinclude_reactions: true. They validate JSON text and structured content, counts, empty results, and the default output.Security / limits
Tool renaming
Lint & tests
script/lint(golangci-lint 2.14.0, zero issues).script/test(go test -race ./...).go test ./...also passed. UI typecheck and build passed on Node 26.13.0.Docs