Skip to content

agentHost: bump Copilot SDK to 2.0.4 - #351277

Draft
TylerLeonhardt wants to merge 3 commits into
mainfrom
TylerLeonhardt/copilot-sdk-2.0.4
Draft

TylerLeonhardt wants to merge 3 commits into
mainfrom
TylerLeonhardt/copilot-sdk-2.0.4

Conversation

@TylerLeonhardt

@TylerLeonhardt TylerLeonhardt commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Bundle @microsoft/copilot-sdk 2.0.4 and runtime 1.0.117 (release notes), and adapt the Agent Host to the SDK's breaking changes. There is no tracking issue.

Changes

Area Change and reason
Root and remote package.json, pnpm-lock.yaml SDK 2.0.3 → 2.0.4 and runtime 1.0.116 → 1.0.117. Only the SDK and its eight platform packages change in the lockfiles.
Extension approval The runtime replaced extension-permission-access with extension-launch: it asks before an extension's process starts and no longer names capabilities. The host adds a launch consent kind with its own wording in the turn and in the canvas dialog, and remembers the decision under the extension identity. The capabilities kind stays readable for hosts that still send it.
Accounts The runtime identifies accounts by accountId instead of selectionId, and no longer reports authSelectionId.
Entra identity The runtime requires the tenant, so an identity is returned once an ID token has named it. This is the replacement the code already planned for this SDK.
Slash commands Fix: a runtime slash command sent as the first message hung when an extension that starts with the session still waited for approval. The runtime holds the command listing until that extension starts, so its request must be answerable in that turn.
Canvas retry Fix: retrying a canvas after declining its environment variable request reported a generic failure instead of a decline kept for the session, because the extension's launch request counted as the runtime asking again.

Behavior changes to review

  • Every Copilot extension asks to start once, including project extensions in trusted folders that did not ask before. An extension that starts with the session asks in the first turn.
  • Decisions stored for requested capabilities no longer apply, so those extensions ask once more.
  • Always Allow for a project: extension is keyed by its name, as capability decisions were.
  • A Microsoft account whose credential carries no ID token gets no identity until one names the tenant.

SDK bump checklist

  • New built-in tools: none. copilotBuiltinToolAllowlist.integrationTest.ts passes unchanged.
  • Prompt baselines: unchanged.
  • Managed settings schema: adds the sandbox network setting extraCaCertificates. No tool-related settings.
  • New session and tool options (exposure, onlyOverridesBuiltInTool, maxToolTurns, sessionLifecycleMode, resolveSessionFsProvider, sessionHandoff) are optional and keep their defaults. None is on by default.

How to test

  1. In a trusted folder with a project extension under .github/extensions, open one of its canvases. The dialog asks to start the extension, and Always Allow stops it from asking again.
  2. With an extension that starts with the session, send /env as the first message. The turn asks to start the extension, then shows the command output.

Validation

Run locally on macOS arm64.

  • pnpm run typecheck-client: passed.
  • pnpm run oxlint <changed TypeScript files>: passed.
  • Unit tests, passed (4973 tests):
    ./scripts/test.sh --run src/vs/platform/agentHost/test/node/copilotAgent.test.ts \
      --run src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts \
      --run src/vs/platform/agentHost/test/node/agentService.test.ts \
      --run src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts \
      --run src/vs/platform/agentHost/test/node/copilotEntraAuthentication.test.ts \
      --run src/vs/platform/agentHost/test/node/copilotAccountService.test.ts \
      --run src/vs/platform/agentHost/test/node/sessionPermissions.test.ts \
      --run src/vs/platform/agentHost/test/node/serverToolGroups.test.ts \
      --run src/vs/platform/agentHost/test/node/toolSearchDeferral.test.ts \
      --run src/vs/workbench/contrib/canvases/test/common/agentHostCanvasConsent.test.ts
  • Copilot provider integration tests against the bundled runtime, passed (120 tests, 1 pending):
    ./scripts/test-integration.sh --runGlob "**/agentHost/test/node/{providerIntegration/,}copilot*.integrationTest.js"
  • ./scripts/test-agent-host-e2e.sh, two full runs:
    • The first run passed every suite except Copilot managed settings, which exposed the slash command hang fixed here. That suite passes with the fix.
    • The second run passed 8 of 10 suite processes. Two restart tests failed in teardown on an unrecorded GET /api/events replay request. Both pass when run alone, twice each, and the 2.0.3 runtime contains the same request path, so this does not look specific to the bump.
  • Cross-platform Azure validation, the CI pipeline run on this branch:
    • The 🧪 Run Agent Host E2E tests (Electron) task passed on Windows, Linux and macOS, with every suite process passing on each platform and no unrecorded replay request.
    • The integration, smoke, browser and remote, and Copilot test jobs passed on all three platforms.
    • The six unit test jobs failed with the failure that main has at this branch's base commit: AgentFeedbackEditorInputContribution throws Cannot read properties of undefined (reading 'onDidChangeFeedbackScope') in editor tests, and the other failures are its knock-on effects (console output, leaked disposables, repeated done()). No failing test is in a suite this change touches.

Bundle @microsoft/copilot-sdk 2.0.4 and runtime 1.0.117, and adapt the
Agent Host to the SDK's breaking changes:

