Repository navigation
perf(github): load PR conversations without duplicate REST requests - #34747
Conversation
Walkthrough
Priority: Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
96ca1bc4-1fdc-48f5-bb79-d8233b0ae2dc
Files selected for processing: 3-
src/main/github/client-pr-conversation-requests.test.tssrc/main/github/client/fetch/get-pr-comments.tssrc/main/github/client/fetch/pr-conversation-response.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
-
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Minor · Use submittedAt for GraphQL review summaries. · pr-conversation-response.ts:63-83
src/main/github/client/fetch/pr-conversation-response.ts:63-83
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winUse
submittedAtfor GraphQL review summaries.GitHub defines
PullRequestReview.createdAtas creation time andsubmittedAtas submission time. When a draft review is submitted later, the current GraphQL path sorts it and displays its relative time using the draft creation time. The REST paths already usesubmitted_at.Suggested fix
const commentSchema = z.object({ id: z.string(), databaseId: z.number().nullable(), author: z .object({ __typename: z.string().optional(), login: z.string(), avatarUrl: z.string() }) .nullable(), body: z.string().nullish(), createdAt: z.string(), + submittedAt: z.string().nullish(), url: z.string(), reactionGroups: z @@ - createdAt: comment.createdAt, + createdAt: comment.submittedAt ?? comment.createdAt,body createdAt + submittedAt url

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
d2a78862-95a7-471d-b139-a178d9b69c9c
Files selected for processing: 2-
src/main/github/client-pr-conversation-requests.test.tssrc/main/github/client/fetch/pr-conversation-response.ts
Files skipped from review as they are similar to previous changes: 2-
- src/main/github/client-pr-conversation-requests.test.ts
- src/main/github/client/fetch/pr-conversation-response.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
-
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Minor · Include admissionTier in the coalescing key. · get-pr-comments.ts:155-164
src/main/github/client/fetch/get-pr-comments.ts:155-164
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winInclude
admissionTierin the coalescing key.When two non-forced callers use different
localGitOptions.admissionTiervalues, the current key is identical. The second caller can therefore reuse the first caller’s in-flight promise and run with the first caller’s GitHub execution options.Suggested fix
const key = JSON.stringify([ repoPath, prNumber, options?.prRepo ?? null, connectionId ?? null, + localGitOptions.admissionTier ?? null, githubReadExecutionScope(localGitOptions) ])

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
afe22e77-7b19-475d-9ef7-3cff91a027f9
Files selected for processing: 4-
src/main/github/client-pr-conversation-requests.test.tssrc/main/github/client/fetch/get-pr-comments.tssrc/main/github/client/fetch/pr-conversation-response.tssrc/main/github/client/fetch/pr-review-threads-query.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
-
ELI5
Opening a PR conversation currently asks GitHub three times for information already present in one response. Use that response directly: a complete conversation now costs one GraphQL request and zero REST requests, with the same refresh timing.
What Changed
ghexits nonzero, and retain successful sources when another fails.Why
The existing GraphQL response already contains these sources. Reading it once saves quota and subprocesses at the same refresh cadence, while source-specific fallbacks preserve the conversation when only one API source fails.
Linked Issue
Follow-up to #28778; independently mergeable.
Visual Proof
N/A — no UI or interaction changes; the same conversation data is loaded through fewer API calls.
Testing
pnpm check:changed --maxWorkers=2: all 20 checks passed (895 affected test files recorded without failures). The gate started before the nullable-ID, quota-error, and timestamp follow-ups. Those follow-ups passed the final 19 focused tests and the latest CI aggregate gate, all five unit-test shards, relay integration, and Linux/Windows packaging. Automated review passed. Only JavaScript/TypeScript CodeQL analysis remains running; no checks are failing.Agent skill upstream boundary
Review
Self-reviewed response validation, per-source recovery, quota independence, and concurrent-read isolation. No provider-neutral or GitLab behavior changes.
Notes
The existing API contract serves desktop, mobile, remote repositories, and folder workspaces; no platform-specific subprocess or RPC changes.
Checklist