Skip to content

[Bug]: PR watching stops when the token cannot read a requested reviewer #19549

Open

Description

@hhharryyyyy

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server / GitHub pull request watching

Steps to reproduce

  1. Use a GitHub App credential that can read a private organization PR, but receives FORBIDDEN for one of its requested reviewers.
  2. Configure the T3 server to use that credential and start watching the PR.
  3. The detailed PR read includes reviewRequests.nodes.requestedReviewer. GitHub returns usable partial PR data plus the field-level error below.
  4. T3 treats the entire read as failed. After eight consecutive read failures, it stops watching the PR.

With the same credential and PR, a minimal query for PR identity/head succeeds. Adding this selection reproduces the permission error:

reviewRequests(first: 10) {
  nodes {
    requestedReviewer {
      __typename
      ... on User { login }
      ... on Team { slug }
    }
  }
}

Expected behavior

An unreadable requested reviewer should not prevent watching otherwise accessible PR information. T3 could show that reviewer metadata is unavailable and continue monitoring readable checks, comments/reviews, and conflicts.

A possible implementation is to isolate the optional reviewer lookup, or retry without it only when the GraphQL error is FORBIDDEN at the reviewRequests.nodes.*.requestedReviewer path. Other authentication/authorization failures should remain failures, and unreadable or missing CI information must not be interpreted as passing.

Actual behavior

Optional reviewer metadata makes the detailed PR read fail, eventually disabling the watcher even though other PR data is accessible. Refreshing the credential with the same permissions does not resolve this field-level denial.

Source inspection: gitHubPullRequestJson.ts includes reviewer metadata in the core PR query, and GitHubApi.ts classifies a GraphQL response containing these errors as failed despite partial data being present.

Impact

Major degradation: affected PRs cannot remain watched without changing credential permissions, even when the denied field is only reviewer metadata.

Version or commit

  • Watcher failure observed on 0.0.46-nightly.20261014.3080.
  • The field-level GitHub API denial was reproduced again after installing 0.0.46-nightly.20261014.3118; the same query/error-handling pattern is present in that release's source. I have not rerun a full watcher failure cycle on .3118.

Environment

Linux remote T3 server with macOS client; private organization repository; GitHub App credential. Repository, reviewer, and credential details omitted because they are private.

Logs or stack traces

Sanitized GitHub GraphQL error (the response also contains partial data):

{
  "type": "FORBIDDEN",
  "path": [
    "repository",
    "pullRequest",
    "reviewRequests",
    "nodes",
    0,
    "requestedReviewer"
  ],
  "extensions": {
    "saml_failure": false,
    "ip_allow_list_failure": false
  },
  "message": "Resource not accessible by integration"
}

Workaround

No reliable in-app workaround found. We have left the affected watcher stopped. We have not established which additional GitHub permission would expose this reviewer, and would prefer that optional metadata not require broader access.

Related work

Activity

  1. juliusmarminge commented on Oct 14, 2026

    @juliusmarminge
    Member

    Note

    Grok responding on behalf of Julius.

    This is a bug, and I confirmed it in code on main. In GitHubApi.ts, any GraphQL errors list that isn't entirely NOT_FOUND becomes Answer.Failed, and the partial data is thrown away. The detail query in gitHubPullRequestJson.ts reads reviewRequests.nodes.requestedReviewer in the same document as checks, comments and mergeability. So a single forbidden reviewer, which is optional display metadata, fails the whole read. Eight failures in a row then stop the watch.

    Workaround: a requested Team is normally only visible to a GitHub App that has Organization → Members: Read. Granting that should make the error go away. We'd still rather not require it.

    Fix direction: open PR #16171 already retries the detail read when every error is FORBIDDEN (for checks). Extending it to a FORBIDDEN error at reviewRequests.nodes.*.requestedReviewer, and retrying without reviewer requests, would cover this. Other auth failures should still fail, and missing checks must never read as passing. #19375 (requested teams) adds team fields but doesn't change how errors are handled.

  2. added
    acceptedfeature request accepted
    bugSomething is broken or behaving incorrectly.
    via-triageFiled through npx t3 triage
    on Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedfeature request acceptedbugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions