Repository navigation
agentHost: finish adopting lazily activated canvas extensions - #348466
Merged
Ulugbek Abdullaev (ulugbekna) merged 2 commits intoNov 16, 2026
Merged
Ulugbek Abdullaev (ulugbekna) merged 2 commits into
Ulugbek Abdullaev (ulugbekna) merged 2 commits into
Conversation
Extensions that declare their canvases and tools in an extension.json sidecar now start on first use. Cover that path end to end and make it usable: - Test dormant listing, first-open launch, repeated opens, canvas actions, and tool titles through the production extension launcher. - Teach the create-canvas skill to write the sidecar. - Show progress while a first open starts an extension, and explain why an open failed with a localized message and Try Again when it can help. - Report dormant extensions in canvas readiness telemetry and add agentHost.canvasHostOpen to compare cold and warm opens. - Show the PNG icons extensions declare for their canvases in canvas menus, the Canvases view, the canvas pill, the context picker, and editor tabs. The host validates and sends them as bounded data URIs, so remote clients can show them too. - Keep the title a native tool declares in its permission prompt. Co-authored-by: Copilot <[email protected]>
Pinned canvases now report a failed reopen with the same messages and Try Again as other canvas opens, choosing each retry from its latest failure. Co-authored-by: Copilot <[email protected]>
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Joaquín Ruales (@jruales)Matched files:
Sandeep Somavarapu (@sandy081)Matched files:
Ladislau Szomoru (@lszomoru)Matched files:
|
Contributor
Ross Wollman (rwoll)
approved these changes
Nov 16, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved icon-validation and path-containment flaws permit oversized decoded images and sibling-directory access, while asynchronous refresh races can retain stale state or block canvas restoration.
5 open issues
Reject icons exceeding the decoded PNG pixel limit · New Enforce strict path containment on case-sensitive volumes · New Recheck generation after awaiting icon-enriched definitions · New Prevent stale icon reads from overwriting newer results · New Preserve canvas restoration across icon-only refreshes · New
What changed in this PR
Completes VS Code’s adoption of lazily activated canvas extensions, building on dormant-extension discovery, runtime-refresh restoration, and consent handling.
Changes:
- Adds first-open progress, localized failure messages, retry handling, and native tool titles in permission prompts.
- Loads and displays canvas icons across workbench surfaces, with host-side file validation and client metadata support.
- Adds startup telemetry, runtime integration coverage, and lazy-extension authoring guidance.
| File | Description |
|---|---|
src/vs/workbench/services/sessions/common/session.ts |
Adds icons to session canvas definitions. |
src/vs/workbench/contrib/sessions/providers/agentHost/browser/baseAgentHostSessionsProvider.ts |
Forwards canvas definition icons. |
src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css |
Styles canvas icons and disabled states. |
src/vs/workbench/contrib/chat/browser/aiCustomization/copilotCustomizationsWidget.ts |
Displays icons and shares open-progress/error handling. |
src/vs/workbench/contrib/canvases/test/common/agentHostCanvasConsent.test.ts |
Tests progress, failures, and retry selection. |
src/vs/workbench/contrib/canvases/test/common/agentHostCanvas.test.ts |
Tests icon metadata consumption and fallback. |
src/vs/workbench/contrib/canvases/test/browser/editorCanvasActions.test.ts |
Tests menu icons and progress-service wiring. |
src/vs/workbench/contrib/canvases/electron-browser/editorCanvases.contribution.ts |
Injects progress support into canvas actions. |
src/vs/workbench/contrib/canvases/common/canvas.ts |
Adds icon validation and editor-tab updates. |
src/vs/workbench/contrib/canvases/common/agentHostCanvasConsent.ts |
Centralizes progress, failure messages, and retries. |
src/vs/workbench/contrib/canvases/common/agentHostCanvas.ts |
Reads icons from host canvas metadata. |
src/vs/workbench/contrib/canvases/browser/editorCanvasActions.ts |
Adds menu icons and shared opening feedback. |
src/vs/workbench/contrib/canvases/browser/canvasIcons.ts |
Manages reference-counted image styles. |
src/vs/workbench/contrib/canvases/browser/canvasesPillControl.ts |
Supplies image icons to canvas pills. |
src/vs/workbench/contrib/canvases/browser/canvasContextPicker.ts |
Passes menu icons into picker entries. |
src/vs/workbench/common/canvasReference.ts |
Adds icons to canvas instances. |
src/vs/workbench/browser/media/chatPills.css |
Sizes pill and dropdown image icons. |
src/vs/workbench/browser/chatPills.ts |
Supports custom icon classes on pill entries. |
src/vs/workbench/browser/chatDropdownPill.ts |
Renders and refreshes custom pill icons. |
src/vs/sessions/contrib/canvases/test/electron-browser/sessionCanvasRegistryService.test.ts |
Updates test wiring for progress support. |
src/vs/sessions/contrib/canvases/electron-browser/sessionCanvasService.ts |
Uses shared canvas-opening feedback. |
src/vs/sessions/contrib/canvases/electron-browser/sessionCanvasActions.ts |
Adds icons to Agents window canvas actions. |
src/vs/sessions/contrib/canvases/browser/pinnedCanvasService.ts |
Shares failure and retry handling for pinned canvases. |
src/vs/platform/agentHost/test/node/providerIntegration/copilotNativeExtensions.integrationTest.ts |
Covers lazy activation and native tool titles. |
src/vs/platform/agentHost/test/node/copilotCanvasIcons.test.ts |
Tests icon bounds, containment, and file handling. |
src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts |
Covers icon refresh, failures, restoration, and telemetry. |
src/vs/platform/agentHost/test/common/agentCanvasIconMeta.test.ts |
Tests icon metadata validation and preservation. |
src/vs/platform/agentHost/PERFORMANCE.md |
Documents readiness and host-open telemetry. |
src/vs/platform/agentHost/node/copilot/copilotCanvasIcons.ts |
Loads bounded PNG icons from extension directories. |
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts |
Integrates icons, failure classification, telemetry, and tool titles. |
src/vs/platform/agentHost/node/agentHostTelemetryReporter.ts |
Adds dormant counts and host-open events. |
src/vs/platform/agentHost/common/meta/vscode/agentCanvasIconMeta.ts |
Defines icon metadata encoding and validation. |
src/vs/platform/agentHost/common/meta/agentCanvasIconMeta.ts |
Exposes shared icon metadata helpers. |
src/vs/platform/agentHost/common/agent.ts |
Extends canvas icon and open-result contracts. |
extensions/copilot/src/platform/promptFiles/test/node/builtinSkills.spec.ts |
Checks lazy-canvas authoring guidance. |
extensions/copilot/assets/prompts/skills/create-canvas/SKILL.md |
Documents sidecars, first-use activation, and validation. |
Review effort: Balanced
Ulugbek Abdullaev (ulugbekna)
deleted the
ulugbekna/agents/p0-4-p1-p2-subchat-implementation
branch
November 16, 2026 06:47
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.


