[WIP] Add canvases to saved chats in the Agents window - #335951
Draft
Ulugbek Abdullaev (ulugbekna) wants to merge 24 commits into
Draft
Ulugbek Abdullaev (ulugbekna) wants to merge 24 commits into
Ulugbek Abdullaev (ulugbekna) wants to merge 24 commits into
Conversation
Integrate runtime-owned canvases through AHP with isolated native presentation, exact-owner approval, no-turn retention, and explicit recovery. Keep the source-built local preview disabled by default with separate SDK/runtime release and enablement gates. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Ulugbek Abdullaev (ulugbekna)
September 12, 2026 10:30
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
External views can survive renderer restoration and canvas icon updates are not projected into canonical state.
Get a fresh assessment by requesting another Copilot review.
Review tier: Balanced
Findings: 2
Open findings (2)
What changed in this PR
Adds an opt-in native canvas preview to the Agents window, integrating provider-owned canvases across Agent Host protocol state, Sessions UI, and isolated Integrated Browser presentation.
Changes:
- Adds canvas discovery, lifecycle, persistence, action routing, and SDK compatibility support.
- Adds native canvas editors with accessibility, theming, permissions, and file-trust handling.
- Adds targeted unit, integration, and smoke coverage.
| File | Description |
|---|---|
build/npm/copilotSdkCanvasPatch.ts |
Validates and applies the SDK backport. |
src/vs/platform/agentHost/common/agentHostCanvasValidation.ts |
Validates canvas protocol data. |
src/vs/platform/agentHost/common/agentHostCanvases.ts |
Defines canvas service contracts. |
src/vs/platform/agentHost/common/agentHostExtensionProtocol.ts |
Adds explicit initialization negotiation. |
src/vs/platform/agentHost/common/ahpJsonlLogger.ts |
Redacts transient canvas sources. |
src/vs/platform/agentHost/common/state/protocol/channels-canvas/* |
Adds generated canvas protocol state and operations. |
src/vs/platform/agentHost/node/agentHostCanvasOperationLedger.ts |
Handles bounded, idempotent operations. |
src/vs/platform/agentHost/node/agentHostCanvasesService.ts |
Implements authoritative canvas lifecycle. |
src/vs/platform/agentHost/node/copilot/copilotCanvases.ts |
Adapts Copilot SDK canvases. |
src/vs/platform/agentHost/node/protocolServerHandler.ts |
Routes canvas protocol requests. |
src/vs/sessions/contrib/canvases/README.md |
Documents ownership and isolation. |
src/vs/sessions/contrib/canvases/common/sessionCanvasPresentation.ts |
Coordinates state and native presentation. |
src/vs/sessions/contrib/canvases/electron-browser/sessionCanvasActions.ts |
Adds canvas commands and pickers. |
src/vs/sessions/contrib/canvases/electron-browser/sessionCanvasEditor.ts |
Implements the canvas editor and accessibility. |
src/vs/sessions/contrib/canvases/electron-browser/sessionCanvasService.ts |
Manages canvas inputs and leases. |
src/vs/sessions/contrib/canvases/electron-browser/sessionCanvases.contribution.ts |
Registers settings, editors, and actions. |
src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionCanvases.ts |
Projects Agent Host canvases into Sessions. |
src/vs/workbench/contrib/browserView/electron-browser/browserCanvasTheme.ts |
Maps workbench themes into canvas guests. |
src/vs/workbench/contrib/browserView/electron-browser/browserFileTrustWidget.ts |
Adds trusted-file recovery UI. |
src/vs/workbench/contrib/browserView/electron-browser/browserViewWorkbenchService.ts |
Creates isolated external browser views. |
src/vs/workbench/contrib/browserView/electron-browser/overlayManager.ts |
Recognizes accessible-view overlays. |
src/vs/workbench/contrib/browserView/electron-browser/webContentsViewHost.ts |
Shares native view hosting behavior. |
src/vs/platform/browserView/electron-main/browserSessionFileAccess.ts |
Enforces trusted file roots. |
src/vs/platform/browserView/electron-main/browserViewMainService.ts |
Enforces native canvas isolation. |
src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.ts |
Forwards canvas operations remotely. |
src/vs/workbench/contrib/browserView/test/** |
Covers isolation, themes, overlays, and trust. |
src/vs/sessions/contrib/canvases/test/** |
Covers canvas ownership and lifecycle. |
src/vs/platform/agentHost/test/** |
Covers protocol and provider behavior. |
test/smoke/src/areas/browserView/browserView.test.ts |
Exercises accessibility help integration. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Preserve canvas initialization, retention, transport ownership and early SDK events alongside upstream artifact removal, workspace trust, sandbox and steering updates. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Apply canonical icon changes without replaying provider effects and release orphan native presentations before renderer restoration. Bind CI dependency caches to SDK postinstall inputs, preserve native-only capability coverage, and validate canonical session disposal requests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Match the existing mock chat-surface override pattern so the canvas creation fixtures pass the define-class-fields check without changing their initialization or cancellation assertions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
|
Base:
|
Apply the byte-verified package delta with Git line-ending conversion disabled for that subprocess. Cover autocrlf true, input, and false with a CRLF preference without changing package hashes or user Git configuration. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Read already-hydrated exact-owner membership when resolving a logical input. Preserve later observable title updates and cover both hydration orderings without source pulls, provider effects, or native allocation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Authorize project extension startup using the existing synchronized Workspace Trust for the actual session directory and original/resolved entrypoint. Preserve explicit approvals for other sources, credentials and recovery, and retain sessions before launch. Recheck trust and source identity after asynchronous retention. Share the existing Codex trust matcher without changing its behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reject project extension launches before source approval or retention unless the owning workspace and original/resolved source paths are trusted. Keep explicit source approval for user, plugin and session extensions. Preserve late trust/path checks, cancellation, credentials, recovery and persistence semantics, and cover the former manual-approval bypass with regressions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Cover missing launch context, canonical retention error identity, explicit retry, and cancellation while retention is pending. Document that the client uses unchanged public JSON-RPC methods rather than runtime-internal N-API exports; no production API or SDK payload migration is required for the runtime trim. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reuse the Sessions workspace execution admission for canvas initialize, open, action, and provider restart, including after trust revocation. Keep catalog/source reads and close available without starting a provider. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Defer extension startup and canvas operations until the conversation has a durable first turn. Remove zero-turn retention and draft promotion, adopt the retention-free B4 SDK carrier, and preserve launch admission, readiness, cancellation, and restoration for saved chats. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
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
Adds a default-off, source-built local desktop preview of runtime-owned canvases in the Agents window. Existing Copilot canvas extensions keep their original source directories, runtime, HTTP/SSE interaction and provider-owned data; VS Code supplies exact-chat ownership and isolated native editor presentation.
The first release is intentionally limited to existing, persisted chats. The user sends a normal first request before canvases become available. Canvas-first/zero-turn chat creation is deferred.
This is the original-directory compatibility implementation, separate from #335902. It does not modify or supersede that parallel implementation's PRs.
First-release scope
session.retain, stores retained execution intent, or promotes a draft from canvas membership.Canvas-first creation, durable zero-turn owners and their automatic recovery can be designed separately using host-owned persistence. They are not silently preserved through another API in this PR.
Included
sessionIdand the runtime's originaldefaultLaunch, strict version-1 negotiation, cancellation/disconnect fencing and no fallback after denial.1.0.15-preview.2/ CLI1.0.89-1. The current-main package is patched as a complete image; the obsolete public-1.0.13/B3 transition route has been removed.The presentation setting
sessions.experimental.canvases.enableddefaults to false. Actual canvas support additionally requires a non-built development environment and an explicitly selected compatible runtime throughVSCODE_AGENT_HOST_CANVAS_RUNTIME_PATH.Persisted-chat startup flow
For a new chat, the SDK session starts without extensions. The normal first request creates durable user/assistant history. When the user later selects Initialize Canvas Providers or opens a canvas, VS Code:
For a cold existing chat, resume can request extensions during resume. Neither path fabricates a chat turn or calls
sessions.saveduring admission.Workspace Trust execution boundary
Workspace Trust is owned by VS Code, not by the Copilot runtime:
ISessionsService.canExecuteSession, including when trust was revoked from an already-active session.Workspace Trust is not a Node sandbox, content-bound package approval or replacement for extension/credential/browser/file/recovery permissions.
Dependency alignment
31879439— generic numeric schema-constant generation. Its repository CI is green.b6467d5e— launch-v1 contract, exact owner/default recipe, fail-closed resolver, exact upstream native resume lock-order fix8f00ab12, and deterministic CI fixtures. This is the direct SDK wire dependency. Public runtimes1.0.89-0and1.0.89-1predate the native fix.b5526e14— resident attachment, deterministic readiness, privileged-callback ordering and initial script safety.e6668e8b— the two-file persisted-chat integration proof plus a test-only background-interrupt routing precondition.82916669. All 93 current-head checks pass (78 existing path-selected skips, zero failures/pending). CI fixes are limited to test/fixture ownership and strict replay history; production SDK, generated schemas, pins and carrier bytes are unchanged.cd05c63c. No persisted-chat scope change was required.1.0.15-preview.2/ CLI1.0.89-1, patch SHA-256987c431f47a68ba6c10d20223405223ac745e4bcad00df62d0c450fdab16a6f9. Final integrated qualification requires a newly published runtime that contains8f00ab12; the later publication timestamp of1.0.89-1does not imply that it contains the fix.These are candidate contracts, not published SDK/runtime releases. Aligned review and releases remain required before replacing the private carrier or enabling the feature by default.
Validation
The current VS Code head
adefbd95is reconciled with current main and passed:Runtime and SDK PRs have their own focused generation/build/test evidence. SDK's previously failing freshness, macOS Node and macOS Rust jobs are repaired; its full current-head matrix is green.
Runtime CI is not uniformly green and is not represented as such. Layer 1 and the top are terminal green. Layer 2 has zero native/test failures; its only two reds are a GitHub HTTP-500 review-dispatcher reconciliation and its aggregate. Layer 3 has two unresolved root failures plus aggregates: a pending-work handoff result and one extension-environment permission prompt attempt. The one authorized pending-work proof compiled and ran but was inconclusive because its warm assertion misread
sessionWasActiveand its cold fixture was not persisted. The environment-access failure cannot be assigned because the CI artifact omits the terminal resume/peer-exit/extension-launch witness. No failure is waived.No Code OSS/Electron/native application qualification was rerun for this scope change.
Historical qualification boundary
Earlier native qualification belongs to older heads that supported canvas-first retention and used older runtime/SDK images. It remains useful evidence for native presentation, isolation, reload, close and restoration mechanics, but it does not qualify this persisted-chat head or its new B4/runtime pair.
Draft gates and limits
8f00ab12is required before final consumer qualification; neither public1.0.89-0nor1.0.89-1contains it.Trying the local preview
Use an isolated Code OSS development profile with the compatible runtime selected explicitly and the canvas presentation setting enabled.
An ordinary published CLI is not a substitute for the required runtime candidate. In particular, public
1.0.89-1predates the native resume lock-order fix required by this stack.See
src/vs/sessions/contrib/canvases/README.mdfor the ownership/lifecycle contract andbuild/npm/copilot-sdk-canvas.mdfor the current carrier boundary.