- Extension approval: `extension-permission-access` became
  `extension-launch`. Extensions now ask to start, so the host adds a
  `launch` consent kind with its own wording and remembers the decision
  under the extension identity instead of its capability list.
- Accounts: the runtime identifies accounts by `accountId` instead of
  `selectionId`, and no longer reports `authSelectionId`.
- Entra identity: the runtime requires the tenant, so an identity is
  returned once an ID token has named it.

Two host issues that the new launch request exposed are fixed:

- A runtime slash command sent as the first message hung when an
  extension that starts with the session still waited for approval,
  because the runtime holds the command until that extension starts.
- Retrying a canvas after declining its environment variable request
  reported a generic failure instead of a decline kept for the session.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 30, 2026 18:10

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

A stale permission mode after an idle switch from Allow All to Default can let /env approve queued extension launches or sensitive-environment requests without user consent.

1 open issue
2 files not reviewed
  • pnpm-lock.yaml: Generated file
  • remote/pnpm-lock.yaml: Generated file
What changed in this PR

Updates VS Code’s Agent Host to Copilot SDK 2.0.4 and runtime 1.0.117, adapting extension consent and Microsoft authentication to the new SDK contracts.

Changes:

  • Aligns desktop and remote dependency versions and refreshes the managed-settings schema snapshot.
  • Adds extension-launch consent, enables consent during slash-command startup, and refines canvas retry reporting.
  • Migrates account selection to accountId, requires tenant-aware Entra identities, and updates related tests.
File Description
src/​vs/​workbench/​contrib/​canvases/​test/​common/​agentHostCanvasConsent.test.ts Tests launch-consent dialog and denial wording.
src/​vs/​workbench/​contrib/​canvases/​common/​agentHostCanvasConsent.ts Adds canvas launch-consent messages.
src/​vs/​platform/​agentHost/​test/​node/​sessionPermissions.test.ts Updates the extension permission kind.
src/​vs/​platform/​agentHost/​test/​node/​providerIntegration/​copilotNativeExtensions.integrationTest.ts Handles and verifies native extension launch consent.
src/​vs/​platform/​agentHost/​test/​node/​providerIntegration/​copilotMockLlm.integrationTest.ts Verifies launch consent before environment consent.
src/​vs/​platform/​agentHost/​test/​node/​providerIntegration/​copilotExtensionEnvConsent.integrationTest.ts Approves launch before testing environment access.
src/​vs/​platform/​agentHost/​test/​node/​providerIntegration/​copilotAccountContext.integrationTest.ts Updates account identifiers and tenant-bearing credentials.
src/​vs/​platform/​agentHost/​test/​node/​e2e/​KNOWN_ISSUES.md Documents retained declines in runtime 1.0.117.
src/​vs/​platform/​agentHost/​test/​node/​copilotSessionLauncher.test.ts Migrates the account fixture to accountId.
src/​vs/​platform/​agentHost/​test/​node/​copilotEntraAuthentication.test.ts Tests tenant-required identities and recovery.
src/​vs/​platform/​agentHost/​test/​node/​copilotEntraAuthentication.integrationTest.ts Updates transport tests for tenant-aware authentication.
src/​vs/​platform/​agentHost/​test/​node/​copilotAgentSession.test.ts Covers launch consent and blocked slash-command startup.
src/​vs/​platform/​agentHost/​test/​node/​copilotAgent.test.ts Updates account and identity fixtures.
src/​vs/​platform/​agentHost/​test/​node/​copilotAccountService.test.ts Adapts account-selection mocks to the SDK contract.
src/​vs/​platform/​agentHost/​test/​node/​agentService.test.ts Updates expected Microsoft identities.
src/​vs/​platform/​agentHost/​test/​node/​__snapshots__/​Copilot_SDK_-_managed_settings_bundled_managedSettings_schema_matches_the_snapshot.schema.json Records the additional CA certificate setting.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotToolDisplay.ts Maps the new extension-launch permission kind.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotEntraAuthentication.ts Requires a known tenant when returning an identity.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotAgentSession.ts Adapts consent handling and slash-command prompt readiness.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotAgent.ts Distinguishes retried consent from other extension requests.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotAccountService.ts Selects and verifies accounts using accountId.
src/​vs/​platform/​agentHost/​common/​copilotAccountContext.ts Renames the shared account identifier field.
src/​vs/​platform/​agentHost/​common/​agentHostSchema.ts Updates approval-setting documentation for launch consent.
src/​vs/​platform/​agentHost/​common/​agent.ts Adds launch consent while retaining legacy capability consent.
remote/​pnpm-lock.yaml Locks remote SDK platform packages to 2.0.4.
remote/​package.json Updates remote SDK and runtime declarations.
pnpm-lock.yaml Locks root SDK platform packages to 2.0.4.
package.json Updates root SDK and runtime declarations.

Review effort: Balanced

TylerLeonhardt and others added 2 commits November 30, 2026 10:59
…ile idle

A turn that runs a runtime command does not apply a permission mode that
changed while the chat was idle, so an extension request waiting for that
turn could be approved under the earlier Allow All. Allow All now approves
such a request only while it is both applied and still selected.

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

Loading the class registered it for every editor, so its test made
unrelated editor tests fail when they created an editor without the
feedback service.

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants