Skip to content

agentHost: run project canvas extensions only in trusted folders - #343771

Merged
Ulugbek Abdullaev (ulugbekna) merged 8 commits into
mainfrom
ulugbekna/agents/canvas-production-readiness-priorities
Nov 22, 2026
Merged

Ulugbek Abdullaev (ulugbekna) merged 8 commits into
mainfrom
ulugbekna/agents/canvas-production-readiness-priorities

Conversation

@ulugbekna

@ulugbekna Ulugbek Abdullaev (ulugbekna) commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Replaces #342372, which was reverted in #342684.

What and why

Project canvas extensions (.github/extensions/<name>/extension.mjs) are code from the repository, but the Copilot Agent Host launched them in any folder a live session used, whether or not the user trusted it. A session's runtime often starts without passing VS Code's trust prompt: showing a restored chat, listing canvases and MCP App results all resume it.

This PR makes the host decide every project extension launch against VS Code workspace trust, keeps running sessions in step when trust changes, and lets a worktree the host creates inherit its repository's trust, following the rule #343403 set for the runtime's own trust grant. VS Code Workspace Trust stays the only trust store; the host keeps no trust records of its own.

Relation to #343403: that PR forwards trust to the Copilot runtime as a create-time trustWorkingDirectory: 'session' grant, which governs repository plugins, hooks, MCP servers and instructions inside the runtime, and cannot be granted on resume or updated while a session runs. This PR covers project canvas extensions, which the host itself launches through the SDK's extension launch provider, on every create and resume and live as trust changes.

Out of scope, tracked as Milestone 2: repository code that can still run when a runtime resumes in an untrusted folder, and loading chat history without starting a runtime.

Review guide

The PR has three main commits, then four small commits answering the Copilot review and one answering a second Astra review. Each commit builds and passes its tests, and reviewing commit by commit is recommended. Further hardening of revocation from that review is left to a follow-up (see Known limitations).

1. agentHost: launch project canvas extensions only in trusted folders (+567/-96)

The security gate. Start with CopilotProjectExtensionLaunchPolicy in src/vs/platform/agentHost/node/copilot/copilotProjectExtensionLaunchPolicy.ts; copilotAgent.ts only swaps its previous inline admission for the policy.

  • The SDK's launch request carries no session id, so admission is host-wide: an extension launches only from a folder some live session admits and that workspace trust covers.
  • Missing trust information refuses every launch. Disabled workspace trust keeps today's behavior.
  • Admitted roots, trusted folders and the entrypoint are compared by canonical (realpath) form, and the canonical entrypoint is what launches, so a symlink cannot escape the folder.
  • The only exemption is a workspace-less chat's own scratch folder, and only as a direct child of ~/.copilot/chats (_acquireProjectExtensionLaunchAdmission). That folder is shared with other Copilot clients, hence the exact check.

Worth scrutinizing: _isLaunchTrusted (re-evaluates when trust changes while roots resolve) and _canonicalTrustedRoot (caches only resolved roots, so a trusted folder created later is honored). The policy compares canonical paths instead of using the shared isAgentHostWorkspaceTrusted helper: a symlink or path alias (for example /var and /private/var on macOS) must not decide a launch.

2. agentHost: reconcile project canvas extensions when workspace trust changes (+549/-16)

The runtime asks the policy only when it starts an extension, so this commit applies trust changes to running sessions.

  • updateTrust classifies a change as an expansion, a contraction or neither (reordering). A Throttler pass in copilotAgent.ts applies accumulated changes; changes arriving mid-pass coalesce into one more pass.
  • Contraction: the policy re-checks the launches it allowed (reconciliationFor), and only sessions running an extension whose launch lost trust reload. Removing an unrelated folder restarts nothing.
  • Expansion: sessions with a refused extension call the SDK's host-only extensions.reconcile() (main's CopilotAgentSession.reconcileExtensions). It saves no preference, respects the user's current enablement and leaves running extensions alone. extensions.enable was rejected because it saves a preference, and enable followed by reload double-launches the extension (both observed on the real runtime).
  • _initializeAndRegisterSession reconciles a session before and right after it registers, closing the window in which live-session reconciliation skips it.

3. agentHost: host-created worktrees inherit trust for canvas extensions (+129/-4)

#343403 lets the worktree Agent Host creates on a session's first send inherit its repository's trust for the runtime grant, because VS Code itself trusts that worktree only after the session reports it. This commit applies the same rule to project canvas extensions, so the worktree's canvases work on its first turn.

  • The admission takes the launch plan's worktreeRepository (set by main's _createdWorktreeRepository). A module under that worktree is trusted while the repository is, by canonical path, and the worktree must be a strict descendant of <repo>.worktrees, as the launcher requires.
  • Revoking the repository's trust revokes the worktree's launches; the inheritance ends with the admission.
  • Worktrees created for other chats, and resumed sessions, get no inheritance, as with the runtime grant. Their extensions start once VS Code trusts the worktree, through commit 2's live reconciliation.

4–7. Copilot review follow-ups

Each fixes one Copilot review finding and adds a regression test; the tests for 6 and 7 fail on the earlier code.

  • 4. inherit worktree trust only for the session's working directory: only the worktree the host created as the working directory inherits its repository's trust. It must also be a worktree of that repository by canonical path, and additional directories need workspace trust of their own.
  • 5. exempt a scratch folder from trust only by canonical path: a link in ~/.copilot/chats that resolves elsewhere no longer gets the scratch-folder exemption.
  • 6. keep canvas revocation records across sessions' launch decisions: another session's launch decision, allowed or refused, no longer erases the record of an extension that is already running, so revoking trust still stops it.
  • 7. don't fail a session when retrying refused extensions fails: during initialization, a failed reconcile() after trust expanded is logged instead of aborting the session. A failed revocation still fails it.

8. Astra review follow-up

  • 8. separate canvas trust revocation from retries, and stop at retiring sessions (+157/-31): a failed retry of refused extensions no longer fails initialization just because some other extension's trust was revoked elsewhere on the host. A reconciliation stops at a session that is retiring or whose runtime was replaced, so it can't act on a successor's runtime; destroying a session waits for its in-flight reconciliations first. Its regression tests fail on the earlier code.

How to test

Unit and integration tests were run from the branch with COPILOT_CLI_ENABLED_FEATURE_FLAGS unset. Agent shells set it, and an inherited DYNAMIC_AUTO_TIERS fails an unrelated CopilotAgent tiers test.

On the current base (main at 817607ae52b, @microsoft/copilot-sdk 2.0.1 with runtime 1.0.114, Node 24.22.1):

Commit Command Result
each pnpm run typecheck-client, and pnpm run oxlint on the commit's changed files passed
each ./scripts/test.sh --run src/vs/platform/agentHost/test/node/copilotProjectExtensionLaunchPolicy.test.ts --run src/vs/platform/agentHost/test/node/copilotAgent.test.ts 1,139 / 1,143 / 1,145 / 1,145 / 1,145 / 1,146 / 1,147 / 1,149 passing for commits 1–8, 1 pending each
each pnpm run build-fast --client-only passed
8 (tip) the policy, CopilotAgent, CopilotAgentSession and CopilotSessionLauncher suites together 3,202 passing, 1 pending
8 (tip) ./scripts/test-integration.sh with --run for providerIntegration/copilotMockLlm, providerIntegration/copilotExtensionEnvConsent, providerIntegration/copilotNativeExtensions, copilotSdkCanvas and e2e/providers/copilotManagedSettingsAgentHostE2E (.integrationTest.ts, under src/vs/platform/agentHost/test/node/) 31 passing
8 (tip) pnpm run valid-layers-check and git diff --check passed

The canvas integration tests passed in both integration runs on this base, the second after the last change to commit 2. To rerun only them:

./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/providerIntegration/copilotMockLlm.integrationTest.ts --grep "loads a project extension through the client-resolved SDK|launches a blocked project canvas extension only after|asks in the turn before a lazy extension"

The real-runtime test for commit 2 uses an append-only launch log written by the extension itself: no launch before trust, exactly one launch when trust is granted (no host restart), the launched process exits when trust is revoked, and nothing relaunches afterwards.

The first per-commit run, at commit 1 right after a fresh build, hit the 5-second after each cleanup timeout in main's "createChat infers workspace-less from omitted workingDirectories" test while the machine was loaded (198 tests in four minutes). The branch doesn't change that test. Both reruns at commit 1 passed every test, in 20 seconds each.

Latest rebase: the branch is now on main at 817607ae52b. Changes on main that the branch adapts to:

  • agentHost: migrate to Microsoft Copilot SDK v2 #348894 moved to @microsoft/copilot-sdk v2, and the launch hook is now extensions.launchProvider.resolve. Commit 1 answers that hook with the policy. Main's inline launch check hadn't changed since the previous base, so the policy still covers everything it did. The trust test's extension fixture imports @microsoft/copilot-sdk/extension, like main's fixtures. The runtime still resolves the old @github/copilot-sdk name.
  • agentHost: give the Copilot runtime the real path of a symlinked folder #349333 gives the runtime the real path of a symlinked working folder. The policy already compares admitted folders, trusted folders and entrypoints by real path, so its decisions don't change.

