sessions: decouple sessions layer from agent sessions dependencies#306132
Merged
sessions: decouple sessions layer from agent sessions dependencies#306132
Conversation
…sionsManagementService
…lity to private in SessionsManagementService
…ogic in SessionsManagementService
…res and related logic
…ces across session data structures
…e unused method from SessionsManagementService
…gic from SessionsManagementService
…sionTypes and sessionsManagementService
…cross sessions layer Replace direct imports of AgentSessionProviders enum from the workbench agent sessions layer with CopilotCLISessionType/CopilotCloudSessionType constants from the sessions layer's own sessionTypes module. Simplify workspaceFolderManagement to use session workspace data instead of provider-specific branching. Remove fileTreeView component. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…cker - changesTitleBarWidget: use ISessionsManagementService instead of IAgentSessionsService for session lookup and change events - changesView: use sessionManagementService.onDidChangeSessions signal - modePicker: replace AgentSessionProviders with CopilotCLISessionType Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Decouples the vs/sessions layer from the workbench “agent sessions” implementation by moving session-enrichment responsibilities into the adapter/provider layer and having sessions-window features consume ISession data directly (not via agent-sessions services).
Changes:
- Replaced
pullRequestwith richergitHubInfo(owner,repo, optionalpullRequest) across the sessions data model and updated consumers. - Removed several GitHub/repository helper APIs from
ISessionsManagementService, inlining remaining logic at the single call site. - Replaced
AgentSessionProvidersusage invs/sessionswith sessions-layer session type constants/objects and removed thefileTreeViewUI (keeping only the GitHub FS provider registration).
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/contrib/workspace/browser/workspaceFolderManagement.ts | Removes agent-sessions-specific branching and uses session.workspace label when adding the session folder. |
| src/vs/sessions/contrib/terminal/test/browser/sessionsTerminalContribution.test.ts | Updates tests for pullRequest → gitHubInfo. |
| src/vs/sessions/contrib/terminal/browser/sessionsTerminalContribution.ts | Uses sessions-layer session type (CopilotCLISessionType.id) instead of AgentSessionProviders. |
| src/vs/sessions/contrib/sessions/test/browser/sessionsList.test.ts | Updates test session shape for gitHubInfo. |
| src/vs/sessions/contrib/sessions/common/sessionData.ts | Introduces IGitHubInfo and renames pullRequest to gitHubInfo across session/chat interfaces. |
| src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts | Updates rendering logic to use gitHubInfo.pullRequest.icon and sessions-layer session type IDs. |
| src/vs/sessions/contrib/sessions/browser/sessionsManagementService.ts | Removes agent-sessions service dependencies and deletes GitHub/repo helper APIs in favor of direct session data consumption. |
| src/vs/sessions/contrib/sessions/browser/sessionTypes.ts | Replaces AgentSessionProviders enum dependency with sessions-layer string constants and ISessionType objects. |
| src/vs/sessions/contrib/remoteAgentHost/browser/remoteAgentHostSessionsProvider.ts | Updates session adapters to expose gitHubInfo instead of pullRequest. |
| src/vs/sessions/contrib/github/browser/github.contribution.ts | Switches GitHub refresh logic to read session.gitHubInfo directly. |
| src/vs/sessions/contrib/fileTreeView/browser/media/fileTreeView.css | Removes unused CSS for deleted view. |
| src/vs/sessions/contrib/fileTreeView/browser/fileTreeView.ts | Deletes the file tree view implementation. |
| src/vs/sessions/contrib/copilotChatSessions/browser/modePicker.ts | Uses sessions-layer session type ID for resolving custom agent targets. |
| src/vs/sessions/contrib/copilotChatSessions/browser/copilotChatSessionsProvider.ts | Adapter now populates gitHubInfo (owner/repo/PR data) from agent session metadata. |
| src/vs/sessions/contrib/codeReview/test/browser/codeReviewService.test.ts | Removes stubs for deleted ISessionsManagementService APIs. |
| src/vs/sessions/contrib/codeReview/browser/codeReviewService.ts | Reads PR context from session.gitHubInfo and inlines file URI resolution from session.workspace. |
| src/vs/sessions/contrib/codeReview/browser/codeReview.contributions.ts | Updates session-type gating to use sessions-layer cloud session type ID. |
| src/vs/sessions/contrib/chat/test/browser/sessionsConfigurationService.test.ts | Updates tests for pullRequest → gitHubInfo. |
| src/vs/sessions/contrib/chat/browser/chat.contribution.ts | Uses sessions-layer session type IDs for worktree-opening behavior. |
| src/vs/sessions/contrib/changes/browser/fixCIChecksAction.ts | Uses gitHubInfo for PR/CI lookup and request routing. |
| src/vs/sessions/contrib/changes/browser/changesView.ts | Stops listening directly to agent sessions model events and uses sessions management events; PR context now read from gitHubInfo. |
| src/vs/sessions/contrib/changes/browser/changesTitleBarWidget.ts | Re-renders on sessions-management events and reads changes from ISession. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bpasero
previously approved these changes
Mar 29, 2026
bpasero
approved these changes
Mar 29, 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.
Summary
Systematically removes direct dependencies on the workbench agent sessions layer (
src/vs/workbench/contrib/chat/browser/agentSessions/) from the sessions management layer (src/vs/sessions/). After this change, only the adapter files (copilotChatSessionsProvider.ts,copilotChatSessionsActions.ts,remoteAgentHost.contribution.ts) import from agent sessions — everything else uses the sessions layer's own abstractions.What Changed
Data Model Enrichment
IGitHubInfo— new interface onISessionreplacing bothISessionPullRequestandIGitHubSessionContext, withowner,repo, and optionalpullRequestsub-object (number,uri,icon)pullRequest→gitHubInfoacrossISessionData,IChat,ISessionCopilotChatSessionsProvideradapter now populatesgitHubInfowith full owner/repo/PR data extracted from agent session metadataAPI Removals from
ISessionsManagementServicegetGitHubContext/getGitHubContextForSession— consumers now readsession.gitHubInfodirectlyresolveSessionFileUri— inlined at the single consumer (codeReviewService.ts) usingsession.workspacegetSessionRepositoryUri/getRepositoryFromMetadata— removed (no longer needed)Dependency Cleanup
IAgentSessionsServiceremoved fromsessionsManagementService.tsconstructor entirelyAgentSessionProvidersenum replaced with string literal constants (COPILOT_CLI_SESSION_TYPE,COPILOT_CLOUD_SESSION_TYPE) insessionTypes.tsisAgentSession()type guard replaced with status checks (session.status.get() !== SessionStatus.Untitled)AgentSessionProvidersusage fromchat.contribution.ts,codeReview.contributions.ts,sessionsList.ts,sessionsTerminalContribution.ts,workspaceFolderManagement.ts,modePicker.ts,changesTitleBarWidget.ts,changesView.tsOther
fileTreeView.ts(no longer needed)AgentSessionApprovalModelkept as a reusable utility