sessions: Open state file for active peer chat - #332820
Merged
roblourens merged 5 commits intoAug 27, 2026
Merged
Conversation
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>
(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> # Conflicts: # src/vs/platform/agentHost/node/agentService.ts
Contributor
There was a problem hiding this comment.
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
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
marked this pull request as ready for review
August 26, 2026 23:15
roblourens
enabled auto-merge (squash)
August 26, 2026 23:16
Anthony Kim (anthonykim1)
approved these changes
Aug 27, 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
InitializeResult._metafrom agent-host-protocol #420Testing
npm run transpile-clientnpm run typecheck-client(Written by Copilot)