Skip to content

github: attribute callers and prioritize shared requests - #348379

Draft
Dmitriy Vasyura (dmitrivMS) wants to merge 4 commits into
mainfrom
dev/dmitriv/github-caller-priorities
Draft

Dmitriy Vasyura (dmitrivMS) wants to merge 4 commits into
mainfrom
dev/dmitriv/github-caller-priorities

Conversation

@dmitrivMS

@dmitrivMS Dmitriy Vasyura (dmitrivMS) commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Related https://github.com/microsoft/vscode-internalbacklog/issues/9678

  • Supply stable caller attribution for shared GitHub requests and preserve caller-provided request options.
  • Use contextual priorities for passive metadata, automatic plugin updates, and mutation reconciliation. Preserve interactive and mutation defaults, including user-blocking marketplace refreshes, and keep native Git behavior unchanged.
  • Update the request guidance and existing test expectations.

Preserve request attribution and scheduling intent across session, connector, and plugin consumers. Keep interactive and mutation defaults while assigning passive reads and post-write reconciliation their appropriate priorities.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dmitrivMS Dmitriy Vasyura (dmitrivMS) added the network Network related issues label Nov 15, 2026
Copilot AI balanced review requested due to automatic review settings November 15, 2026 04:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain that require changes before approval.

No open issues 🎉

What changed in this PR

This follow-up to #347307 and #348276 adds stable caller attribution and contextual scheduling across VS Code’s shared GitHub clients.

Changes:

  • Add feature-specific caller identifiers while preserving caller-provided request options.
  • Prioritize passive metadata, automatic plugin updates, visible hydration, and post-mutation refreshes appropriately, without changing native Git behavior.
  • Document request defaults and update existing test expectations without adding test cases.

No actionable findings remain. The author reports fixture-based validation; live GitHub and Code OSS scenarios were not rerun.

File Description
src/​vs/​workbench/​contrib/​sessions/​test/​browser/​github/​githubModels.test.ts Update post-mutation refresh priority expectations.
src/​vs/​workbench/​contrib/​sessions/​test/​browser/​github/​githubFetchers.test.ts Assert caller attribution in fetcher requests.
src/​vs/​workbench/​contrib/​sessions/​providers/​copilotChatSessions/​test/​browser/​githubCloudAutomationStore.test.ts Assert automation callers and passive lookup priorities.
src/​vs/​workbench/​contrib/​sessions/​providers/​copilotChatSessions/​browser/​githubCloudAutomationStore.ts Attribute automation requests and background workspace checks.
src/​vs/​workbench/​contrib/​sessions/​browser/​github/​models/​githubPullRequestReviewThreadsModel.ts Prioritize refreshes after comment and resolution mutations.
src/​vs/​workbench/​contrib/​sessions/​browser/​github/​models/​githubPullRequestCIModel.ts Prioritize reconciliation after rerunning failed jobs.
src/​vs/​workbench/​contrib/​sessions/​browser/​github/​githubService.ts Attribute shared Sessions GitHub requests.
src/​vs/​workbench/​contrib/​sessions/​browser/​github/​fetchers/​githubRepositoryFetcher.ts Attribute repository discovery requests.
src/​vs/​workbench/​contrib/​sessions/​browser/​github/​fetchers/​githubRecentUserWorkFetcher.ts Add caller fallbacks while retaining request options.
src/​vs/​workbench/​contrib/​sessions/​browser/​github/​fetchers/​githubPullRequestsFetcher.ts Attribute pull-request listing and search requests.
src/​vs/​workbench/​contrib/​sessions/​browser/​github/​fetchers/​githubPullRequestContextFetcher.ts Attribute pull-request context requests.
src/​vs/​workbench/​contrib/​sessions/​browser/​github/​fetchers/​githubPRFetcher.ts Attribute pull-request reads and writes, preserving options.
src/​vs/​workbench/​contrib/​sessions/​browser/​github/​fetchers/​githubPRCIFetcher.ts Attribute check, annotation, and rerun requests.
src/​vs/​workbench/​contrib/​sessions/​browser/​github/​fetchers/​githubIssueFetcher.ts Add an issue-request caller fallback.
src/​vs/​workbench/​contrib/​sessions/​browser/​github/​fetchers/​githubChangesFetcher.ts Attribute commit-comparison requests.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​remoteAgentHost/​cloudSandboxApiService.test.ts Assert background session-feed connection metadata.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​plugins/​pluginInstallService.test.ts Assert priority propagation during automatic updates.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​plugins/​agentPluginRepositoryService.test.ts Assert default priority for stale repository refreshes.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​aiCustomization/​copilotConnectorsService.test.ts Assert connector mutation reconciliation priorities.
src/​vs/​workbench/​contrib/​chat/​common/​plugins/​pluginMarketplaceService.ts Forward priority to repository fallback requests.
src/​vs/​workbench/​contrib/​chat/​common/​plugins/​pluginGitService.ts Extend Git service contracts with optional request priorities.
src/​vs/​workbench/​contrib/​chat/​common/​plugins/​agentPluginRepositoryService.ts Add priority to repository operation options.
src/​vs/​workbench/​contrib/​chat/​browser/​remoteAgentHost/​cloudSandboxApiService.ts Background feed connections and rely on interactive defaults.
src/​vs/​workbench/​contrib/​chat/​browser/​pluginSources.ts Propagate priorities through plugin source operations.
src/​vs/​workbench/​contrib/​chat/​browser/​pluginInstallService.ts Background automatic plugin update requests.
src/​vs/​workbench/​contrib/​chat/​browser/​pluginGitCommandService.ts Forward priorities through GitHub-backed Git operations.
src/​vs/​workbench/​contrib/​chat/​browser/​githubRepoFetcher.ts Apply priorities to tree and blob downloads.
src/​vs/​workbench/​contrib/​chat/​browser/​aiCustomization/​copilotConnectorsService.ts Prioritize catalog reads that reconcile connector mutations.
src/​vs/​workbench/​contrib/​chat/​browser/​agentPluginRepositoryService.ts Carry priorities through repository clone and pull operations.
src/​vs/​workbench/​api/​test/​browser/​mainThreadGitHub.test.ts Assert contextual extension-request priorities.
src/​vs/​workbench/​api/​browser/​mainThreadGitHub.ts Assign passive and enrichment priorities to metadata requests.
src/​vs/​sessions/​contrib/​codeReview/​test/​browser/​codeReviewService.test.ts Assert review-comment reconciliation request options.
src/​vs/​sessions/​contrib/​codeReview/​browser/​codeReviewService.ts Prioritize thread refreshes after posting review comments.
src/​vs/​platform/​github/​test/​node/​githubQueryService.test.ts Assert visible hydration priority and caller attribution.
src/​vs/​platform/​github/​README.md Document caller attribution and scheduling defaults.
src/​vs/​platform/​github/​common/​pullRequestMutationService.ts Remove redundant interactive priority from log reads.
src/​vs/​platform/​github/​common/​githubQueryServiceImpl.ts Use visible priority for resource hydration.
src/​vs/​platform/​github/​common/​githubCredentialService.ts Rely on default priority for account validation.
src/​vs/​platform/​agentHost/​node/​devContainerAgentHostService.ts Attribute development-container sample requests.

Review effort: Balanced

Align the existing commit, file, and branch lookup assertions with the shared service's caller metadata.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Priority-handling and backpressure defects can delay or reject user-blocking operations and fail concurrent marketplace clones, while overlapping forced refreshes can repeat pagination.

No open issues 🎉

8 previously missed issues

In code that hasn't changed since last review

Medium severity Preserve subscription priority and promotion during hydration

src/​vs/​platform/​github/​common/​githubQueryServiceImpl.ts:328

Hydration cancels each resource's scheduled fetch, but hard-coding visible replaces even an interactive subscription's request with lower-priority work. Because the batch is not tracked as entry.operation, interactive interest added while it is queued cannot promote it either. Derive the batch priority from its subscriptions and track the shared request so later interest can raise it.

Medium severity Promote serialized clone and update work for waiting foreground loads

src/​vs/​workbench/​contrib/​chat/​browser/​agentPluginRepositoryService.ts:175

A foreground marketplace load for the same repository must wait for an automatic background clone or refresh to finish because _cloneSequencer serializes them. Its interactive options never reach the transport in time to promote that work, so the user-blocking load remains behind passive requests. Make the running operation honor the highest waiting priority while retaining serialized cache writes; the same issue affects _updateSequencer in src/vs/workbench/contrib/chat/browser/pluginInstallService.ts:439.

Medium severity Bound concurrent blob requests to avoid clone overload

src/​vs/​workbench/​contrib/​chat/​browser/​githubRepoFetcher.ts:99

