Repository navigation
agentHost: treat dormant canvas extensions as enabled and settled - #347629
Merged
Ulugbek Abdullaev (ulugbekna) merged 2 commits intoNov 11, 2026
Merged
Ulugbek Abdullaev (ulugbekna) merged 2 commits into
Ulugbek Abdullaev (ulugbekna) merged 2 commits into
Conversation
The Copilot runtime now reports `dormant` for extensions that declare their tools and canvases in an `extension.json` sidecar and start on first use. VS Code mapped the status to `unknown`, so the Canvases view labeled their canvases "Not Active" and never pruned their stale cached canvases. Pass `dormant` through the agent host and the AHP client, and treat it like `running` when merging duplicate inventory entries, confirming an enable after reconciliation, and pruning cached canvas definitions. Co-authored-by: Copilot <[email protected]>
Federico Brancasi (federicobrancasi)
previously approved these changes
Nov 11, 2026
Ulugbek Abdullaev (ulugbekna)
enabled auto-merge (rebase)
November 11, 2026 14:24
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open issue
What changed in this PR
This PR updates VS Code’s agent host integration to treat dormant Copilot runtime extensions as enabled/settled (like running), ensuring canvases from lazy extensions appear “ready” and cached canvases are pruned correctly.
Changes:
- Add
dormanttoAgentExtensionStatusand propagate it through the protocol/client instead of mapping tounknown. - Introduce and reuse
isAgentExtensionEnabledAndSettledto treatrunning/dormantequivalently for reconciliation, inventory merge, and canvas-cache pruning. - Expand/adjust tests and spec text to cover
dormantbehavior.
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/browser/aiCustomization/copilotCustomizationsWidget.test.ts | Extends widget tests to cover pruning behavior for dormant inventories. |
| src/vs/workbench/contrib/chat/browser/aiCustomization/copilotCustomizationsWidget.ts | Uses the new helper so dormant extensions are treated as enabled/settled when pruning cached canvases. |
| src/vs/sessions/copilot-customizations-spec.md | Updates spec to document dormant and its semantics. |
| src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts | Adds coverage for listing dormant extensions and canvases without waiting for startup. |
| src/vs/platform/agentHost/test/node/copilotAgent.test.ts | Adds merge/reconcile scenarios involving dormant. |
| src/vs/platform/agentHost/test/electron-browser/agentHostProtocolClient.test.ts | Adds protocol parsing/forwarding coverage for dormant. |
| src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts | Maps runtime status strings to include dormant. |
| src/vs/platform/agentHost/node/copilot/copilotAgent.ts | Uses helper for merge + reconciliation logic around dormant. |
| src/vs/platform/agentHost/common/agentService.ts | Re-exports isAgentExtensionEnabledAndSettled. |
| src/vs/platform/agentHost/common/agent.ts | Adds dormant to the status union and defines isAgentExtensionEnabledAndSettled. |
| src/vs/platform/agentHost/browser/agentHostProtocolClient.ts | Allows dormant through when decoding status from the wire. |
Review effort: Lite
Copilot stopped reviewing on behalf of
Ulugbek Abdullaev (ulugbekna) due to an error
November 11, 2026 14:37
This was referenced Nov 11, 2026
Joaquín Ruales (jruales)
previously approved these changes
Nov 11, 2026
The comment sat above the whole status chain but only described the case where a `running` and a `dormant` copy merge, so it read as if it applied to every branch. Co-authored-by: Copilot <[email protected]>
Ulugbek Abdullaev (ulugbekna)
dismissed stale reviews from Joaquín Ruales (jruales) and Federico Brancasi (federicobrancasi)
via
November 11, 2026 17:05
6004c37
Federico Brancasi (federicobrancasi)
approved these changes
Nov 11, 2026
Ulugbek Abdullaev (ulugbekna)
deleted the
ulugbekna/agents/implement-dormant-extension-status
branch
November 11, 2026 17:17
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.

The Copilot runtime can now start an extension lazily (github/copilot-agent-runtime#28873). An extension that declares its tools and canvases in an
extension.jsonsidecar with"initialization": "module"is advertised without starting its process, and it starts on first tool use or canvas open. Until then,session.extensions.listreports it asdormant, a status that means the extension is enabled.VS Code mapped
dormanttounknown, as #347239 notes. As a result, the Canvases view labeled these canvases Not Active although they are ready to open. It also never pruned their stale cached canvases.Changes
dormantthrough instead of turning it intounknown. Older clients still map it tounknown, and hosts that never send it are unaffected.isAgentExtensionEnabledAndSettled, treatsrunninganddormantalike. It is used in three places:dormantafter reconciliation, so it now counts as applied instead of failed.runninganddormant, the merged status is nowrunninginstead ofunknown. Other combinations merge as before.startingextensions, so a dormant extension doesn't delay it. An inventory read without a live chat still reportsunknown, because only a live chat knows whether an extension is dormant.How to test
COPILOT_HOMEto an empty folder and createextensions/dormant-demo/inside it with the two files below.chat.canvases.enabled, and start a Copilot chat in the Agents window. Don't open any canvas yet.dormant-demoprocess has started. Each extension launch writes alogs/process-*.logfile whose first line names the extension module.Demo extension files
extension.json:{ "version": 1, "initialization": "module", "canvases": [ { "id": "dormant-demo", "displayName": "Dormant Demo", "description": "Checks lazy canvas activation." } ] }extension.mjs, which reuses the declarations fromextension.jsonso they can't drift:Demo, recorded in a dev build of the Agents window: https://raw.githubusercontent.com/ulugbekna/screenshots/main/attachments/2026/11/11/dormant-canvas-extension.mp4
Validation
./scripts/test.sh --reporter dot --run src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts --run src/vs/platform/agentHost/test/node/copilotAgent.test.ts --run src/vs/platform/agentHost/test/electron-browser/agentHostProtocolClient.test.ts --run src/vs/workbench/contrib/chat/test/browser/aiCustomization/copilotCustomizationsWidget.test.ts: passed (3206 passing, 1 existing pending). With the source changes reverted, the 5 new tests fail.npm run typecheck-client: passednpm run eslint -- <changed TypeScript files>: passeddormant. It moved torunningwhen the canvas was first opened, and went todisabledand back todormantwhen toggled before first use. This check ran before the branch was updated to currentmain; the update conflicted only on an import line.Note
In a chat that had already opened the canvas, disabling and re-enabling the extension started it immediately instead of leaving it
dormant. This happened even after the canvas tab was closed. That is runtime behavior that this PR doesn't change, and I haven't confirmed whether the runtime intends it.