Skip to content

Skip GitHub owner scopes the access token may not search - #63

Merged
Philipp0205 merged 1 commit into
mainfrom
cursor/skip-unsearchable-github-scopes-924b
Sep 7, 2026
Merged

Philipp0205 merged 1 commit into
mainfrom
cursor/skip-unsearchable-github-scopes-924b

Conversation

@Philipp0205

Copy link
Copy Markdown
Owner

Listing pull requests across every accessible repository searches one owner scope at a time, but a single rejected scope aborted the whole listing. GitHub answers GET /search/issues with HTTP 422 "The listed users and repositories cannot be searched" as soon as one qualifier names something the token may not search, which happens for organizations the token was never SSO-authorized for, for private repositories when the token lacks the 'repo' scope, and for repositories renamed or deleted after they were listed. The connection test then reported "FAILED Read pull requests" even though every other scope would have returned results.

Run the per-scope searches through GitHubPullRequestSearch, which skips a scope GitHub refuses and only fails when no scope is searchable at all, in which case the message names the scopes and how to fix the token. Failures that are not scope rejections still propagate, so a server or network error is never mistaken for partial results. Organizations and collaborator repositories that cannot be listed no longer hide the user's own pull requests either, and the connection test reports the skipped scopes as a warning.

Listing pull requests across every accessible repository searches one
owner scope at a time, but a single rejected scope aborted the whole
listing. GitHub answers GET /search/issues with HTTP 422 "The listed
users and repositories cannot be searched" as soon as one qualifier
names something the token may not search, which happens for
organizations the token was never SSO-authorized for, for private
repositories when the token lacks the 'repo' scope, and for
repositories renamed or deleted after they were listed. The connection
test then reported "FAILED Read pull requests" even though every other
scope would have returned results.

Run the per-scope searches through GitHubPullRequestSearch, which skips
a scope GitHub refuses and only fails when no scope is searchable at
all, in which case the message names the scopes and how to fix the
token. Failures that are not scope rejections still propagate, so a
server or network error is never mistaken for partial results.
Organizations and collaborator repositories that cannot be listed no
longer hide the user's own pull requests either, and the connection
test reports the skipped scopes as a warning.

Co-authored-by: Kurrle, Philipp <philipp.kurrle+ADVNTST@advantest.com>
@Philipp0205
Philipp0205 merged commit bfebd0b into main Sep 7, 2026
3 checks passed
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