Skip to content

Agents - use etag when polling pull request information#312819

Merged
lszomoru merged 2 commits intomainfrom
lszomoru/weird-giraffe
Apr 27, 2026
Merged

Agents - use etag when polling pull request information#312819
lszomoru merged 2 commits intomainfrom
lszomoru/weird-giraffe

Conversation

@lszomoru
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 27, 2026 16:15
@lszomoru lszomoru enabled auto-merge (squash) April 27, 2026 16:15
@lszomoru lszomoru self-assigned this Apr 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds ETag-aware polling to the Agents GitHub integration so periodic refreshes of pull request data can leverage conditional requests (304 Not Modified) and reduce unnecessary rate-limit usage.

Changes:

  • Introduce an ETag/statusCode-carrying response shape for GitHub REST requests and add an ETag-capable request path.
  • Update the PR fetcher to use conditional requests and return wrapped responses (data + statusCode + etag).
  • Update the PR model to persist ETags across polls and only update observables/mergeability when data changes.
Show a summary per file
File Description
src/vs/sessions/contrib/github/test/browser/githubFetchers.test.ts Adjusts fetcher tests/mocks for the new response wrapper shape.
src/vs/sessions/contrib/github/browser/models/githubPullRequestModel.ts Stores ETags and uses them during polling; updates mergeability computation to account for 304 responses.
src/vs/sessions/contrib/github/browser/githubApiClient.ts Adds IGitHubApiResponse and an ETag-capable request variant that surfaces status code + ETag.
src/vs/sessions/contrib/github/browser/fetchers/githubPRFetcher.ts Switches PR/reviews fetches to ETag-aware requests and returns wrapped responses with mapped data.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 4

Comment thread src/vs/sessions/contrib/github/browser/fetchers/githubPRFetcher.ts
Comment thread src/vs/sessions/contrib/github/test/browser/githubFetchers.test.ts
Comment thread src/vs/sessions/contrib/github/browser/githubApiClient.ts
Comment thread src/vs/sessions/contrib/github/browser/githubApiClient.ts
@lszomoru lszomoru merged commit bdc7090 into main Apr 27, 2026
39 of 41 checks passed
@lszomoru lszomoru deleted the lszomoru/weird-giraffe branch April 27, 2026 19:22
@vs-code-engineering vs-code-engineering Bot added this to the 1.119.0 milestone Apr 27, 2026
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.

3 participants