Agents - refactor GitHub models#313891
Merged
Merged
Conversation
Member
lszomoru
commented
May 2, 2026
- Use ReferenceCollections for each model kind
- Centralize refresh and polling into one workbench contribution
Contributor
blocks-ci screenshots changedReplace the contents of Updated blocks-ci-screenshots.md<!-- auto-generated by CI — do not edit manually -->
#### editor/codeEditor/CodeEditor/Dark

#### editor/codeEditor/CodeEditor/Light

#### editor/inlineChatZoneWidget/InlineChatZoneWidget/Dark

#### editor/inlineChatZoneWidget/InlineChatZoneWidget/Light

#### editor/inlineChatZoneWidget/InlineChatZoneWidgetTerminated/Dark

#### editor/inlineChatZoneWidget/InlineChatZoneWidgetTerminated/Light
 |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the sessions-window GitHub integration to move model ownership from ad-hoc caches to reference-counted collections, and to centralize active-session refresh/polling logic in a single workbench contribution. It fits into the vs/sessions layer by consolidating how PR, CI, and review-thread data are shared across the Agents experience.
Changes:
- Replaced direct GitHub model getters with reference-returning APIs backed by per-model
ReferenceCollections. - Added active-session observables in
GitHubServiceand moved CI/review-thread refresh + polling intoGitHubPullRequestPollingContribution. - Updated dependent services/tests to consume model references or active-session observables instead of direct cached models.
Show a summary per file
| File | Description |
|---|---|
src/vs/sessions/contrib/github/test/browser/githubService.test.ts |
Updates service tests from direct cached models to reference-based acquisition/disposal behavior. |
src/vs/sessions/contrib/github/test/browser/githubModels.test.ts |
Adjusts CI model tests to exercise reference collection behavior. |
src/vs/sessions/contrib/github/test/browser/githubContribution.test.ts |
Updates polling contribution tests/mocks for the new service API. |
src/vs/sessions/contrib/github/browser/models/githubRepositoryModel.ts |
Adds a reference collection wrapper for repository models. |
src/vs/sessions/contrib/github/browser/models/githubPullRequestReviewThreadsModel.ts |
Adds a reference collection wrapper for PR review-thread models. |
src/vs/sessions/contrib/github/browser/models/githubPullRequestModel.ts |
Adds a reference collection wrapper and changes PR polling bookkeeping to disposable-based tracking. |
src/vs/sessions/contrib/github/browser/models/githubPullRequestCIModel.ts |
Adds a reference collection wrapper and includes PR number in CI model state/logging. |
src/vs/sessions/contrib/github/browser/githubService.ts |
Reworks the GitHub service around references plus active-session derived observables. |
src/vs/sessions/contrib/github/browser/github.contribution.ts |
Centralizes active-session PR/CI/review-thread refresh and polling behavior. |
src/vs/sessions/contrib/copilotChatSessions/browser/copilotChatSessionsProvider.ts |
Switches live PR icon computation to use a model reference. |
src/vs/sessions/contrib/codeReview/test/browser/codeReviewService.test.ts |
Updates code review tests for the new active-session review-thread flow. |
src/vs/sessions/contrib/codeReview/browser/codeReviewService.ts |
Refactors PR review state consumption to read from the GitHub service’s active-session review-thread observable. |
src/vs/sessions/contrib/changes/browser/checksViewModel.ts |
Switches checks view model to consume the active-session CI observable. |
src/vs/sessions/contrib/changes/browser/checksActions.ts |
Switches failed-check actions/context to consume the active-session CI observable. |
Copilot's findings
- Files reviewed: 14/14 changed files
- Comments generated: 4
roblourens
approved these changes
May 2, 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.