Follow-up to #347629, #347946 and #348216.
The Copilot runtime can start an extension on first use instead of with the session (github/copilot-agent-runtime#28873). An extension opts in with an
extension.jsonsidecar that declares its canvases and tools. Its process then starts on the first canvas open, canvas action, or native tool call, and until then the extension isdormant. The same runtime release adds an optionaliconto canvas declarations and an optionaltitleto native tools.VS Code already lists dormant extensions and keeps their canvases open across refreshes. This finishes the adoption.
Changes
The first commit holds the adoption. The second adapts pinned canvases, which landed on
mainmeanwhile, to the new error handling.CopilotAgent, VS Code's production extension launcher, and the bundled runtime.listAgentExtensionsreports itdormantandlistSessionCanvaseslists its canvas, with no process started.create-canvasskill. It now writes the sidecar for canvas-only extensions, and imports the same declarations inextension.mjsso the two can't drift. It covers the runtime's rules: nonullfields, the 256 KiB limit,joinSession()at top level, staying eager for hooks and observers, and the optionalicon. It also corrects whatextensions_reloaddoes with dormant extensions. The skill stays host-neutral.dismissed,reloaded,mismatchedDeclaration,startFailedandunavailable, and returns that over IPC. An extension's own errors keep their text.reloadedoffers Try Again.agentHost.canvasExtensionsReadygainsdormantExtensionCount. The field is additive, soschemaVersionstays 1.agentHost.canvasHostOpenreports each open the host requests, from the UI or as a background restore. It records the extension's status just before the open (dormantfor a cold start, orrunning), the outcome, whether someone was asked for consent in a turn or by the client, anddurationMs.timeout.PERFORMANCE.mddocuments both events.IAgentCanvasInfo.icon. Open canvases carry it in a namespaced_metaentry,vscode.canvasIcons, until the Agent Host Protocol givesCanvasStateicons. Clients validate it, and hosts that send none keep working.Codicon.previewas the fallback.title, but its permission prompt lost it. The prompt now keeps the title, and its question still names the exact tool.titleis display-only and isn't sent to the model. VS Code's own client tools don't set it, since that would rename every client tool row.How to test
Set
COPILOT_HOMEto an empty folder, and enablechat.canvases.enabled.Add a user extension in
extensions/lazy-board/inside it, with a 32×32icon.png:extension.jsonandextension.mjs{ "version": 1, "initialization": "module", "canvases": [{ "id": "lazy-board", "displayName": "Lazy Board", "description": "Starts on first use.", "icon": "icon.png" }] }In the Agents window, start a chat in any folder and send a message.
Open Lazy Board from Add Context > Canvas....
To see an error, make
extension.mjsregister a canvas ID other than the oneextension.jsondeclares. Opening it then says it was withdrawn because it registered differently from its declaration.Replace
icon.pngwhile the canvas is open, then make the runtime reload: add.github/agents/probe.agent.mdto the folder and send a message. The tab shows the new icon.Demo, recorded in a dev build of the Agents window:
Screenshots: picker, Canvases view, pill dropdown, first-open progress, icon before and after a reload, native tool titles.
Validation
On this branch, rebased on current
mainwith the bundled@github/copilot-sdk1.0.33-preview.0:npm run typecheck-client: passed../scripts/test.sh --runwith the 14 touched suites (copilotAgentSession,copilotAgent,agentService,copilotCanvasIcons,agentCanvasIconMeta,agentHostCanvas,agentHostCanvasConsent,editorCanvasActions,sessionCanvasRegistryService,sessionCanvasService,pinnedCanvasService,copilotCustomizationsWidget,localAgentHostSessionsProvider,chatPills): passed (5090 passing, 28 existing pending)../scripts/test-integration.sh --runwithcopilotNativeExtensionsandcopilotExtensionEnvConsent: passed (3 + 3 passing). These run the real bundled runtime../scripts/test-integration.sh --runwithcopilotMockLlm,--grep canvasand--grep "lazy extension": passed (1 + 1 passing).extensions/copilot:npx vitest --run --pool=forks src/platform/promptFiles/test/node/builtinSkills.spec.ts: passed (3 passing).npm run oxlint -- <changed files>,npm run valid-layers-check, andnode build/stylelint.tson the two changed CSS files: passed.@vscode/telemetry-extractoroversrc/vs/platform/agentHost/node: both events have the expected owner and fields. Every number and boolean is a measurement, and every field has a comment.--log trace: a dormant open took about 3.1 s against about 2 ms warm, and a restore after a runtime replacement was reported asrestore.Notes
_metaentry.