Skip to content

[WIP] Add compatible canvases to the Agents window - #335951

Draft
Ulugbek Abdullaev (ulugbekna) wants to merge 6 commits into
mainfrom
ulugbekna/canvases-architecture
Draft

[WIP] Add compatible canvases to the Agents window#335951
Ulugbek Abdullaev (ulugbekna) wants to merge 6 commits into
mainfrom
ulugbekna/canvases-architecture

Conversation

@ulugbekna

@ulugbekna Ulugbek Abdullaev (ulugbekna) commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

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.

This is the original-directory compatibility implementation, separate from #335902. It does not modify or supersede that parallel implementation's PRs.

Included

  • Canonical AHP canvas state, discovery, lifecycle and action routing, with separately negotiated explicit provider initialization.
  • Runtime/SDK admission, authentic extension-readiness barriers, durable no-turn owners, creator/peer/fork coordination and bounded state-only cold recovery.
  • Provider-neutral Sessions projection and native canvas editors. Tab close, hiding and owner switching detach presentation; logical close and provider restart remain separate explicit operations.
  • User-only native isolation, separate browser permissions and file trust, cancellation-safe choosers, accessibility/help and theme integration. Canvas pages do not become ordinary browser/model automation targets.
  • A guarded, reproducible SDK 1.0.13+B3 backport carrier for root and remote dependency installations, with complete-image validation. The ordinary CLI pin is unchanged.

The presentation setting sessions.experimental.canvases.enabled defaults to false. Actual canvas support additionally requires a non-built development environment and an explicitly selected compatible runtime through VSCODE_AGENT_HOST_CANVAS_RUNTIME_PATH.

Review and CI corrections

  • Added canonical, strictly revisioned icon changes/removal without remounting native content or replaying effects.
  • Reconcile orphan external native views before allowing replacement allocations after renderer reload; preserve ordinary browser views and propagate cleanup failures. Restored editor inputs also hydrate their known exact-owner titles regardless of membership/input creation order.
  • Include SDK postinstall inputs in the shared dependency-cache identity. Apply the verified package delta with subprocess-local LF settings so Windows Git preferences cannot rewrite the approved after-image. No package hashes or checks were relaxed, and user Git configuration is unchanged.
  • Corrected declaration compatibility, native/web test boundaries, canonical { channel } disposal calls and class-field-safe test fixtures while preserving production eligibility gates.

Both original inline review findings were answered and resolved in their original threads. Changes are ordinary signed commits; no force push, signing bypass or hook bypass was used.

Related dependency work

These are candidate contracts, not published SDK/runtime releases. The protocol import is regenerated from the identified canonical revision, not independently hand-edited.

Qualification

Current source: 77c3fd860388f02b4738823c238b1cb258b864f8. Real Code OSS 1.139.0 Dev on macOS arm64 passed 43 steps across four native process generations using the original Counter and Triage extensions:

  • Three genuine renderer reloads with two simultaneously visible canvases in the supported classic layout. Exact tab titles survive; every old native canvas is destroyed before replacement, without accumulation, action replay or changes to canonical state, domain bytes, retention, consent or runtime launches. An ordinary browser retains its native identity and URL.
  • Separate Reload View and logical Close operations, independent owners, effective reopen, cookie isolation and normal owner switching.
  • Fully disjoint cold restoration and explicit provider recovery with retained membership and byte-identical triage domain data, without model-turn or action replay.

All four generations exited normally within the unchanged ten-second deadline, with no forced signals or model requests. Independent reconciliation found no survivors among 135 owned PID/birth identities and reverified all 360 frozen product fingerprints, 20 source/output pairs, both complete B3 installations and the selected runtime source/build image. Earlier failures remain recorded rather than relabeled. Earlier bounded runs cover original Perfetto presentation, file trust, browser permissions, accessibility/themes and native-view withdrawal; those are explicitly historical evidence, not new full-matrix coverage.

Current Code OSS CI passed all 21 jobs, including all five Windows lanes. Component Fixtures attempt 2 passed 43 tests, rendered 2,213 fixtures without errors and matched all 178 blocking hashes. Its first attempt's unchanged chat-input fixture differed only in 12 antialiasing samples; one bounded rerun at the identical head and merge commit returned exactly to the committed PNG. No baseline was accepted, assertion waived or underlying rasterizer fix claimed. The PR has 33 successful checks; the remaining VS Code PR Check is an ordinary collaborator-approval gate, not executable CI.

Draft gates and limits

  • Aligned AHP/SDK/runtime review and releases are required before general enablement; this PR does not enable the feature by default.
  • A historical intermittent post-joiner native shutdown-latency observation remains unexplained. The current successful exits do not establish its root cause or erase that enablement gate.
  • Source consent is mutable original-directory execution consent, not content-bound package trust or Node sandboxing. Native guest isolation does not sandbox extension Node execution.
  • Disconnected launch-provider ownership cannot be transferred on a still-running shared runtime; no takeover fallback is introduced.
  • Other native platforms, all actual extension-source scopes, physical assistive technology, every model/resume combination, remote/Web execution and native Office built-ins are not qualified by this preview.

Trying the local preview

Use an isolated Code OSS development profile with the compatible runtime selected explicitly and the canvas presentation setting enabled. Initialize/open canvases for the represented chat through the Canvases menu, completing normal source consent and any separate browser/file-trust prompts. An ordinary published CLI is not a substitute for the required runtime candidate.

See src/vs/sessions/contrib/canvases/README.md for the ownership and interaction contract, and build/npm/copilot-sdk-canvas.md for the temporary dependency carrier and its release boundary.

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 AI balanced review requested due to automatic review settings September 12, 2026 10:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity

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.

Comment thread src/vs/platform/agentHost/node/agentHostCanvasesService.ts
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>
@github-actions

github-actions Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Base: 3879d0e8 Current: e91993f3

No screenshot changes.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants