sessions: add browser links for Agent Host sessions - #334961
Open
Sandeep Somavarapu (sandy081) wants to merge 5 commits into
Open
sessions: add browser links for Agent Host sessions#334961Sandeep Somavarapu (sandy081) wants to merge 5 commits into
Sandeep Somavarapu (sandy081) wants to merge 5 commits into
Conversation
Route product protocol links through the dedicated Agents window handoff so provider-scoped sessions and chats are revealed reliably. Add Copy Link actions to Agent Host session and chat context menus. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Sandeep Somavarapu (sandy081)
September 7, 2026 18:14
View session
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Robo (@deepak1556)Matched files:
Benjamin Christopher Simmonds (@benibenj)Matched files:
|
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Multiple moderate issues affect link identity integrity, cold-start routing, and disconnected remote sessions.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 4
New issues introduced by this change (5)
| Severity | Finding |
|---|---|
src/vs/code/electron-main/app.ts — On cold startup this URL is still queued in ElectronURLListener, which keeps the same… |
|
src/vs/platform/agentHost/common/openSessionLink.ts — Serializing with skipEncoding after parsing the internal link corrupts opaque IDs containing… |
|
src/vs/sessions/contrib/chat/electron-browser/chat.contribution.ts — This wait cannot recover a lazily seeded remote Agent Host session after restart: matching depends… |
|
src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionBranchActions.ts — resolveSessionResource requires a live remote connection, but remote providers intentionally… |
|
src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.ts — This help text says every nested chat offers Copy Link, but the action is contributed only for… |
What changed in this PR
Adds product-protocol links for opening Agent Host sessions and chats in the Agents window.
Changes:
- Adds external link building, parsing, and window routing.
- Adds Copy Link actions for Agent Host sessions and chats.
- Extends tests and accessibility guidance.
| File | Reviewed change | Finding |
|---|---|---|
src/vs/sessions/contrib/sessions/test/browser/sessionsListContextMenu.test.ts |
Updates context-menu tests. | — |
src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts |
Scopes chat menus by provider. | — |
src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostSessionBranchActions.test.ts |
Tests generated links and actions. | — |
src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionBranchActions.ts |
Adds Agent Host Copy Link actions. | Moderate: Lazily seeded remote sessions require a live connection, causing Copy Link to fail. |
src/vs/sessions/contrib/chat/test/browser/openSessionLinkOpener.test.ts |
Tests backend identity resolution. | — |
src/vs/sessions/contrib/chat/electron-browser/chat.contribution.ts |
Resolves and opens linked sessions. | Moderate: Links to disconnected, lazily seeded remote sessions time out after restart. |
src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.ts |
Documents Copy Link actions. | Nit: Help incorrectly implies Copy Link is available for all providers. |
src/vs/sessions/contrib/chat/browser/openSessionLinkOpener.contribution.ts |
Resolves provider-scoped session identities. | — |
src/vs/sessions/common/sessionCommands.ts |
Defines Copy Link command IDs. | — |
src/vs/sessions/browser/parts/chatCompositeBar.ts |
Adds chat-tab Copy Link actions. | — |
src/vs/platform/window/common/window.ts |
Adds link-based window telemetry. | — |
src/vs/platform/agentHost/test/common/openSessionLink.test.ts |
Tests external link handling. | — |
src/vs/platform/agentHost/common/openSessionLink.ts |
Builds and parses external links. | Moderate: skipEncoding corrupts opaque IDs containing percent-escape text. |
src/vs/code/electron-main/app.ts |
Routes protocol links to Agents windows. | Moderate: Cold startup can open duplicate Agents windows because the URL remains queued. |
src/vs/base/common/network.ts |
Defines the Agents URL authority. | — |
Suppressed comments (2)
src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionBranchActions.ts:52
- These provider-only menu conditions also expose Copy Link in the header of an uncreated Agent Host draft. The draft resource is only client-side, so the generated URL cannot be resolved in another window or process. Gate both session menu entries on created/committed state and defensively reject draft contexts in
run.
when: ContextKeyExpr.regex(SessionProviderIdContext.key, ANY_AGENT_HOST_PROVIDER_RE),
}, {
id: Menus.SessionHeaderContext,
group: '2_edit',
order: 2,
when: ContextKeyExpr.regex(SessionProviderIdContext.key, ANY_AGENT_HOST_PROVIDER_RE),
src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionBranchActions.ts:75
- The nested-chat context already provides
sessionChatItem.isUntitled, but this new action does not exclude it. As a result, an untitled Agent Host chat gets Copy Link even though its client-side fragment is not yet a durable backend chat ID, producing a link that cannot be reopened. Add the same untitled negation used by the rename action.
id: Menus.SessionChatItemContext,
group: '2_copy',
order: 1,
when: ContextKeyExpr.regex(SessionProviderIdContext.key, ANY_AGENT_HOST_PROVIDER_RE),
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Show an error after the Agents window finishes waiting for a session targeted by a browser link. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Show the browser-facing product URL so users can identify the session link that failed to resolve. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve opaque IDs, handle cold-start links once, and resolve remote session identity without requiring a live connection so seeded sessions can connect on demand. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use a /chat/<id> path segment for browser-facing chat links while preserving internal session-link compatibility. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ladislau Szomoru (lszomoru)
approved these changes
Sep 7, 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.


Fixes #334963
Summary
Validation
npm run transpile-clientnpm run typecheck-clientcode-oss://agents/agent-host-session/...URL in an isolated Agents window