Repository navigation
Canvases: enable remote Agent Host presentation - #345102
Merged
Ulugbek Abdullaev (ulugbekna) merged 2 commits intoOct 30, 2026
Merged
Ulugbek Abdullaev (ulugbekna) merged 2 commits into
Ulugbek Abdullaev (ulugbekna) merged 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Remote canvas loopback URLs can load on the client or an unrelated workspace remote because owning-connection resolution is missing and the required-network check accepts undefined.
3 open issues
What changed in this PR
This PR extends the existing native BrowserView canvas editor to present canvases published by remote Copilot Agent Host sessions on desktop.
Changes:
- Enables remote canvas presentation and adds required-network selection plus ambient remote TCP forwarding.
- Hardens remote browser traffic with authenticated WebSocket upgrades, WebRTC UDP containment, and popup restrictions.
- Adds focused unit and native integration coverage, and updates provider documentation.
| File | Description |
|---|---|
src/vs/workbench/services/agentHost/test/browser/editorRemoteAgentHostServiceClient.test.ts |
Tests TCP connection delegation. |
src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.ts |
Delegates TCP connections to the protocol client. |
src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHostChatContribution.ts |
Enables desktop remote Copilot canvases. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.ts |
Extends canvas support to ambient remote hosts. |
src/vs/workbench/contrib/canvases/electron-browser/canvasService.ts |
Requests required-network canvas creation. |
src/vs/workbench/contrib/browserView/test/electron-browser/browserViewWorkbenchService.test.ts |
Tests rejection of unavailable required networks. |
src/vs/workbench/contrib/browserView/electron-browser/browserViewWorkbenchService.ts |
Adds strict network selection for embedded views. |
src/vs/workbench/contrib/browserView/electron-browser/browserView.contribution.ts |
Adds extension-test commands for networked views. |
src/vs/workbench/contrib/browserView/common/browserView.ts |
Extends the embedded-view creation interface. |
src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/remoteAgentHostSessionsProvider.test.ts |
Tests remote canvas capability exposure. |
src/vs/sessions/contrib/providers/remoteAgentHost/REMOTE_AGENT_HOST_SESSIONS_PROVIDER.md |
Documents remote canvas routing and containment. |
src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostSessionsProvider.ts |
Advertises desktop Copilot canvas support. |
src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts |
Renames a test to reflect expanded support. |
src/vs/sessions/contrib/providers/agentHost/AGENT_HOST_SESSIONS_PROVIDER.md |
Updates the canvas presentation contract. |
src/vs/platform/tunnel/test/node/tunnelProxy.test.ts |
Covers direct streams, upgrades, and cancellation. |
src/vs/platform/tunnel/node/tunnelProxy.ts |
Forwards authenticated upgrades and reduces URL logging. |
src/vs/platform/browserView/test/common/browserView.test.ts |
Tests remote unlisted popup denial. |
src/vs/platform/browserView/electron-main/browserView.ts |
Applies WebRTC and popup containment. |
src/vs/platform/browserView/common/browserView.ts |
Denies popups from remote unlisted views. |
extensions/vscode-api-tests/src/singlefolder-tests/browser.test.ts |
Exercises native protocols and network containment. |
Review effort: Balanced
Ulugbek Abdullaev (ulugbekna)
force-pushed
the
ulugbekna/agents/remote-canvas-support-exploration
branch
from
October 30, 2026 09:21
a8b7091 to
9a7c234
Compare
Ulugbek Abdullaev (ulugbekna)
changed the base branch from
main
to
ulugbekna/agents/remote-browser-proxy-hardening
October 30, 2026 09:21
Ulugbek Abdullaev (ulugbekna)
force-pushed
the
ulugbekna/agents/remote-browser-proxy-hardening
branch
from
October 30, 2026 09:34
dcb21b8 to
69f99fc
Compare
Ulugbek Abdullaev (ulugbekna)
force-pushed
the
ulugbekna/agents/remote-canvas-support-exploration
branch
from
October 30, 2026 09:34
9a7c234 to
149fe29
Compare
Base automatically changed from
ulugbekna/agents/remote-browser-proxy-hardening
to
main
October 30, 2026 09:50
Enable desktop Copilot canvases for remote Agent Host sessions and require the owning chat's resolved BrowserView network, including ambient remote Editor connections, so canvas traffic never falls back locally. Co-authored-by: Copilot <[email protected]>
Exercise redirect, SSE, WebSocket, large-response, and WebRTC behavior through a real Agent Host BrowserView network, including fail-closed behavior while remote proxying is disabled. Co-authored-by: Copilot <[email protected]>
Ulugbek Abdullaev (ulugbekna)
force-pushed
the
ulugbekna/agents/remote-canvas-support-exploration
branch
from
October 30, 2026 09:53
149fe29 to
cd4b93c
Compare
Ulugbek Abdullaev (ulugbekna)
marked this pull request as ready for review
October 30, 2026 09:58
Ulugbek Abdullaev (ulugbekna)
enabled auto-merge
October 30, 2026 09:58
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Kyle Cutler (@kycutler)Matched files:
Joaquín Ruales (@jruales)Matched files:
|
Alex Ross (alexr00)
approved these changes
Oct 30, 2026
Ulugbek Abdullaev (ulugbekna)
deleted the
ulugbekna/agents/remote-canvas-support-exploration
branch
October 30, 2026 10:07
Kyle Cutler (kycutler)
added a commit
that referenced
this pull request
Oct 30, 2026
* Browser: Tighten remote canvas networking Follow-up to #345102 and #345149: - Offer canvases on remote agent hosts only while browser remote proxying is enabled and the host can forward TCP; an unknown host, such as a disconnected one, keeps its canvases. - Require an embedded view's owner network whenever an owner is given, instead of a separate flag. - Remove the WebSocket upgrade handler from the tunnel proxy: Chromium always tunnels WebSockets, including ws://, through CONNECT. - Replace the extension test commands with unit coverage for failing closed, gating, and large and WebSocket traffic over agent host streams. Co-authored-by: Copilot <[email protected]> * Browser: Address remote canvas review feedback Resolve an embedded view's owner network before any asynchronous work and reject unknown agent owners instead of falling back to the local network. Gate remote editor-window canvases reactively on remote browser proxying. Cover the browser proxy over real Agent Host TCP and Chromium's remote WebSocket, large-response and WebRTC UDP behavior in the remote API suite. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
3 tasks done
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.


