Repository navigation
agentHost: open #chat chips on the connection that owns the chat - #341313
Merged
Sandeep Somavarapu (sandy081) merged 1 commit intoOct 13, 2026
Merged
Conversation
The chat chip resolved the owning session across the local and remote hosts but dropped which host it found it on, so its `agent-host-session://` link was unqualified: provider-scheme owners opened as local sessions and a native session id shared by two hosts could open on the wrong one. The owner lookup now returns the owning connection's authority (`local` for the local host, the remote's agent host authority otherwise) and `buildOpenSessionLinkForChat` takes a required connection authority that it writes into the link. Host-built links (attachment links, plan rich links) and the session-context reference pass `undefined`: they link the host's own sessions. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Identical default-chat URIs on local and remote hosts still resolve to the local host because ownership lookup is local-first.
1 open finding
What changed in this PR
Routes #chat chips through the Agent Host connection that owns the referenced chat.
Changes:
- Adds connection authority to chat-owner resolution and open-session links.
- Updates host and Sessions callers.
- Adds local/remote collision regression tests.
| File | Description |
|---|---|
chatReferenceAttachment.test.ts |
Tests owner resolution and chip routing. |
chatAttachmentWidgets.ts |
Passes owner authority into links. |
agentHostChatOwner.ts |
Returns the owning connection authority. |
localAgentHostSessionsProvider.test.ts |
Updates helper calls. |
baseAgentHostSessionsProvider.ts |
Keeps host-consumed references unqualified. |
openSessionLinkOpener.test.ts |
Tests Agents-window routing. |
openSessionLink.test.ts |
Tests authority-qualified links. |
markdownPlanRichLinksContribution.ts |
Updates host link creation. |
agentSideEffects.ts |
Updates attachment link creation. |
openSessionLink.ts |
Adds authority to chat-link construction. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Aiday Marlen Kyzy (aiday-mar)
approved these changes
Oct 13, 2026
Sandeep Somavarapu (sandy081)
deleted the
agents/chat-chip-connection-authority
branch
October 13, 2026 16:09
Don Jayamanne (DonJayamanne)
added a commit
that referenced
this pull request
Oct 13, 2026
…xploration-vscode * origin/main: (40 commits) MSRC fixes (#341342) chat: render input attachments for the input model's session (#341350) chat: center subagent tool activity hooks (#341258) Manage Copilot plugin marketplaces through Agent Host (#341301) fix: linux setuid sandbox helper permissions (#341292) agentHost: resolve #chat chips on the host of the chat that shows them (#341332) [Perf] agentHost: limit archived sessions over Mission Control (#341327) Remember expanded state for "Other Models" in model picker (#341335) Offer Stop for copilot detached background shells (#341310) agentHost: allow inherited peer chats to move workspaces (#341317) [Perf] agentHost: reduce Mission Control relay overhead (#341223) Fix Customizations modal spacing (#341144) Fix dependency cycle in QuickInputService and EditorResolverService (#341321) Fix Explorer refresh on restoring deleted workspace root folder (#341323) chat: Share and rate-limit core utility model requests (#340100) agentHost: open #chat chips on the connection that owns the chat (#341313) Fix flaky StorageMainService tests by awaiting storage warm-up (#341305) agentHost: record the default chat role instead of reading the default chat URI shape (#341293) welcome: preserve tab icon color with Modern Icons Fix flaky test in diskFileSystemProvider.test.ts (#341304) ... # Conflicts: # src/vs/platform/agentHost/node/agentService.ts # src/vs/platform/agentHost/node/protocolServerHandler.ts # src/vs/platform/agentHost/test/node/protocolServerHandler.test.ts # src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts
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.

Goal
A
#chatchip now opens the referenced chat on the agent host that owns it. Before this change, the chip'sagent-host-session://link had no connection authority:This was raised in a review of #341191 and tracked as a follow-up.
Changes
resolveAgentHostChatOwnerreturns the authority of the connection where it found the owner. The field is required.agentHostAuthority(address).AMBIENT_AGENT_HOST_AUTHORITY(local), the same value the chat copy actions already use.undefined.buildOpenSessionLinkForChat(owner, chat, defaultChat, connectionAuthority)takes the authority as a required parameter and passes it tobuildOpenSessionLinkUri.undefined:get_session_contexttool reads.connectionAuthority:Behavior notes
connectionAuthority=local) now resolves through the session registry, listing the local host's sessions on a miss, instead of buildingagent-host-<provider>:/iddirectly. This is the same path thatlocallinks from the chat copy actions already take.How to test
#chatreference to a chat on the remote host, then click the chip. It opens on the remote host.Validation
All on a clean tree at
8e5fac25ec9, based on main3fd165bbb0d.npm run typecheck-clientnpm run eslint -- <10 changed files>npm run valid-layers-checknpm run hygiene./scripts/test.sh(chatReferenceAttachment, openSessionLink, editor-window and Agents-window openSessionLinkOpener, localAgentHostSessionsProvider)node test/unit/node/index.js(openSessionLink, agentSideEffects, chatContributions)New tests:
buildOpenSessionLinkForChatwith an authority.Each test was mutation-checked: dropping
local, dropping the chip's authority, ignoring the authority in the link helper, or dropping it on the records path makes tests fail.