Skip to content

Add Agent Host session configuration flow#309240

Draft
roblourens wants to merge 13 commits intomainfrom
roblou/agent-host-session-config
Draft

Add Agent Host session configuration flow#309240
roblourens wants to merge 13 commits intomainfrom
roblou/agent-host-session-config

Conversation

@roblourens
Copy link
Copy Markdown
Member

Adds Agent Host session configuration support for new session creation, including protocol plumbing, dynamic schema-driven pickers in the Agents window, config forwarding into Agent Host session creation, and Copilot worktree/branch setup based on resolved config.

Validation run:

  • VS Code - Build
  • Focused Agent Host/unit tests
  • Agent Host server startup integration test
  • Hygiene on touched files

(Written by Copilot)

Copilot AI review requested due to automatic review settings April 12, 2026 01:35
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 12, 2026

Screenshot Changes

Base: 10366b69 Current: ecf508ae

Changed (1)

agentSessionsViewer/ApprovalRowLongLabel/Dark
Before After
before after

@roblourens roblourens force-pushed the roblou/agent-host-session-config branch from a8b52bf to 8d5f0f3 Compare April 12, 2026 01:39
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

Adds an Agent Host–driven “session configuration” flow for new session creation, wiring protocol support through the agent host server/client layers and surfacing schema-driven pickers in the Agents (sessions) window. Also forwards the resolved config into session creation and uses it (for Copilot) to drive worktree/branch setup.

Changes:

  • Add AHP protocol + service APIs for resolveSessionConfig and sessionConfigCompletions, and persist resolved config into session state.
  • Introduce dynamic, schema-driven session config pickers in the Sessions (Agents) UI and forward config through chat request → session handler → agent host createSession.
  • Add Copilot git integration via a new IAgentHostGitService, including branch completions and optional worktree creation/cleanup based on resolved config.
Show a summary per file
File Description
src/vs/workbench/contrib/terminal/test/browser/agentHostPty.test.ts Updates mock agent connection to satisfy new config-resolution APIs.
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts Adds coverage ensuring request config is forwarded into agent host createSession.
src/vs/workbench/contrib/chat/common/participants/chatAgents.ts Extends IChatAgentRequest with agentHostSessionConfig.
src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts Plumbs agentHostSessionConfig from send options into requests.
src/vs/workbench/contrib/chat/common/chatService/chatService.ts Extends IChatSendRequestOptions with agentHostSessionConfig.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/loggingAgentConnection.ts Adds logging wrappers for the new config commands.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts Forwards request config to agent host session creation.
src/vs/sessions/sessions.common.main.ts Registers the new session-config picker contribution in the Sessions app.
src/vs/sessions/services/sessions/common/sessionsProvider.ts Adds optional provider hooks/events for dynamic “new session” config state.
src/vs/sessions/services/sessions/browser/sessionsManagementService.ts Clears abandoned new-session config when switching away from an untitled session.
src/vs/sessions/contrib/remoteAgentHost/browser/remoteAgentHostSessionsProvider.ts Implements dynamic config state for remote agent host new sessions and forwards config on send.
src/vs/sessions/contrib/localAgentHost/browser/localAgentHostSessionsProvider.ts Implements dynamic config state for local agent host new sessions and forwards config on send.
src/vs/sessions/contrib/chat/browser/newChatViewPane.ts Disables send while config is unresolved; listens for provider config changes.
src/vs/sessions/contrib/chat/browser/media/agentHostSessionConfigPicker.css Styles container for the new config picker UI.
src/vs/sessions/contrib/chat/browser/agentHostSessionConfigPicker.ts Adds schema-driven config pickers (static enum + dynamic completions).
src/vs/platform/agentHost/test/node/protocolServerHandler.test.ts Updates mock agent service with new config-resolution APIs.
src/vs/platform/agentHost/test/node/protocol/testHelpers.ts Allows starting test server without --quiet (for server startup test).
src/vs/platform/agentHost/test/node/protocol/sessionConfig.integrationTest.ts New integration tests for config resolve/completions and state persistence.
src/vs/platform/agentHost/test/node/protocol/agentHostServer.integrationTest.ts New integration test verifying server boots with production services.
src/vs/platform/agentHost/test/node/mockAgent.ts Adds scripted mock support for config resolve/completions.
src/vs/platform/agentHost/test/node/copilotGitProject.test.ts Refactors tests to use IAgentHostGitService instead of spawning git.
src/vs/platform/agentHost/test/node/agentService.test.ts Adds test that session creation stores resolved config into live state.
src/vs/platform/agentHost/node/protocolServerHandler.ts Adds JSON-RPC handlers for config resolve/completions and forwards config to createSession.
src/vs/platform/agentHost/node/copilot/copilotGitProject.ts Switches git project detection to IAgentHostGitService.
src/vs/platform/agentHost/node/copilot/copilotAgent.ts Implements config schema + branch completions and worktree creation/cleanup.
src/vs/platform/agentHost/node/agentService.ts Persists resolved config into session state; exposes config APIs on the service.
src/vs/platform/agentHost/node/agentHostServerMain.ts Registers IAgentHostGitService for server mode.
src/vs/platform/agentHost/node/agentHostMain.ts Registers IAgentHostGitService for utility-process mode.
src/vs/platform/agentHost/node/agentHostGitService.ts New git service providing repo/branch/worktree operations via git CLI.
src/vs/platform/agentHost/electron-browser/remoteAgentHostProtocolClient.ts Adds client calls for config resolve/completions; forwards config into createSession.
src/vs/platform/agentHost/electron-browser/agentHostService.ts Adds IPC proxy methods for config resolve/completions.
src/vs/platform/agentHost/common/state/sessionState.ts Re-exports new session config types (currently with a duplication bug).
src/vs/platform/agentHost/common/state/protocol/version/registry.ts Marks session/configChanged action as introduced in v1.
src/vs/platform/agentHost/common/state/protocol/state.ts Adds config?: ISessionConfigState to session state and defines config schema types.
src/vs/platform/agentHost/common/state/protocol/reducers.ts Reducer merges session/configChanged values into session config state.
src/vs/platform/agentHost/common/state/protocol/messages.ts Adds command map entries for resolveSessionConfig and sessionConfigCompletions.
src/vs/platform/agentHost/common/state/protocol/commands.ts Adds protocol params/results for config resolve/completions and createSession.config.
src/vs/platform/agentHost/common/state/protocol/actions.ts Adds SessionConfigChanged action type and interface.
src/vs/platform/agentHost/common/state/protocol/action-origin.generated.ts Updates generated action-origin metadata for new action.
src/vs/platform/agentHost/common/state/protocol/.ahp-version Updates pinned AHP protocol revision.
src/vs/platform/agentHost/common/agentService.ts Extends agent service interfaces with config APIs and createSession.config.

Copilot's findings

  • Files reviewed: 41/41 changed files
  • Comments generated: 4

@roblourens roblourens force-pushed the roblou/agent-host-session-config branch 2 times, most recently from 4564f56 to 0779100 Compare April 12, 2026 01:51
roblourens and others added 6 commits April 12, 2026 10:51
…sion-types

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
… into roblou/agent-host-session-config

# Conflicts:
#	src/vs/sessions/contrib/localAgentHost/browser/localAgentHostSessionsProvider.ts
#	src/vs/sessions/contrib/remoteAgentHost/browser/remoteAgentHostSessionsProvider.ts
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

Adds end-to-end “session configuration” support for Agent Host-backed sessions, wiring new protocol commands through to the Agents window UI so users can pick schema-driven configuration before creating a session (and forwarding the resolved config into session creation, including Copilot worktree/branch setup).

Changes:

  • Introduces Agent Host Protocol commands for resolving session config schema (resolveSessionConfig) and dynamic value completions (sessionConfigCompletions), and plumbs them through client/server implementations.
  • Adds dynamic session type discovery (from host rootState.agents) for local + remote Agent Host providers, including runtime session type updates.
  • Adds a Sessions window UI contribution that renders schema-driven config pickers and forwards resolved config into chat/session creation.
Show a summary per file
File Description
src/vs/workbench/contrib/terminal/test/browser/agentHostPty.test.ts Updates mock agent connection to implement new session-config protocol methods.
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts Extends request plumbing/tests to include agentHostSessionConfig forwarded into session creation.
src/vs/workbench/contrib/chat/common/participants/chatAgents.ts Adds agentHostSessionConfig to IChatAgentRequest.
src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts Propagates agentHostSessionConfig from send options into requests.
src/vs/workbench/contrib/chat/common/chatService/chatService.ts Adds agentHostSessionConfig to IChatSendRequestOptions.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/loggingAgentConnection.ts Adds logging wrappers for rootState + new session-config RPCs.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts Forwards agentHostSessionConfig into Agent Host createSession calls.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.ts Fixes model provider registration order so initial change events are observed.
src/vs/sessions/sessions.common.main.ts Registers new Sessions-window UI contribution for session config picker.
src/vs/sessions/SESSIONS_PROVIDER.md Updates documentation for remote agent host provider identity + dynamic agent discovery.
src/vs/sessions/services/sessions/common/sessionsProvider.ts Extends provider interface with optional dynamic session types + dynamic session-config APIs.
src/vs/sessions/services/sessions/browser/sessionsManagementService.ts Reacts to dynamic session type changes and clears draft session config when leaving untitled sessions.
src/vs/sessions/contrib/remoteAgentHost/test/common/remoteAgentHostSessionType.test.ts Adds tests pinning remote session type id wire format.
src/vs/sessions/contrib/remoteAgentHost/test/browser/remoteAgentHostSessionsProvider.test.ts Updates/expands tests for dynamic agent discovery and session type behavior.
src/vs/sessions/contrib/remoteAgentHost/common/remoteAgentHostSessionType.ts Adds helper to generate remote agent host session type IDs.
src/vs/sessions/contrib/remoteAgentHost/browser/remoteAgentHostSessionsProvider.ts Implements dynamic session types from rootState.agents and dynamic new-session config resolution/completions.
src/vs/sessions/contrib/remoteAgentHost/browser/remoteAgentHost.contribution.ts Registers agents dynamically (no longer Copilot-only) and uses unified session type id helper.
src/vs/sessions/contrib/localAgentHost/test/browser/localAgentHostSessionsProvider.test.ts Updates/expands tests for dynamic session types + session type switching behavior.
src/vs/sessions/contrib/localAgentHost/browser/localAgentHostSessionsProvider.ts Implements dynamic session types from rootState.agents plus dynamic new-session config resolution/completions.
src/vs/sessions/contrib/localAgentHost/browser/localAgentHost.contribution.ts Updates working directory resolver registration to track dynamic session types.
src/vs/sessions/contrib/chat/browser/sessionTypePicker.ts Refreshes session type picker when providers’ session types change at runtime.
src/vs/sessions/contrib/chat/browser/newChatViewPane.ts Disables send when session config is not “ready” and watches providers for config changes.
src/vs/sessions/contrib/chat/browser/media/agentHostSessionConfigPicker.css Adds styling for session config picker container.
src/vs/sessions/contrib/chat/browser/agentHostSessionConfigPicker.ts Adds schema-driven config picker UI contribution (enum + dynamic completions).
src/vs/platform/agentHost/test/node/protocolServerHandler.test.ts Updates protocol handler tests to include new session-config RPCs.
src/vs/platform/agentHost/test/node/protocol/testHelpers.ts Extends server start helper to optionally disable --quiet.
src/vs/platform/agentHost/test/node/protocol/sessionConfig.integrationTest.ts Adds integration tests for session config RPCs + session state persistence/merge behavior.
src/vs/platform/agentHost/test/node/protocol/agentHostServer.integrationTest.ts Adds integration test validating server starts with production agent services registered.
src/vs/platform/agentHost/test/node/mockAgent.ts Extends mock agents to implement session config resolution + completions for tests.
src/vs/platform/agentHost/test/node/copilotGitProject.test.ts Refactors git project resolution tests to use a git service abstraction (no real git exec).
src/vs/platform/agentHost/test/node/agentService.test.ts Adds test ensuring created sessions persist resolved config in session state.
src/vs/platform/agentHost/node/protocolServerHandler.ts Plumbs new RPCs and forwards config into createSession.
src/vs/platform/agentHost/node/copilot/copilotGitProject.ts Replaces direct git exec with IAgentHostGitService abstraction.
src/vs/platform/agentHost/node/copilot/copilotAgent.ts Implements session config schema resolution + branch completions; adds worktree creation/cleanup based on resolved config.
src/vs/platform/agentHost/node/agentService.ts Persists resolved session config into protocol session state; exposes resolve/completions APIs.
src/vs/platform/agentHost/node/agentHostServerMain.ts Registers AgentHostGitService so CopilotAgent can query git state/create worktrees.
src/vs/platform/agentHost/node/agentHostMain.ts Registers AgentHostGitService in utility process entrypoint.
src/vs/platform/agentHost/node/agentHostGitService.ts Introduces git service abstraction for querying branches/worktrees and managing worktrees.
src/vs/platform/agentHost/electron-browser/remoteAgentHostProtocolClient.ts Adds client RPCs for session config resolution + completions; forwards config on createSession.
src/vs/platform/agentHost/electron-browser/agentHostService.ts Extends IPC proxy surface with resolve/completions methods.
src/vs/platform/agentHost/common/state/sessionState.ts Re-exports ISessionConfigState.
src/vs/platform/agentHost/common/state/protocol/version/registry.ts Marks SessionConfigChanged action as introduced in protocol v1.
src/vs/platform/agentHost/common/state/protocol/state.ts Adds session config schema/value types and attaches config to session state.
src/vs/platform/agentHost/common/state/protocol/reducers.ts Adds reducer handling for session/configChanged.
src/vs/platform/agentHost/common/state/protocol/messages.ts Adds new RPCs to the command map.
src/vs/platform/agentHost/common/state/protocol/commands.ts Adds createSession config param + defines resolve/completions command contracts.
src/vs/platform/agentHost/common/state/protocol/actions.ts Adds SessionConfigChanged action shape to protocol actions union.
src/vs/platform/agentHost/common/state/protocol/action-origin.generated.ts Updates generated action unions/dispatchability for session config changes.
src/vs/platform/agentHost/common/state/protocol/.ahp-version Updates vendored AHP protocol version hash.
src/vs/platform/agentHost/common/agentService.ts Extends common agent APIs to include session config resolution/completions + createSession config.

Copilot's findings

  • Files reviewed: 50/50 changed files
  • Comments generated: 2

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.

2 participants