Prerequisite
microsoft/vscode#345149 merged into
mainand provides the generic WebSocket/WebRTC/popup hardening used here. This branch is rebased directly onto the merged commits.Deep architecture explainer
Remote canvases from the ground up explains the protocol state, ownership model, BrowserView network routing, authenticated proxy and Agent Host TCP flow, lifecycle, security boundaries, validation, and debugging path without assuming prior context.
Summary
This enables desktop canvases published by a remote Agent Host to render in the existing native BrowserView canvas editor.
Remote canvas URLs retain their original URL, including
127.0.0.1, while the BrowserView resolves the network from the exact owning session/chat. The canvas requires that network, preventing a disconnected, unsupported, or disabled remote from falling back to the client or an unrelated workspace remote.Architecture
Fail-closed behavior
CanvasServicesupplies the exact chat owner and requests strict network resolution.BrowserViewWorkbenchServiceresolves the owner even when remote proxying is disabled, then rejects if that network cannot be used.How to review
Review the two commits independently:
1.
canvases: enable remote Agent Host presentationRemoteAgentHostSessionsProviderAgentHostChatContributionRemoteAgentHostContributionCanvasService.resolveCanvasModelBrowserViewWorkbenchService.createExternalBrowserViewdoes not fall back when an external view requires its resolved networkEditorRemoteAgentHostServiceClientCanvas enablement and strict routing intentionally remain in the same commit: enabling presentation without fail-closed ownership would create an unsafe intermediate state.
2.
canvases: add native remote network coveragebrowser.test.tsdrives a real Electron BrowserView through redirect, SSE,ws://, an 8 MiB response, and WebRTC gathering.Validation
npm run build-fast -- --client-only— passednpm run typecheck-client— passednpm run valid-layers-check— passednpm run gulp compile-extension:vscode-api-tests— passed with 0 errors./scripts/test-integration.sh --suite api-folder --grep "remote Agent Host network loads native Chromium protocols and fails closed"— 1 passedgit diff origin/main..HEAD --check— passedManual dogfood
Verified against a Windows
devbox2Remote Agent Host through an authenticated dev tunnel:curlfailed, confirming traffic crossed the Agent Host proxy;Scope and limitations