fix(github): teams with access show in the reviewer picker #31150
main fromrefs/pull/31150/head·opened View on GitHubNote
🤖 Written by Claude Opus 5.5 on behalf of Illia
Problem#
On GitHub, the pull request reviewer picker can't find a team. Typing a team name such as frontend shows "Nobody with access matches that.", so a team can only be asked for a review on GitHub itself. The picker lists assignableUsers (people only), plus teams already requested on the pull request, so those requests can be taken back.
Change#
listReviewerCandidates (GitHub)
ReviewerCandidates # people + already requested reviewers
+ ReviewerTeams # organization teams, in parallel
+ keep teams whose repositories include owner/name
+ on any failure: no teams, people still listed
merge: requested → teams → people
ReviewerTeamsreadsorganization(login: owner).teams. It needsread:org, and a GraphQL query GitHub refuses fails whole. That's why teams were left out ofReviewerCandidates. They stay in their own query and are dropped on failure (a token withoutread:org, or a repository owned by a user).- GitHub refuses a review request to a team without access to the repository, so each team's
repositories(query: name)is checked for the exactowner/name. The REST list of a repository's teams needs admin (it returns 404 withrepo+read:orgas a non-admin), so it can't be used here. - An already requested team is listed once. More than 100 teams sets the existing
truncatedflag. - No client or contract change: web and mobile already render
kind: "team"candidates, and requests already sendteam_reviewers.
Scope and approval#
A small, focused fix for an obvious bug, with no prior issue. The capability is half there already: the candidate contract has kind: "team", both pickers render team rows, the request payload sends team_reviewers, and the mobile picker says "Search people and teams with access to this repository." But the GitHub adapter never returns a team that hasn't been requested yet, so none of this can be reached. This PR changes only the GitHub reviewer candidate read. GitLab, Forgejo and Bitbucket are unchanged. #19375 made teams that were already requested show up. #22489 (open) adds host search for people and doesn't touch teams.
Verification#
| Before | After |
|---|---|
![]() | ![]() |
- Manual check: local dev server against a real organization pull request. Typing
frontendlists thefrontendteam, tagged "team". A live query on that organization returned 11 teams. The 9 with access to the repository are offered; the 2 without access aren't. GitHubPullRequestApi.test.ts: teams with access appear between the requested reviewers and the people, and anINSUFFICIENT_SCOPESrefusal of the teams query still returns the people. Both fail onmain.gitHubPullRequestJson.test.ts: the access filter is case-insensitive and drops a loosequerymatch (acme/web-legacy), a requested team appears once, and a teams next page setstruncated.vp run check:changed: format, lint, knip, GraphQL codegen check, typecheck and tests pass.- Not checked: sending a team review request from the picker. It uses the existing
team_reviewerspath, and I didn't want to ping a real team.
Done with Claude Opus 5.5 in Claude Code, run through T3 Code.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
tanstack-source added labelsbug
t3dotgg(GitHub profile, opens in a new tab) closed this
Started a new one: https://github.com/pingdotgg/t3code/pull/35126
Sign in to join this conversation.


Note
🤖 Claude Opus 5.5 responding on behalf of Theo
Closing. This PR conflicts with
mainin 4 files, which is more than we will review as a rebase. If the change still matters, open a fresh PR from currentmain.