Other related changes on main were checked against the branch:

Earlier rebases adapted to these changes:

Code OSS verification (dev build of e35cab2a788 with @microsoft/copilot-sdk 2.0.1, macOS arm64, Agents window, local Copilot agent host against a mock LLM, Workspace Trust enabled): six UI scenarios run with the validate-ui-scenario runner, each checked against the agent host log and the protocol (AHP) log. Each project canvas extension appends its pid to a launch log, so launches are counted independently of the UI. In no run did an extension launch from a folder before that folder was trusted (scratch folders are exempt).

Main now prewarms new chats by default (#348611): once their folders are trusted, a draft's runtime, and with it its project extensions, starts before the first message. The checks in the first four rows count launches from the first message, so they ran with chat.agentHost.experimental.prewarmSessions off; the others ran with prewarming on, and the last row covers a prewarmed draft. Selectors were updated for main's new UI: canvases are under the editor's Add Tab → Canvas menu, and the trust dialog's button is now "Trust Folders". On this rebase the open-tab scenario also turned prewarming off, and its follow-up turn now cancels the trust dialog while the send is still pending. Its assertions are unchanged. The worktree and no-workspace scenarios each failed once while the machine was heavily loaded, once on a menu that redrew mid-click and once on an extension startup timeout with no trust denial. Both passed when rerun unchanged.

Scenario Result
Trusted folder: the extension launches once and its canvas is listed. Removing trust stops it ("Reloading extensions after workspace trust was revoked"), its relaunch is refused, and the canvas disappears. Reloading the window while untrusted does not revive it. Trusting again, without a restart, starts exactly one new process ("Reconciling extensions after workspace trust expanded") and the canvas returns. passed
Cold resume: "Restart Local Agent Host" while the folder is untrusted, then reopen the session. Reopening resumes the runtime even though the window's trust prompt was cancelled; the launch is refused during that resume, nothing starts, and no canvas is offered. passed
Two trusted folders, each with a session running its extension. Removing trust for one stops only that one, which does not relaunch; the other keeps the same pid. The log names only the revoked extension. passed
Open canvas tab: after trust is removed, the open tab shows "The canvas provider is temporarily unavailable". Reload Canvas, a follow-up turn and a cold resume start nothing ("launch denied because its workspace is not trusted"). Trusting again starts exactly one new process. passed
New worktree in a trusted repository: no vscode/requestWorkspaceTrust; the launcher logs "Granting the runtime 'session' trust … inherited from worktree repository", and the worktree's extension starts once on the first turn. passed
No-workspace session with trust enabled and nothing trusted: the extensions in the default chat's scratch folder and in a second chat's scratch folder both launch, and Manage Workspace Trust lists neither scratch folder. passed
Prewarming on, nothing sent: the prewarmed session starts the extension once the folder is trusted. Removing trust stops it about 1.4 seconds later ("Reloading extensions after workspace trust was revoked", then "launch denied because its workspace is not trusted") and nothing relaunches. Sending is then blocked by the window's trust prompt. passed

With prewarming on, a draft can launch its extension twice: once in the prewarmed session and again for the first message, when that message discards the prewarmed session ([warm] Discarded pre-warmed session … reason=clientToolsChanged, main's behavior). Re-trusting a folder while a draft is unsent shows the same pattern. Only one process is left running each time. For the no-workspace scenario, the isolated profile's home folder needs GIT_CEILING_DIRECTORIES when it sits inside a git checkout, otherwise the runtime discovers extensions at that checkout's root (see Known limitations).

CI pipeline: passed on this tip. Azure build 502140 succeeded on Windows x64, Linux x64 and macOS ARM64, including the Agent Host end-to-end, integration, unit, smoke and Copilot tests. All GitHub test checks passed.

Not covered: a chat whose folder changes during a session (workspace conversion) keeps its old admission until the runtime restarts at the next turn (see Known limitations).

Known limitations

  • extensions.reconcile() fails with method-not-found on older runtimes. The bundled runtime supports it; on failure the error is logged and the extension stays refused until the session restarts. There is deliberately no fallback to the saving extensions.enable.
  • extensions.reconcile() reports extension_reconciliation_lifecycle_failed whenever the launch provider refuses any extension in the chat, although it still applies the other starts and stops. Since Canvases: Verify canvas extension toggle outcomes #344904 and chat: Attribute Canvas refresh failures to the failing extension #345297, toggling a user or plugin canvas extension checks the outcome against the live inventory, and a refused project extension is listed as failed. Disabling one in an untrusted folder that has project extensions therefore stops it but shows "After disabling '…', this chat couldn't finish updating canvas extensions because '' failed to start". Enabling succeeds without an error. A real-runtime probe confirmed both on SDK 1.0.30, and again on @microsoft/copilot-sdk 2.0.1 (runtime 1.0.114). Any failing project extension already triggered this on main, but this branch makes refusals routine in untrusted folders. The fix belongs in the runtime: report a provider refusal as a non-fatal, blocked outcome (and a distinct status) instead of failing the whole reconciliation. Commit 2's trust-expansion retry hits the same failure when another extension stays refused, and only logs it.
  • Revocation matches running extensions by folder name, so two sessions with a same-named project extension both reload when one loses trust; the still-trusted one relaunches its extension.
  • Worktrees created for additional chats (createChat / setChatWorkspace / create_session with a worktree) and resumed worktree sessions get no inheritance, matching the runtime grant from Forward VS Code workspace trust to the Copilot runtime #343403. Their canvases start once VS Code trusts the worktree, which it does automatically for a worktree of a trusted repository that is one of the session's folders.
  • When a chat's folder changes during a session (workspace conversion), the runtime keeps its admission for the old folder until it restarts at the chat's next turn. Until then the old folder's canvases stay listed and openable, and the new folder's extensions cannot start. Workspace conversion immediately sends a continuation turn, so the window is normally short.
  • Windows/UNC paths and a real-runtime run with one trusted and one untrusted session are covered only by unit tests.
  • Revocation gaps the second Astra review found, left to a follow-up PR (or to Milestone 2's rule that no session stays live in an untrusted folder) to keep this one reviewable. Each needs an extension that is already running when trust is revoked:
    • A chat can run an extension from a folder another chat admitted, because the runtime discovers project extensions at a chat's git root and launch requests carry no session id. Once that other chat closes, revoking the folder's trust doesn't stop the extension.
    • When a scratch folder's exemption or a worktree's inherited trust ends, the extensions launched under it keep running; when one starts, refused launches aren't retried until the next trust change.
    • A failed reload after a revocation is only logged. Nothing confirms that the revoked extensions stopped, and no session or runtime restart follows.
  • Remote hosts whose trust is granted for the whole authority (for example cloud sandboxes) mirror no trusted folders today, so their project canvases are refused. Mirroring authority-level trust, and tracking which client's trust snapshot applies when several clients connect, is planned for Milestone 2.
  • A chat whose folder is a subfolder of a git repository has the repository root's project extensions refused as not admitted, because the runtime discovers them at the git root (this predates the branch). Likewise, a home folder inside a git repository changes where workspace-less chats discover extensions.

Follow-ups for the Copilot SDK/runtime, which would simplify this host logic: include the session id and discovery root in launch requests, report module identity in the extension inventory, and add a non-fatal "blocked" extension status for provider refusals.

Reviews

Before this PR, the changes were reviewed by Opus (claude-opus-5.5) and Astra (gpt-6-astra), both with 1M-token context and maximum reasoning. All seven findings were verified against the code and fixed; regression tests cover each. Three of Astra's findings concerned the earlier client-request version of commit 3, which the rebase replaced with #343403's inheritance rule.

Commit 8 comes from a second Astra review (gpt-6-astra, 1M-token context, maximum reasoning) split into design, correctness and security reviewers, with an independent code review alongside. Every finding was verified against the code. Its fixes for the other findings, listed under Known limitations, were reviewed to no remaining finding at Medium or above but moved to a follow-up to keep this PR reviewable. Remote hosts with authority-level trust are documented above as a Milestone 2 follow-up.

Copilot AI balanced review requested due to automatic review settings October 23, 2026 11:45
@ulugbekna
Ulugbek Abdullaev (ulugbekna) force-pushed the ulugbekna/agents/canvas-production-readiness-priorities branch from d5d5389 to b52ecd0 Compare October 23, 2026 11:54

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.

🟡 Changes recommended

Unresolved trust-boundary and revocation defects can allow untrusted extensions to run, and reconciliation failures can abort session initialization.

4 open issues
What changed in this PR

This PR restores trust gating for project canvas extensions in the Copilot Agent Host, complementing the runtime trust grant from #343403 while keeping VS Code Workspace Trust as the sole trust store.

Changes:

  • Adds canonical-path launch checks with scratch-folder and host-created worktree exemptions.
  • Reconciles extensions when trust changes, including during session initialization.
  • Adds policy, lifecycle, and real-runtime integration coverage.
File Description
src/​vs/​platform/​agentHost/​test/​node/​providerIntegration/​copilotMockLlm.integrationTest.ts Tests extension launch and shutdown across trust changes.
src/​vs/​platform/​agentHost/​test/​node/​copilotProjectExtensionLaunchPolicy.test.ts Covers launch admission, canonical paths, revocation, and inheritance.
src/​vs/​platform/​agentHost/​test/​node/​copilotAgent.test.ts Tests admission exemptions and session reconciliation.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotProjectExtensionLaunchPolicy.ts Implements launch authorization and revocation tracking.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotAgentSession.ts Applies trust changes through extension reload and reconciliation.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotAgent.ts Connects launch policy to configuration and session lifecycle.

Review effort: Balanced

@ulugbekna
Ulugbek Abdullaev (ulugbekna) force-pushed the ulugbekna/agents/canvas-production-readiness-priorities branch 2 times, most recently from 70c2dba to 18a1ebe Compare October 29, 2026 13:42
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Base: aeda4859 Current: e69d675e

No screenshot changes.

@ulugbekna
Ulugbek Abdullaev (ulugbekna) force-pushed the ulugbekna/agents/canvas-production-readiness-priorities branch 2 times, most recently from 6a166ab to 9745a14 Compare November 13, 2026 20:27
@ulugbekna
Ulugbek Abdullaev (ulugbekna) removed the request for review from Copilot November 16, 2026 20:58
@ulugbekna
Ulugbek Abdullaev (ulugbekna) force-pushed the ulugbekna/agents/canvas-production-readiness-priorities branch from 9745a14 to 3a0bdfa Compare November 16, 2026 21:08
@vs-code-engineering

This comment has been minimized.

@vs-code-engineering

Copy link
Copy Markdown
Contributor

Demo of 3a0bdfa

Revoking workspace trust removes the repository's project canvas from the Canvas menu.

Project canvas after workspace trust is revoked

Before (main) After (this pull request)
Main still offers Project Trust Demo in Restricted Mode after resuming the session.
Main still offers Project Trust Demo in Restricted Mode after resuming the session.
Project Trust Demo disappears as soon as the folder loses trust.
Project Trust Demo disappears as soon as the folder loses trust.

The change, on this pull request's build:

after.mp4
The same steps on main
before.mp4

Recorded by an agent on a build of this pull request merged with main, signed out, with a mock model. It can be wrong. Workflow run

Tip

Was this useful? React to this comment with 👍 or 👎.
On the VS Code team? Say what was wrong or missing.

@rwoll Ross Wollman (rwoll) added the pr-demo A PR demo was recorded for this pull request label Nov 17, 2026
Project canvas extensions (.github/extensions/*/extension.mjs) launched
from any folder a live session admitted, whether or not the user trusted
it. Move launch admission into CopilotProjectExtensionLaunchPolicy and
also require VS Code workspace trust, read from the mirrored root
configuration. This replaces the reverted #342372.

- Missing trust information refuses every project launch; disabled
  workspace trust keeps the previous behavior.
- Admitted roots, trusted folders and the entrypoint are compared by
  canonical path. A decision whose trust changes while roots resolve is
  re-evaluated, and the canonical entrypoint is what launches.
- Only a workspace-less chat's own scratch folder, a direct child of
  ~/.copilot/chats, is exempt: the agent created its contents.

An extension refused here stays refused until its session restarts; the
next commit reconciles running sessions when trust changes.

Co-authored-by: Copilot <[email protected]>
…hanges

The launch policy is consulted only when the runtime starts an extension,
so trust granted or revoked while a session runs had no effect until it
restarted. Reconcile live canvas sessions instead:

- Classify each trust change as an expansion, a contraction or neither
  (reordering), and apply changes in a throttled pass that coalesces
  changes arriving while a pass runs.
- On contraction, re-check the launches the policy allowed and reload only
  sessions running an extension whose launch lost trust. The reload
  relaunches through the policy, which refuses it.
- On expansion, call the host-only extensions.reconcile() in sessions with
  a refused extension. Unlike extensions.enable, it saves no preference,
  respects the user's current enablement and leaves running extensions
  alone.
- Reconcile a session that is still initializing before and right after
  it registers, so a trust change cannot fall between the two.

Every reconciliation RPC is time-bounded and logged.

Co-authored-by: Copilot <[email protected]>
The Copilot launcher already grants the runtime trust for the worktree
Agent Host creates on a session's first send when its repository is
trusted (#343403): VS Code itself trusts that worktree only after the
session reports it. Apply the same rule to project canvas extensions, so
a worktree's canvases work on its first turn instead of staying refused
until the client's trust arrives.

The launch policy takes the launch plan's worktreeRepository with the
session's admission. A module under that worktree is trusted while the
repository is, by canonical path; the worktree must be a strict
descendant of the repository's <repo>.worktrees folder, like the
launcher requires. Revoking the repository's trust revokes the
worktree's launches, and the inheritance ends with the admission.

Worktrees created for other chats, and resumed sessions, get no
inheritance, as with the runtime grant: their extensions start once VS
Code trusts the worktree, through the live reconciliation.

Co-authored-by: Copilot <[email protected]>
…ctory

Review follow-up. The launch policy let every admitted directory that is
a worktree of the session's repository inherit the repository's trust,
including additional working directories, which need not be the worktree
the host created or even a real worktree. The runtime grant from #343403
inherits only for the launch plan's working directory.

Pass the created worktree together with its repository, and let only that
directory inherit, when it is admitted and, both as given and by
canonical path, a worktree under the repository's <repo>.worktrees
folder. A link named like a worktree but resolving elsewhere no longer
inherits; additional directories need workspace trust of their own.

Co-authored-by: Copilot <[email protected]>
Review follow-up. The scratch-folder exemption checked the folder's
unresolved path, but admission records its canonical one. The default
chat's folder, ~/.copilot/chats/<session id>, is created with a recursive
mkdir that accepts an existing link, and the chats folder is shared with
other Copilot clients. A link there to an untrusted checkout would have
exempted that checkout's extensions from workspace trust, for every
session using it.

The policy now takes the scratch folder with the chats folder and grants
the exemption only while the folder is a direct child of the chats
folder both as given and by canonical path.

Co-authored-by: Copilot <[email protected]>
…isions

Review follow-up. The launch policy is shared by every session, but each
launch decision for an entrypoint first deleted that entrypoint's
allowed-launch record. If chat A runs a project extension and chat B
asks to launch it, revoking trust while B's decision resolves found no
record: B was refused and A kept running. A refused relaunch erased A's
record the same way, so a later revocation missed A too.

A launch decision now never removes a record; records are keyed by
entrypoint and canonical module and are dropped only once no live
session admits the module. A stale record can at most reload a session
running a same-named project extension, never miss a revocation.

Co-authored-by: Copilot <[email protected]>
Review follow-up. A trust expansion during a session's initialization
retries its refused project extensions with extensions.reconcile(). If
that rejected, for example on an older runtime without the method, the
error aborted an otherwise successful create or resume, while the live
and post-registration paths only log it.

Log a failed retry during initialization the same way: the extensions
stay refused. A failure while trust contracted still fails the session,
since a revoked extension may otherwise keep running.

Co-authored-by: Copilot <[email protected]>
… retiring sessions

Initialization failed a session whose retry of refused project extensions
failed whenever the same trust change revoked any extension on the host,
even one this session didn't run. A session now logs a failed retry
itself, and throws only when it can't stop an extension whose trust was
revoked, which still fails initialization.

A live reconciliation also kept sending requests to a session that a
configuration refresh was replacing, and the SDK addresses them by session
id, so they could reach the replacement. Reconciliation now stops once its
session starts retiring or changes runtime, and destroying a session lets
a reconciliation already in flight finish before it disconnects.

Co-authored-by: Copilot <[email protected]>
@ulugbekna
Ulugbek Abdullaev (ulugbekna) force-pushed the ulugbekna/agents/canvas-production-readiness-priorities branch from 3a0bdfa to e35cab2 Compare November 22, 2026 11:07
@ulugbekna
Ulugbek Abdullaev (ulugbekna) marked this pull request as ready for review November 22, 2026 12:50
@ulugbekna
Ulugbek Abdullaev (ulugbekna) added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 4269ce6 Nov 22, 2026
67 checks passed
@ulugbekna
Ulugbek Abdullaev (ulugbekna) deleted the ulugbekna/agents/canvas-production-readiness-priorities branch November 22, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-demo A PR demo was recorded for this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants