Skip to content

sessions: Open state file for active peer chat - #332820

Merged
roblourens merged 5 commits into
microsoft:mainfrom
roblourens:roblou/agents/open-peer-chat-state-file
Aug 27, 2026
Merged

sessions: Open state file for active peer chat#332820
roblourens merged 5 commits into
microsoft:mainfrom
roblourens:roblou/agents/open-peer-chat-state-file

Conversation

@roblourens

@roblourens roblourens commented Aug 26, 2026

Copy link
Copy Markdown
Member

Summary

  • sync InitializeResult._meta from agent-host-protocol #420
  • advertise chat-targeted state-file support as a typed VS Code host capability
  • resolve the active Sessions peer chat to its host-owned backend chat resource
  • gate chat-targeted requests on the advertised capability while retaining one extension method
  • fail closed when a peer chat has not hydrated instead of opening the default chat state
  • preserve default-chat fallback behavior and validate chat/session ownership

Testing

  • npm run transpile-client
  • focused unit tests for the Sessions action, protocol client/server, and Copilot provider (552 passing)
  • npm run typecheck-client
  • protocol sync idempotence
  • pre-commit hygiene checks

(Written by Copilot)

Route the active peer chat's backend resource through Agent Host state-file lookup so each chat opens its own persisted event stream. Preserve the existing default-chat fallback and validate chat/session ownership at the protocol boundary.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 26, 2026 21:30
(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

# Conflicts:
#	src/vs/platform/agentHost/node/agentService.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Enables opening the provider-owned state file for the active peer chat in the Agents Window.

Changes:

  • Resolves active chats to host-owned backend resources.
  • Propagates optional chat targets through Agent Host APIs and validates ownership.
  • Resolves Copilot SDK conversation state files and extends tests.
Show a summary per file
File Description
src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.ts Forwards chat targets remotely.
src/vs/workbench/contrib/chat/browser/actions/openAgentHostStateFileAction.ts Accepts chat-specific state-file requests.
src/vs/sessions/contrib/providers/agentHost/test/browser/openAgentHostStateFile.test.ts Tests peer-chat action routing.
src/vs/sessions/contrib/providers/agentHost/browser/openAgentHostStateFileAction.ts Resolves the active backend chat.
src/vs/platform/agentHost/test/node/protocolServerHandler.test.ts Tests protocol forwarding.
src/vs/platform/agentHost/test/node/copilotAgent.test.ts Tests default and peer state files.
src/vs/platform/agentHost/test/electron-browser/agentHostProtocolClient.test.ts Tests serialized chat targets.
src/vs/platform/agentHost/node/protocolServerHandler.ts Validates chat ownership.
src/vs/platform/agentHost/node/copilot/copilotAgent.ts Selects the chat’s SDK conversation.
src/vs/platform/agentHost/node/agentService.ts Forwards chat targets to providers.
src/vs/platform/agentHost/node/agentHostManagementService.ts Extends management forwarding.
src/vs/platform/agentHost/electron-browser/localAgentHostService.ts Extends local-client forwarding.
src/vs/platform/agentHost/common/agentService.ts Updates service contracts.
src/vs/platform/agentHost/common/agentHostExtensionProtocol.ts Adds the optional protocol field.
src/vs/platform/agentHost/common/agent.ts Extends the provider API.
src/vs/platform/agentHost/browser/agentHostProtocolClient.ts Sends chat targets over the protocol.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 16/16 changed files
  • Comments generated: 3
  • Review effort level: Balanced

Comment thread src/vs/platform/agentHost/node/copilot/copilotAgent.ts Outdated
Comment thread src/vs/platform/agentHost/browser/agentHostProtocolClient.ts Outdated
Fail closed when a peer chat has not hydrated, preserve default-chat fallback behavior, and use a distinct extension method so older remote hosts cannot silently open the wrong state file.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sync InitializeResult extension metadata from agent-host-protocol and advertise chat-targeted state-file support through a typed VS Code metadata capability. Use the capability to keep one extension method while failing closed against hosts that do not support chat targets.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Carry the narrowed extension initialize-result type through the protocol client and server, and read the capability through the lint-approved metadata reader pattern without disabling repository rules.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@roblourens
roblourens marked this pull request as ready for review August 26, 2026 23:15
@roblourens
roblourens enabled auto-merge (squash) August 26, 2026 23:16
@roblourens
roblourens merged commit a3c9dc6 into microsoft:main Aug 27, 2026
44 of 45 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.136.0 milestone Aug 27, 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