Agents - adopting etags for additional REST API calls#312893
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Agents window’s GitHub integration to use ETag-aware REST responses (request2) for more calls, enabling conditional requests and reducing unnecessary payloads when data hasn’t changed.
Changes:
- Switch repository and CI check-run fetchers/models to use
request2and carry ETags through refresh cycles. - Update PR comment posting and check-run annotation fetching to use
request2response shapes. - Adjust browser tests/mocks to assert against
{ data, statusCode, etag }responses.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/contrib/github/test/browser/githubModels.test.ts | Updates mock fetcher signatures to match ETag-aware response shape. |
| src/vs/sessions/contrib/github/test/browser/githubFetchers.test.ts | Updates assertions for the new { data, statusCode } fetcher return values. |
| src/vs/sessions/contrib/github/browser/models/githubRepositoryModel.ts | Caches repository ETag and performs conditional refreshes. |
| src/vs/sessions/contrib/github/browser/models/githubPullRequestCIModel.ts | Caches checks ETag and performs conditional refreshes for check runs. |
| src/vs/sessions/contrib/github/browser/fetchers/githubRepositoryFetcher.ts | Moves repository REST call to request2 and returns IGitHubApiResponse. |
| src/vs/sessions/contrib/github/browser/fetchers/githubPRFetcher.ts | Uses request2 for posting PR/issue comments and validates presence of response data. |
| src/vs/sessions/contrib/github/browser/fetchers/githubPRCIFetcher.ts | Uses request2 for check runs, reruns, and annotations fetching (ETag-enabled for check runs). |
| src/vs/sessions/contrib/github/browser/fetchers/githubChangesFetcher.ts | Switches compare API call to request2 and maps response data to changed files. |
Copilot's findings
Comments suppressed due to low confidence (1)
src/vs/sessions/contrib/github/browser/fetchers/githubPRFetcher.ts:245
- Same as above for issue comments:
request2()can returndata: undefinedfor204/304without throwing, so the thrown error should includeresponse.statusCodeto aid debugging and to distinguish server behavior changes from client mapping failures.
const data = response.data;
if (!data) {
throw new Error(`Failed to post issue comment to ${owner}/${repo}#${prNumber}`);
}
- Files reviewed: 8/8 changed files
- Comments generated: 2
Yoyokrazy
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.