With six uncached GitHub URL marketplaces downloading concurrently, the per-repository limits can retain 60 pluginGit.blob requests before any completes. Background requests have only 56 retained slots per caller, so this newly forwarded priority can reject a clone with overloaded and omit its marketplace. Bound blob requests across repositories or handle admission backpressure without treating it as a clone failure.

Medium severity Keep initial session discovery at mutation priority

src/​vs/​workbench/​contrib/​chat/​browser/​remoteAgentHost/​cloudSandboxApiService.ts:456

The initial session discovery awaits feed.start() before listing sessions, including during a manual refresh. Making its negotiation background work can delay or reject that user-blocking refresh despite reserved capacity for mutations. Keep the initial negotiation's mutation default; use background priority only for independent reconnects.

Medium severity Avoid duplicate reconciliation scans during overlapping refreshes

src/​vs/​workbench/​contrib/​sessions/​browser/​github/​models/​githubPullRequestReviewThreadsModel.ts:136

When a reply or thread resolution overlaps a lower-priority refresh, refresh(true, …) can start an upgraded scan and then another forced scan, repeating pagination before the action completes. Make refresh() wait for the existing promise and then run one fresh reconciliation scan; simply dropping the final scan is unsafe because transport coalescing can reuse a pre-mutation response. Same issue in src/vs/workbench/contrib/sessions/browser/github/models/githubPullRequestCIModel.ts:294; src/vs/sessions/contrib/codeReview/browser/codeReviewService.ts:355 uses the affected thread model.

Medium severity Keep repository selection checks at interactive priority

src/​vs/​workbench/​contrib/​sessions/​providers/​copilotChatSessions/​browser/​githubCloudAutomationStore.ts:116

These eligibility checks also block repository selection and the mobile automation picker, rather than serving only passive refreshes. At background priority they can be delayed or rejected despite reserved interactive capacity, and a failure is cached as a disabled target. Keep the interactive default here and update the associated test expectation.

Low severity Verify background priority on all clone requests

src/​vs/​workbench/​contrib/​chat/​browser/​pluginGitCommandService.ts:63

The existing browser Git tests only exercise omitted priority, while the new automatic-update tests stop at repository-service mocks. Add a background clone case in src/vs/workbench/contrib/chat/test/browser/pluginGitCommandService.test.ts that checks the priority on ref, tree, and every blob request, retaining the default-priority case.

Low severity Test forwarding of all fetcher metadata options

src/​vs/​workbench/​contrib/​sessions/​test/​browser/​github/​githubFetchers.test.ts:150

The updated fetcher tests only supply a priority, so they would still pass if helpers overwrote an explicit caller or dropped deadline and cache metadata. Add a case supplying caller, priority, deadline, and noCache, and verify they survive both the pull-request lookup and thread-summary request while retaining fallback coverage.

Review effort: Max

Restore user-blocking reads and feed negotiation to their prior priority defaults. Avoid redundant forced reconciliation scans and defer plugin priority propagation until shared promotion and backpressure are supported.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Queue-priority handling can delay post-write reconciliation and reject branch-protection reads without retry, leaving protection data stale and potentially skipping protected-branch commit warnings.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

Medium severity Branch protection reads can be rejected under queue load

src/​vs/​workbench/​api/​browser/​mainThreadGitHub.ts:181

These branch-protection reads can now be rejected at the queue's reserved-capacity threshold, even while interactive reads would still be admitted. GitHubBranchProtectionProvider only logs that failure and does not retry, so opening a repository under load can leave protection data empty or stale and skip the protected-branch commit warning. Keep both reads at their default interactive priority, or retry transient queue overloads; the ruleset read at line 186 has the same issue.

Review effort: Max

refresh(force = false, options?: ApiRequestOptions): Promise<void> {
if (force && this._refreshPromise) {
return this.refresh(false, options).then(() => this.refresh(true, options));
return this._refreshPromise.then(() => this.refresh(true, options));
Remove background overrides from repository viewer-info and ruleset reads so branch protection retains interactive admission and scheduling defaults.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dmitrivMS

Copy link
Copy Markdown
Collaborator Author

Addressed the branch-protection finding in the "previously missed" section of this review in 1d3c0785511. Both repository viewer-info and ruleset reads now use the default interactive priority, while caller attribution and avatar enrichment are preserved. Existing bridge tests pass in Electron (15) and Chromium (14), and targeted lint passes.

The separate forced-refresh/reconciliation thread is unchanged.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

network Network related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants