feat(github-picker): include org and collaborator repos in the repo list - #73
Open
duncsdownunder wants to merge 1 commit into
Open
duncsdownunder wants to merge 1 commit into
duncsdownunder wants to merge 1 commit into
Conversation
gh repo list only returns repos the authenticated user owns, so the New Agent modal's "Pick from GitHub" mode hid organization repos entirely. List via the REST /user/repos endpoint instead, with affiliation=owner,collaborator,organization_member (paginated, sorted by updated). Falls back to the old owner-only gh repo list when gh api --slurp is unavailable (gh too old), and keeps the existing degrade-to-unauthenticated behavior on total failure. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Problem
The New Agent modal's "Pick from GitHub" mode (issue #48) lists repos via
gh repo list, which only returns repos the authenticated user owns. Anyone whose work lives in an organization sees only their personal repos — org repos can't be picked at all (hit this today trying to point an agent at a private org repo).Fix
List via the REST
/user/reposendpoint instead:REPO_LIST_LIMITafter flattening pages.GitHubRepoListItemshape, so the tRPC contract and UI are untouched.--slurpneeds a reasonably recentgh; on failure we fall back to the previous owner-onlygh repo listbehavior rather than losing the picker, and total failure still degrades to{ repos: [], authenticated: false }as before.Verified against a real account with org membership: org repos now appear (19 repos vs. owner-only before).
tsc --noEmitclean on server-core.🤖 Generated with Claude Code