t3code icon indicating copy to clipboard operation
t3code copied to clipboard

Pull Requests page fails to load when GitHub's GraphQL search endpoint returns transient 502/504 — no retry and no fallback from a failed search leg

Open yeaen opened this issue 1 month ago • 0 comments

What happened

The Pull Requests dashboard rarely loads in T3 Code Nightly. On 2026-11-04 around 10:15 AM local (15:15 UTC), every PR list/search request to GitHub returned HTTP 502/504 after about 11 seconds. Six page refreshes within 20 seconds all failed, each taking ~21-22 s (an 11 s search leg plus an 11 s per-repo list leg, both refused). In the same window, every other GitHub operation (detail, summary, activity, stack, checks) succeeded normally in under ~2.5 s.

Diagnosis

GitHub's GraphQL search endpoint intermittently returns 502/504 for the PullRequestSearch document (first:100, each row requesting latestReviews(first:20), reviewRequests(first:20), labels(first:20), commits(last:1){statusCheckRollup}). Two things in T3 Code turn that blip into a full page failure:

  1. No retry for transient 5xx. In packages/source-control-github/src/server/gitHubGraphQlClient.ts, refused maps 502/504 straight to Failed -> GitHubApiResponseError. The request policy's retry logic only covers rate limits and app-to-personal credential fallback.
  2. No fallback from a failed search leg. In GitHubPullRequestApi.listPullRequests (commit 47f2c8d2, ~line 1843), the repository-listing fallback (read(false)) runs only when search succeeds with zero rows. A failed search propagates immediately, so the cheaper repository.pullRequests listing is never tried when only the search endpoint is erroring.

Rerunning the exact same PullRequestSearch query via gh api graphql minutes later answered in <1 s, and GitHub's status page reported all systems operational — so this is an intermittent GitHub search-endpoint failure, not local auth, network, or quota (rate limit remaining was 4991/5000 at the time).

Steps to reproduce

Intermittent — requires GitHub's search endpoint to be erroring:

  1. Open the Pull Requests page in T3 Code Nightly with GitHub projects.
  2. When it fails, each attempt takes ~21 s; the trace shows both the searchPullRequests and listPullRequests GraphQL calls refused with 502/504 after ~11 s each.
  3. Confirm it is GitHub-side: run the same PullRequestSearch document (first:100, stats:true) via gh api graphql — it succeeds in <1 s seconds later.

Version

0.1.7-nightly.20261102.4080 (Desktop and local server, commit 47f2c8d2)

Environment

macOS (Darwin 25.6.0, arm64), Node v24.22.1, T3 Code Desktop (Nightly) with its local server

Evidence

# 2026-11-04 15:15:13-15:15:33 UTC — every list/search call refused; other ops fine (server.trace.ndjson, repo name redacted)
15:15:13 searchPullRequests  502  10687ms
15:15:17 searchPullRequests  504  11171ms
15:15:20 searchPullRequests  502  10570ms   # x2 concurrent
15:15:22 searchPullRequests  502  10675ms   # x2 concurrent
15:15:24 listPullRequests   502  10558ms
15:15:29 listPullRequests   502  11035ms
15:15:31 listPullRequests   502  10827ms    # +1 more concurrent
15:15:32 listPullRequests   504  11162ms    # +3 more concurrent, all 502
15:15:34 getPullRequestSummary 200  1019ms  # other ops OK before and after

# ws.rpc.pullRequests.list x6 (15:15:13/17/20/20/22/22),!267-22212ms each
# Same day totals: list/search 14/14 failed 502/504; all other GitHub ops succeeded

Related issues

#19363 — same pullRequests.list query fan-out, but GraphQL quota exhaustion, not 502/504. #27821 — PRs page error banner, but from an offline environment via relay. #16010 — no retry on transient 502, but for model providers. None cover GitHub search 502/504.

Fix applied or workaround

None. The page loads again once GitHub's search endpoint recovers; no local configuration changes the behavior.

Filed by

pi (GLM-5.3) via t3 triage

yeaen avatar Nov 04 '26 15:11 yeaen