Skip to content

[wip] Add local canvases to the Agents Window - #335902

Draft
Ulugbek Abdullaev (ulugbekna) wants to merge 1 commit into
mainfrom
ulugbekna/agents/gh-copilot-canvases-support-vscode
Draft

[wip] Add local canvases to the Agents Window#335902
Ulugbek Abdullaev (ulugbekna) wants to merge 1 commit into
mainfrom
ulugbekna/agents/gh-copilot-canvases-support-vscode

Conversation

@ulugbekna

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

Copy link
Copy Markdown
Contributor

Summary

Add a default-off local canvas development preview to the Agents Window, backed by approved Copilot SDK extension packages and source-resolved native browser surfaces.

This is a work-in-progress integration PR, not a request to enable the feature generally or publish the companion SDK/runtime changes.

Included

  • Canonical AHP canvas state and operations, generation/revision guards, bounded operation deduplication, and exact owning-chat routing.
  • Inert package preparation, immutable reviewed snapshots, explicit revision/workspace or shared-host approval, revocation, and document data kept outside code.
  • Canvas-first session retention, provider lifecycle/disposal fixes, explicit restart versus page reload, and stable restoration without persisting live endpoint authority.
  • Provider-neutral Sessions controls, authoring starter, visible/removable request-frozen canvas context, automatic active-chat reveal, and inert hidden/restored instances.
  • Native Integrated Browser app policy, semantic themes, permissions/navigation controls and ownership/lifecycle handling.
  • Genuine joined-SDK user-message projection so canvas-originated requests appear in chat with normal tool confirmation and cancellation. The host does not resend the prompt.
  • Focused unit/integration coverage and isolated developer launch/runbook support.

The five JavaScript allowlist additions are executable extension/browser fixtures and the no-build authoring starter; those files intentionally run as delivered rather than requiring TypeScript transpilation. The allowlist still requires normal CODEOWNERS review.

Validation

  • Latest affected Copilot live-session/history selection: 492 passing, with targeted typecheck and uncached lint clean.
  • Automatic presentation/facade selection: 99 passing, plus actual native model-driven reveal and hidden-tab refresh checks.
  • Earlier scoped native/lifecycle/load qualification is documented in the implementation runbooks. Counts from overlapping runs are not added together.
  • Real macOS arm64 native chess exercised actual model actions, explicit per-call approval, denial, cancellation, a permission wait beyond 120 seconds, reload, and provider restart while preserving data and the complete approved snapshot.
  • The standalone repaired chess ZIP is a separate local deliverable, not included in this source PR; its 125 packaged core/browser tests passed.
  • With the corrected companion runtime, the complete opt-in public SDK integration file is now 3 passing, including the formerly failing package-approval-after-an-existing-turn case.
  • Final commit preparation passed the normal VS Code pre-commit hygiene hook (181 checked files). Its formatting findings were fixed without changing behavior; protocol braces were corrected in the canonical AHP source and re-synced, not patched in generated copies.

Public companion drafts

The compatible runtime change is tracked separately in its existing private repository.

Remaining WIP gates

  • The separately reproduced Hook processor is not configured resume failure was fixed in the companion runtime's lifecycle handling, without a VS Code workaround. Repeated unchanged SDK reproductions and actual native existing-chat package approval now pass. Consuming released dependency versions is still separate from the isolated development-build validation.
  • The normal-workspace execution route is qualified only for the local macOS arm64 development setup with explicitly selected compatible SDK/runtime artifacts. Other native platforms, built-product enablement and normal dependency-release integration remain gated.
  • Real assistive-technology qualification remains outstanding.
  • The AHP release/changelog flow and coordinated dependency releases remain separate from this draft.

No private user profiles, credentials, local verification logs, heap dumps, SDK/runtime build artifacts or session documents are included.

Add the default-off local canvas preview across Agent Host, the canonical
protocol adapter, Sessions presentation, package authoring and native browser
surfaces. Preserve exact workspace/revision authority, external document data,
canvas-first retention, live source ownership and request-frozen context.

Project genuine joined-SDK requests into chat turns so canvas-originated
requests use visible tool approvals and cancellation. Include regression
coverage, runnable fixtures, launch tooling and the required JavaScript
allowlist entries for source packages that run without transpilation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a069b1a2-65a9-4427-b3fe-6546a3bffc9e

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

Workspace-scoped approvals can bypass target-folder trust checks and fail for isolated worktrees because repository roots are used instead of effective working directories.

Get a fresh assessment by requesting another Copilot review.

Review tier: Balanced (auto)
Findings: 1 High severity · 2 Medium severity

Note

Copilot is running an experiment and ran this review at Balanced.

Open findings (3)
What changed in this PR

Adds an opt-in local canvas development preview spanning Agent Host state, package authorization, Sessions UI, and confined Integrated Browser rendering.

Changes:

  • Adds canonical canvas protocol, persistence, context, and SDK integration.
  • Adds reviewed package snapshots with scoped approvals.
  • Adds Sessions controls, browser confinement, tooling, and tests.
File Description
src/​vs/​platform/​agentHost/​** Canvas protocol, runtime, package authorization, context, and tests
src/​vs/​sessions/​contrib/​canvases/​** Canvas presentation and actions
src/​vs/​sessions/​contrib/​providers/​agentHost/​** Package management and session integration
src/​vs/​workbench/​contrib/​browserView/​** Source-backed browser editors
src/​vs/​platform/​browserView/​** Native browser confinement and lifecycle
src/​vs/​workbench/​contrib/​chat/​** Canvas request context and draft transfer
scripts/​local-canvas-* Development setup and launch tooling
.agents/​skills/​launch/​** Isolated launch workflow updates
build/​** Build, localization, and style metadata
src/​**/​test/​** Unit and integration coverage

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +369 to +379
if (scope === 'workspace' && capturedWorkspace) {
if (!this.workspaceTrustManagementService.isWorkspaceTrusted()) {
const trusted = await this.workspaceTrustRequestService.requestResourcesTrust({
uri: capturedWorkspace.folder,
message: localize('agentHostCanvasPackages.approve.trustMessage', "Approving \"{0}\" to run in this workspace requires you to trust the workspace.", pkg.name),
});
if (!trusted) {
return;
}
}
}
}

private async openPackage(target: ISessionCanvasTarget): Promise<URI | undefined> {
const workspace = target.session.workspace.get()?.folders[0]?.root;

private currentSessionWorkspace(): ICanvasPackageSessionWorkspace | undefined {
const session = this.sessionsService.activeSession.get();
const folder = session?.workspace.get()?.folders[0]?.root;
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