Repository navigation
[release/1.148] Reconnect pinned canvases of a canvas-first session after a reload (cherry-pick #349986) - #350071
Merged
Ulugbek Abdullaev (ulugbekna) merged 1 commit intoNov 24, 2026
Conversation
…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. 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]> (cherry picked from commit 25e7ea7)
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Selecting a disconnected pin from another view can release the chat observation and cancel reconnection before its page opens, leaving it Not connected; the selection transaction needs correction and a regression test.
1 open issue
What changed in this PR
Backports #349986 to release/1.148 so pinned canvases from canvas-first sessions can reconnect after a reload or a canvases setting toggle, without opening their chat.
Changes:
- Keeps reconnecting pins observing their chat and contributing the client until the canvas has a live source.
- Restores canvases for workspace-less drafts, retries delayed registration, and preserves deferred closes.
- Adds regression coverage and documents the reconnection lifecycle.
| File | Description |
|---|---|
src/vs/workbench/contrib/sessions/providers/agentHost/browser/baseAgentHostSessionsProvider.ts |
Publishes client contributions while observing a pin’s chat. |
src/vs/workbench/contrib/sessions/common/sessionsProvider.ts |
Documents the expanded chat-observation contract. |
src/vs/sessions/SESSIONS.md |
Describes pin reconnection and draft canvas restoration. |
src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts |
Tests contribution publication when observing inactive chats. |
src/vs/sessions/contrib/canvases/test/browser/pinnedCanvasService.test.ts |
Tests observation retention until a canvas gains a source. |
src/vs/sessions/contrib/canvases/browser/pinnedCanvasService.ts |
Retains restoration observations and retries failed canvas subscriptions. |
src/vs/platform/agentHost/test/node/copilotAgent.test.ts |
Covers draft restoration, first-send handoff, and deferred closes. |
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts |
Retries canvas registration and keeps deferred closes effective. |
src/vs/platform/agentHost/node/copilot/copilotAgent.ts |
Enables draft restore/close operations and transfers released canvases to replacement runtimes. |
Review effort: Balanced
Ulugbek Abdullaev (ulugbekna)
enabled auto-merge
November 24, 2026 09:55
Ulugbek Abdullaev (ulugbekna)
disabled auto-merge
November 24, 2026 09:55
Ulugbek Abdullaev (ulugbekna)
enabled auto-merge (squash)
November 24, 2026 09:55
Benjamin Christopher Simmonds (benibenj)
approved these changes
Nov 24, 2026
Ladislau Szomoru (lszomoru)
approved these changes
Nov 24, 2026
Ulugbek Abdullaev (ulugbekna)
merged commit Nov 24, 2026
661626d
into
release/1.148
52 checks passed
Ulugbek Abdullaev (ulugbekna)
deleted the
ulugbekna/cherry-pick-349986-1.148
branch
November 24, 2026 10:26
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.

Backports #349986 to
release/1.148. Refs #349746, a follow-up to #349654, which is already inrelease/1.148.A pinned canvas of a session started from the Canvases section, with no message sent, stayed Not connected after Developer: Reload Window or after turning
chat.canvases.enabledoff and on. Selecting the pin now brings it back Live without opening its chat:Cherry-picked merged commit
25e7ea7b8ff47efaf5dd69ee2645f1ed1962ed2cwithgit cherry-pick -x; it applied cleanly.Validation
On this branch:
pnpm run typecheck-client: passed../scripts/test.sh --run src/vs/platform/agentHost/test/node/copilotAgent.test.ts --run src/vs/platform/agentHost/test/node/agentService.test.ts --run src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts --run src/vs/sessions/contrib/canvases/test/browser/pinnedCanvasService.test.ts --run src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts --run src/vs/sessions/services/sessions/test/browser/sessionNavigation.test.ts --run src/vs/sessions/contrib/canvases/test/browser/canvasActivityBar.test.tsafterpnpm run transpile-client: passed, 5086 tests.Not run on this branch: the Agents window scenarios, which #349986 verified on
main. The local install could not fetch the Copilot SDK version this branch pins, so the full build was not run.