Repository navigation
sessions: add a Canvases section that starts a session with a canvas - #349654
Merged
Ulugbek Abdullaev (ulugbekna) merged 6 commits intoNov 22, 2026
Merged
Conversation
A workspace-less draft chat can now list the canvases it can open without being started: the host launches its runtime early, as it pre-warms a chat, and lists from it without persisting or announcing anything. Opening a canvas in the draft materializes it the way its first send does, claiming that runtime, so a canvas can be the first content of a session. A draft with a workspace still waits for its first send, which creates its worktree. A materialized session is no longer an unused draft, so empty-session GC never deletes a canvas session that has no turn yet. Co-authored-by: Copilot <[email protected]>
`ISessionsProvider.createCanvasDraft` creates an unlisted quick chat of a session type that runs canvases. The draft lists the canvases it can open without being started; opening one starts it on the host and lists the session under the canvas name, sharing the graduation a first send runs. Disposing the draft before a canvas opens, or a canvas that does not open, deletes it. `ISessionsManagementService.createCanvasDraft` routes to the first provider that supports it, leaves the composer draft alone, and its `open` resolves to the canvas once its chat publishes it. Co-authored-by: Copilot <[email protected]>
`ISessionCanvasCatalogService` keeps, per profile, the canvas types a canvas draft last listed that can start a session (user and plugin extensions that open without input), so New Canvas can offer them at once while a new draft lists the installed ones again. Co-authored-by: Copilot <[email protected]>
… with a canvas With the new experimental `sessions.list.canvasesSection` setting, off by default, pinned canvases sit under a Canvases section in the sessions tree, in both sidebar layouts, which shows a placeholder while nothing is pinned and hides while chat or canvases are disabled. Its New Canvas... action lists the installed canvases through a canvas draft, so no chat is needed first, showing the remembered ones meanwhile, along with ways to create or browse canvases. Picking one starts the draft as a session whose first content is that canvas, without sending a message, then pins the canvas and shows it full-page. When the canvas cannot be pinned, its session opens instead. Cancelling discards the draft. With the setting off, pinned canvases are listed as before. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Pending-consent flows can reject valid approvals and leave drafts unmaterialized, while disposal races can retain observations and return canvas references through disposed services.
3 open issues
What changed in this PR
This PR adds canvas-first sessions to the Agents window, letting users open a canvas without sending a message first. The sidebar experience is experimental and disabled by default.
Changes:
- Allow workspace-less Agent Host drafts to discover canvases and become persistent sessions when a canvas opens.
- Add a cached canvas catalog and a New Canvas picker that starts, pins, and displays the selected canvas.
- Introduce the optional Canvases sidebar section, with supporting lifecycle tests and documentation.
| File | Description |
|---|---|
src/vs/workbench/contrib/sessions/providers/agentHost/browser/baseAgentHostSessionsProvider.ts |
Creates canvas drafts and shares session graduation logic. |
src/vs/workbench/contrib/sessions/common/sessionsProvider.ts |
Defines the provider canvas-draft contract. |
src/vs/workbench/contrib/sessions/common/sessionsManagement.ts |
Defines managed canvas drafts and reference ownership. |
src/vs/workbench/contrib/sessions/browser/views/sessionsListActions.ts |
Excludes Canvases from section archive actions. |
src/vs/workbench/contrib/sessions/browser/views/sessionsList.ts |
Adds the Canvases section and nested pinned rows. |
src/vs/workbench/contrib/sessions/browser/sessionsManagementService.ts |
Routes draft creation and waits for canvas publication. |
src/vs/workbench/contrib/sessions/browser/sessionsConfiguration.ts |
Registers the default-off experimental setting. |
src/vs/sessions/SESSIONS.md |
Documents canvas-first session lifecycle and ownership. |
src/vs/sessions/SESSIONS_LIST.md |
Documents sidebar placement and catalog behavior. |
src/vs/sessions/services/sessions/test/browser/sessionsManagementService.test.ts |
Tests draft publication and observation ownership. |
src/vs/sessions/services/sessions/test/browser/sessionNavigation.test.ts |
Updates the management-service mock. |
src/vs/sessions/contrib/sessions/test/browser/sessionsList.test.ts |
Tests section visibility, placement, and pinned rows. |
src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts |
Tests canvas draft creation, opening, and cleanup. |
src/vs/sessions/contrib/canvases/test/browser/sessionCanvasCatalogService.test.ts |
Tests catalog filtering and persistence. |
src/vs/sessions/contrib/canvases/electron-browser/sessionCanvases.contribution.ts |
Registers the catalog service and new action. |
src/vs/sessions/contrib/canvases/electron-browser/sessionCanvasActions.ts |
Exports discovery entries for picker reuse. |
src/vs/sessions/contrib/canvases/electron-browser/newCanvasSessionAction.ts |
Adds the picker and start, pin, and display flow. |
src/vs/sessions/contrib/canvases/common/sessionCanvas.ts |
Defines catalog APIs and canvas eligibility. |
src/vs/sessions/contrib/canvases/browser/sessionCanvasCatalogService.ts |
Persists eligible canvas types per profile. |
src/vs/platform/agentHost/test/node/copilotAgent.test.ts |
Tests draft listing, runtime reuse, and restart behavior. |
src/vs/platform/agentHost/test/node/agentService.test.ts |
Tests protection from unused-draft collection. |
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts |
Adds bounded waiting for extension registration. |
src/vs/platform/agentHost/node/copilot/copilotAgent.ts |
Enables canvas discovery and opening in workspace-less drafts. |
src/vs/platform/agentHost/node/agentService.ts |
Marks materialized sessions as used before their first turn. |
src/vs/platform/agentHost/node/agentHostStateManager.ts |
Exposes the session-used marker for materialization. |
Review effort: Balanced
- A draft whose canvas extension asked for consent while it listed canvases now starts before it asks, so the user's answer reaches an initialized chat and the session is announced. - Waiting for a draft's canvas to publish stops, and releases its observation, when the sessions management service is disposed. - New Canvas is also offered from the Canvases section's context menu, like other section creation actions. Co-authored-by: Copilot <[email protected]>
…e the list reads Co-authored-by: Copilot <[email protected]>
Ladislau Szomoru (lszomoru)
approved these changes
Nov 22, 2026
Ulugbek Abdullaev (ulugbekna)
deleted the
ulugbekna/canvas-first-sessions-v2
branch
November 22, 2026 18:35
This was referenced Nov 23, 2026
Wing K.Y (wingwkyuen)
pushed a commit
to tcgoidc/vscode
that referenced
this pull request
Nov 24, 2026
…icrosoft#349986) * fix(sessions): reconnect pinned canvases of a canvas-first session after a reload A session started from the Canvases section has no turn, so its Copilot runtime persists no history and the chat stays a draft on the host, also after a restart. Once its runtime was released (a window reload, or turning canvases off and on), its pinned canvas stayed "Not connected": - The host restores released canvases only for a contributing client, and only the focused session gets one; showing a pin never contributed. - Restoring the canvases of a draft was rejected, and a draft's next launch did not take over its released canvases. A reconnecting pin now contributes this client to its session and keeps observing its chat until the canvas has a source, observing the canvas again when an earlier observation failed while the session was released. The host lets a workspace-less draft restore and close its canvases, and the launch that materializes a draft takes over the canvases its released runtime had open. Reopening a handed-over canvas waits for a just-launched runtime to register it, and a canvas closed while released is no longer reopened. Found while verifying microsoft#349746, a follow-up to microsoft#349654. Co-authored-by: Copilot <[email protected]> * fix(agentHost): retry a restored canvas open on each registry change until one deadline Another extension's registry change could consume the only retry while the restored canvas was still unregistered. Each attempt now waits on a fresh listener, and unavailable opens retry until a shared deadline. Also cover restoring a released canvas-first draft without a send: a window that observes and contributes to the chat brings its canvas back with a source while no runtime receives a send. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
Ulugbek Abdullaev (ulugbekna)
added a commit
that referenced
this pull request
Nov 24, 2026
…fter a reload (cherry-pick #349986) (#350071) Reconnect pinned canvases of a canvas-first session after a reload (#349986) * fix(sessions): reconnect pinned canvases of a canvas-first session after a reload A session started from the Canvases section has no turn, so its Copilot runtime persists no history and the chat stays a draft on the host, also after a restart. Once its runtime was released (a window reload, or turning canvases off and on), its pinned canvas stayed "Not connected": - The host restores released canvases only for a contributing client, and only the focused session gets one; showing a pin never contributed. - Restoring the canvases of a draft was rejected, and a draft's next launch did not take over its released canvases. A reconnecting pin now contributes this client to its session and keeps observing its chat until the canvas has a source, observing the canvas again when an earlier observation failed while the session was released. The host lets a workspace-less draft restore and close its canvases, and the launch that materializes a draft takes over the canvases its released runtime had open. Reopening a handed-over canvas waits for a just-launched runtime to register it, and a canvas closed while released is no longer reopened. Found while verifying #349746, a follow-up to #349654. * fix(agentHost): retry a restored canvas open on each registry change until one deadline Another extension's registry change could consume the only retry while the restored canvas was still unregistered. Each attempt now waits on a fresh listener, and unavailable opens retry until a shared deadline. Also cover restoring a released canvas-first draft without a send: a window that observes and contributes to the chat brings its canvas back with a source while no runtime receives a send. --------- (cherry picked from commit 25e7ea7) Co-authored-by: Copilot <[email protected]>
This was referenced Nov 24, 2026
Closed
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.


Why
In the Agents window, a canvas can only be opened from a chat that has already been started, so trying one means sending a message first. This lets a user start a session from a canvas instead, from a Canvases section in the sidebar.
What changed
ISessionsProvider.createCanvasDraft/ISessionsManagementService.createCanvasDraftreturn an unlisted quick chat that lists canvases and opens one, starting the session under the canvas name. The Agent Host provider shares the session-starting code that a first send already runs. Disposing the draft, or a canvas failing to open, leaves nothing behind.ISessionCanvasCatalogServiceremembers the last listed canvas types per profile, so the picker fills in immediately.sessions.list.canvasesSectionsetting (off by default), pinned canvases move under a Canvases header right after Automations, indented one level. With a separate navigation list, the header and its pins are rows of that list; otherwise it is a collapsible section of the sessions tree. Its New Canvas... action, on the header's toolbar and context menu, picks a canvas, starts a session with it without a message, pins it and shows it full-page. With the setting off, the sidebar is unchanged.Recording: New Canvas → Kusto, New Canvas → Session timeline, switch between pins
Scope
Workspace-less (quick chat) sessions on the local Agent Host only. A draft with a workspace still waits for its first send, which creates its worktree. Only canvases from user or plugin extensions that open without input are offered.
Tradeoffs
Verification
./scripts/test.sh --runsessions list, canvas catalog, sessions management, session navigation, local Agent Host provider and pinned canvas suites: 1847 passing../scripts/test.sh --run copilotAgent.test.ts --run agentService.test.ts --grep "canvas|GC-disposed|warm": 102 passing, including new tests for listing in a draft, waiting for a late extension, a stuck extension, and consent requested while a draft lists canvases../scripts/test.sh --run sessionsManagementService.test.ts --grep "canvas draft": 2 passing, including disposal while a draft's canvas is unpublished.pnpm run typecheck-client,pnpm run oxlinton the changed files andpnpm run valid-layers-check: clean.main. With it on, New Canvas... lists canvases without any chat, cancelling discards the draft, and picking Kusto then Session timeline starts two sessions without a message, pins both and switches between them. After review fixes, right-clicking the Canvases header offers New Canvas..., which opens a Session timeline canvas in a new session. Withsessions.sidebar.separateNavigationon, Canvases sits under Automations in the navigation list, choosing it opens the picker, and the new pin shows indented under it.