Decouple remote agent host session type from resource URI scheme#309642
Merged
roblourens merged 1 commit intomainfrom Apr 13, 2026
Merged
Decouple remote agent host session type from resource URI scheme#309642roblourens merged 1 commit intomainfrom
roblourens merged 1 commit intomainfrom
Conversation
…HostSessionsProvider - Remote copilot agents now use COPILOT_CLI_SESSION_TYPE as their logical session type, aligning with local and cloud copilot sessions, while keeping the unique per-connection ID as the resource URI scheme and language model vendor. - Extract model picker into remoteAgentHostModelPicker.ts and consolidate side-effect imports into remoteAgentHost.contribution.ts. - Replace DEFAULT_AGENT_PROVIDER with explicit WELL_KNOWN_AGENT_SESSION_TYPES mapping from agent host provider names to local session types. - Update tests and documentation. (Written by Copilot)
Contributor
joshspicer
approved these changes
Apr 13, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Sessions window’s remote agent host integration so that remote Copilot sessions use the platform logical session type (COPILOT_CLI_SESSION_TYPE / copilotcli) while keeping routing identifiers (resource URI scheme + LM vendor) as a unique per-connection value. This aligns remote Copilot behavior with local/cloud Copilot sessions without breaking per-host isolation for routing and model registration.
Changes:
- Decouple
ISession.sessionTypefrom the remote session resource URI scheme for Copilot (logical type becomescopilotcli; routing stays per-connection). - Introduce a dedicated remote agent host model picker that filters models by
session.resource.scheme(per-connection vendor). - Consolidate side-effect registrations and update tests/docs to reflect the new identifier split.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/sessions.desktop.main.ts | Removes direct side-effect import of remote agent host actions (now owned by the remote agent host contribution). |
| src/vs/sessions/contrib/remoteAgentHost/test/common/remoteAgentHostSessionType.test.ts | Updates “wire format” commentary to reflect that routing now uses resource.scheme rather than sessionType. |
| src/vs/sessions/contrib/remoteAgentHost/test/browser/remoteAgentHostSessionsProvider.test.ts | Updates assertions so remote Copilot sessions report sessionType === copilotcli while preserving per-connection schemes elsewhere. |
| src/vs/sessions/contrib/remoteAgentHost/common/remoteAgentHostSessionType.ts | Reframes the helper as producing a per-connection identifier used for routing/vendor, not necessarily the logical session type for Copilot. |
| src/vs/sessions/contrib/remoteAgentHost/browser/remoteAgentHostSessionsProvider.ts | Implements logical session type mapping (Copilot → copilotcli) while keeping resource.scheme and model IDs keyed to the per-connection scheme. |
| src/vs/sessions/contrib/remoteAgentHost/browser/remoteAgentHostModelPicker.ts | Adds a remote agent host-specific model picker that filters models by session.resource.scheme. |
| src/vs/sessions/contrib/remoteAgentHost/browser/remoteAgentHost.contribution.ts | Centralizes remote agent host side-effect imports (actions + new model picker). |
| src/vs/sessions/contrib/remoteAgentHost/REMOTE_AGENT_HOST_SESSIONS_PROVIDER.md | Documents the new split between sessionType, resource.scheme, and LM vendor, including examples. |
| src/vs/sessions/contrib/copilotChatSessions/browser/copilotChatSessionsActions.ts | Removes remote agent host sessions from the Copilot model picker when clause (remote now has its own picker). |
Copilot's findings
- Files reviewed: 9/9 changed files
- Comments generated: 0
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.
Decouple
ISession.sessionTypefrom the resource URI scheme inRemoteAgentHostSessionsProviderso that remote copilot sessions share the platformcopilotclisession type with local and cloud sessions.Changes
Session type decoupling: Remote copilot agents now use
COPILOT_CLI_SESSION_TYPE(copilotcli) as their logical session type, while the unique per-connection ID remains the resource URI scheme and language model vendor. This lets remote copilot sessions participate in the same platform behaviors as local/cloud copilot sessions.Well-known agent mapping: Replace the confusingly-named
DEFAULT_AGENT_PROVIDERconstant with an explicitWELL_KNOWN_AGENT_SESSION_TYPESmap that maps agent host provider names (e.g.copilot) to local platform session types (e.g.copilotcli). IncludeswellKnownSessionType()andwellKnownAgentProvider()helpers for forward/reverse lookups.Model picker extraction: Extract the remote agent host model picker action, contribution, and helper into a dedicated
remoteAgentHostModelPicker.tsfile. Consolidate side-effect imports intoremoteAgentHost.contribution.tsto reduce import sprawl insessions.desktop.main.ts.Copilot model picker cleanup: Remove the remote agent host guard from the copilot model picker
whenclause since remote copilot sessions now have their own dedicated model picker.Tests & docs: Update test assertions for the new session type values and refresh the
REMOTE_AGENT_HOST_SESSIONS_PROVIDER.mddocumentation with a structured IDs and URI schemes section.(Written by Copilot)