Skip to content

Decouple remote agent host session type from resource URI scheme#309642

Merged
roblourens merged 1 commit intomainfrom
roblou/decouple-session-type-from-scheme
Apr 13, 2026
Merged

Decouple remote agent host session type from resource URI scheme#309642
roblourens merged 1 commit intomainfrom
roblou/decouple-session-type-from-scheme

Conversation

@roblourens
Copy link
Copy Markdown
Member

Decouple ISession.sessionType from the resource URI scheme in RemoteAgentHostSessionsProvider so that remote copilot sessions share the platform copilotcli session 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_PROVIDER constant with an explicit WELL_KNOWN_AGENT_SESSION_TYPES map that maps agent host provider names (e.g. copilot) to local platform session types (e.g. copilotcli). Includes wellKnownSessionType() and wellKnownAgentProvider() helpers for forward/reverse lookups.

  • Model picker extraction: Extract the remote agent host model picker action, contribution, and helper into a dedicated remoteAgentHostModelPicker.ts file. Consolidate side-effect imports into remoteAgentHost.contribution.ts to reduce import sprawl in sessions.desktop.main.ts.

  • Copilot model picker cleanup: Remove the remote agent host guard from the copilot model picker when clause 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.md documentation with a structured IDs and URI schemes section.

(Written by Copilot)

…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)
Copilot AI review requested due to automatic review settings April 13, 2026 21:57
@github-actions
Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 8eb2168b Current: c69d80fa

Changed (1)

editor/inlineCompletions/other/JumpToHint/Dark
Before After
before after

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.sessionType from the remote session resource URI scheme for Copilot (logical type becomes copilotcli; 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

@roblourens roblourens merged commit 5e91606 into main Apr 13, 2026
30 checks passed
@roblourens roblourens deleted the roblou/decouple-session-type-from-scheme branch April 13, 2026 22:31
@vs-code-engineering vs-code-engineering bot added this to the 1.117.0 milestone Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants