Repository navigation
agentHost: support copilotd metadata and schema controls - #339034
Merged
Merged
Conversation
Normalize VS Code and copilotd metadata behind host-neutral helpers and recognize the advertised session/model configuration keys. Preserve compatible outgoing metadata, retries, steering display records, and context usage across restoration. Keep generated declarations pinned without vendoring schemas, and add shared compatibility and real-handler wire regression coverage. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Preserved-ID retries can resurrect superseded Agent Host metadata on a later retry.
Review effort: Balanced
Findings: 1
What changed in this PR
Adds host-neutral support for VS Code and copilotd metadata, schema-driven session/model controls, and persistent expanded-prompt metadata.
Changes:
- Introduces public metadata adapters with private host-specific implementations and an ESLint boundary.
- Integrates usage, errors, tools, attachments, model configuration, approvals, and context occupancy.
- Preserves model-bound prompt metadata through retries, steering, serialization, and restoration.
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/test/common/model/chatModel.test.ts |
Tests metadata serialization. |
src/vs/workbench/contrib/chat/test/common/chatService/chatService.test.ts |
Tests retry metadata. |
src/vs/workbench/contrib/chat/test/common/chatErrorMessages.test.ts |
Tests copilotd errors. |
src/vs/workbench/contrib/chat/test/browser/widgetHosts/viewPane/chatContextUsageWidget.test.ts |
Tests reported occupancy. |
src/vs/workbench/contrib/chat/test/browser/widget/input/modelPicker/modelPickerConfiguration.test.ts |
Tests schema aliases. |
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostLanguageModelProvider.test.ts |
Tests Auto tiers. |
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostGenericConfigChips.test.ts |
Tests dedicated controls. |
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostClientTools.test.ts |
Tests tool preferences. |
src/vs/workbench/contrib/chat/common/tools/languageModelToolsService.ts |
Adds host tool preferences. |
src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.ts |
Persists metadata and usage. |
src/vs/workbench/contrib/chat/common/chatSessionsService.ts |
Adds request metadata contracts. |
src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts |
Propagates retry metadata. |
src/vs/workbench/contrib/chat/common/chatService/chatService.ts |
Extends usage diagnostics. |
src/vs/workbench/contrib/chat/common/chatErrorMessages.ts |
Renders copilotd errors. |
src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.ts |
Displays reported occupancy. |
src/vs/workbench/contrib/chat/browser/widget/input/modelPicker/modelPickerModelConfig.ts |
Selects advertised aliases. |
src/vs/workbench/contrib/chat/browser/chatDebug/agentHostUsageSidecar.ts |
Records call diagnostics. |
src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.ts |
Uses public usage metadata. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolUtils.ts |
Emits tool preferences. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModePickerPresentation.ts |
Supports approval bindings. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.ts |
Groups native Auto tiers. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostGenericConfigChips.ts |
Avoids duplicate controls. |
src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/remoteAgentHostSessionsProvider.test.ts |
Updates config fixture. |
src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostModePicker.test.ts |
Tests mutability handling. |
src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostClaudePermissionModePicker.test.ts |
Updates permission fixture. |
src/vs/sessions/contrib/providers/agentHost/test/browser/agentHost/agentHostPermissionPickerDelegate.test.ts |
Tests copilotd approvals. |
src/vs/sessions/contrib/providers/agentHost/browser/agentHostModePicker.ts |
Enforces schema writability. |
src/vs/sessions/contrib/providers/agentHost/AGENT_HOST_SESSIONS_PROVIDER.md |
Documents schema bindings. |
src/vs/platform/agentHost/test/node/sessionDatabase.test.ts |
Tests turn identity mapping. |
src/vs/platform/agentHost/test/node/fixtures/copilotdMetadata/user-message.copilot.visibility-vectors.json |
Adds visibility vectors. |
src/vs/platform/agentHost/test/node/copilotFailureTelemetry.test.ts |
Uses public error adapter. |
src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts |
Tests steering model text. |
src/vs/platform/agentHost/test/node/chatContributions.test.ts |
Tests model-text lifecycle. |
src/vs/platform/agentHost/test/common/sessionTestHelpers.ts |
Implements metadata lookup. |
src/vs/platform/agentHost/test/common/agentModelCallMeta.test.ts |
Tests call-detail normalization. |
src/vs/platform/agentHost/node/sessionDatabase.ts |
Reads metadata by identities. |
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts |
Uses expanded steering prompts. |
src/vs/platform/agentHost/node/copilot/copilotAgent.ts |
Updates metadata import. |
src/vs/platform/agentHost/node/codex/codexAgent.ts |
Updates metadata import. |
src/vs/platform/agentHost/node/claude/claudeAgent.ts |
Updates metadata import. |
src/vs/platform/agentHost/node/chatContributions/sessionWorkspaceConversion/sessionWorkspaceConversionService.ts |
Uses public message helper. |
src/vs/platform/agentHost/node/chatContributions/sessionWorkspaceConversion/sessionWorkspaceConversionContribution.ts |
Uses public message helper. |
src/vs/platform/agentHost/node/chatContributions/modelText/modelTextContribution.ts |
Persists expanded prompts. |
src/vs/platform/agentHost/node/chatContributions/localCommand/localCommandContribution.ts |
Defers metadata commands. |
src/vs/platform/agentHost/node/chatContributions/builtInChatContributions.ts |
Registers model-text contribution. |
src/vs/platform/agentHost/node/agentSideEffects.ts |
Uses public usage adapter. |
src/vs/platform/agentHost/node/agentService.ts |
Uses public message helper. |
src/vs/platform/agentHost/node/agentHostTelemetryReporter.ts |
Uses public error adapter. |
src/vs/platform/agentHost/common/sessionDataService.ts |
Extends database contract. |
src/vs/platform/agentHost/common/meta/vscode/* |
Houses VS Code-specific metadata implementations. |
src/vs/platform/agentHost/common/meta/copilotd/* |
Houses copilotd readers and compatibility logic. |
src/vs/platform/agentHost/common/meta/README.md |
Documents metadata architecture. |
src/vs/platform/agentHost/common/meta/metadata.ts |
Adds source-selection helper. |
src/vs/platform/agentHost/common/meta/attachmentMeta.ts |
Exposes attachment details. |
src/vs/platform/agentHost/common/meta/agentUsageMeta.ts |
Normalizes usage metadata. |
src/vs/platform/agentHost/common/meta/agentModelMeta.ts |
Normalizes model metadata. |
src/vs/platform/agentHost/common/meta/agentModelCallMeta.ts |
Normalizes call diagnostics. |
src/vs/platform/agentHost/common/meta/agentMessageMeta.ts |
Normalizes message metadata. |
src/vs/platform/agentHost/common/meta/errorMeta.ts |
Normalizes error metadata. |
src/vs/platform/agentHost/common/meta/agentPermissionRequestMeta.ts |
Selects permission convention. |
src/vs/platform/agentHost/common/meta/*.ts forwarding modules |
Preserve public metadata APIs. |
src/vs/platform/agentHost/common/agentModelConfiguration.ts |
Uses public model adapter. |
package.json |
Adds generator dependency/scripts. |
eslint.config.js |
Enables metadata-boundary rule. |
build/agentHost/README.md |
Documents generation workflow. |
build/agentHost/copilotd-source.json |
Pins upstream source. |
build/agentHost/generateCopilotMetadata.ts |
Generates pinned declarations. |
.vscode/settings.json |
Marks generated output read-only. |
.github/instructions/agentHostTesting.instructions.md |
Documents import boundary. |
.eslint-plugin-local/README.md |
Documents lint rule. |
.eslint-plugin-local/code-no-private-agent-host-meta-import.ts |
Enforces private implementations. |
.eslint-plugin-local/tests/code-no-private-agent-host-meta-import.test.ts |
Tests boundary enforcement. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Preserve upstream session comparison support, keep new metadata implementations behind the host-neutral boundary, and adapt the new mode configuration test to schema discovery. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Recognize known Copilot app tool aliases when host presentation is generic, while preserving explicit metadata and existing tool cards. Keep replacement request metadata across retries. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve upstream background-work and MCP-routing tests alongside schema discovery and tool-presentation compatibility. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
roblourens
marked this pull request as ready for review
October 1, 2026 20:56
roblourens
enabled auto-merge (squash)
October 1, 2026 20:56
roblourens
marked this pull request as draft
October 1, 2026 20:56
auto-merge was automatically disabled
October 1, 2026 20:56
Pull request was converted to draft
Replace generic enum bindings with concrete schema-property selectors and explicit approval/isolation conversions. Remove model-text and command-marker support, their generated contracts, contribution and custom persistence for a separate change. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bring the branch up to current main while preserving the deferred prompt scope and concrete session config properties. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
roblourens
marked this pull request as ready for review
October 1, 2026 21:07
roblourens
enabled auto-merge (squash)
October 1, 2026 21:07
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Ulugbek Abdullaev (@ulugbekna)Matched files:
Ben Villalobos (@benvillalobos)Matched files:
TylerLeonhardtMatched files:
|
Contributor
Screenshot ChangesBase: Changed (3)2 insignificant change(s) omitted (≤20 px, Δ≤2). See CI logs for details. |
Move inline tool-input extraction to the dependency-light input module and retain the sessionState re-export. Keep Copilot tool presentation from importing the state facade that already depends on metadata readers. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve upstream permission decision provenance together with the host-neutral metadata readers, schema properties and attachment/output helpers. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
roblourens
marked this pull request as draft
October 1, 2026 21:41
auto-merge was automatically disabled
October 1, 2026 21:41
Pull request was converted to draft
Keep fixture providers aligned with schema-aware pickers and register their quick input dependency, fixing screenshot render failures without changing production behavior. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
roblourens
marked this pull request as ready for review
October 1, 2026 22:27
Preserve the public metadata façade and apply upstream sandbox-policy removal semantics in the private VS Code implementation. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Vritant Bhardwaj (vritant24)
previously approved these changes
Oct 1, 2026
roblourens
enabled auto-merge (squash)
October 1, 2026 23:38
roblourens
marked this pull request as draft
October 1, 2026 23:39
auto-merge was automatically disabled
October 1, 2026 23:39
Pull request was converted to draft
Preserve the public system-notification façade and register upstream BYOK tool-limit warnings in the private VS Code metadata implementation. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the new VS Code runtime-model-configuration parser behind the private metadata boundary while preserving its public API and upstream subagent/picker behavior. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve incoming MCP source attribution while retaining the public usage metadata reader in signal routing. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
roblourens
marked this pull request as ready for review
October 2, 2026 00:42
roblourens
enabled auto-merge (squash)
October 2, 2026 00:42
Ross Wollman (rwoll)
approved these changes
Oct 2, 2026
roblourens
added a commit
that referenced
this pull request
Oct 2, 2026
Stop enforcing readOnly when validating and forwarding session config so settings-derived worktree options survive discovery, creation, and refresh. Keep picker editability and the remaining schema checks unchanged. Add regression coverage for worktree options and update workbench payload expectations. Regression from #339034. (Written by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

Summary
Enable the Agents Window to consume compatible VS Code Agent Host and copilotd metadata through host-neutral, domain-specific helpers.
meta/vscodeandmeta/copilotdfolders, with public dispatch helpers and an ESLint import boundary.Generated contracts and tests
Keep the generated declarations checked in, but do not vendor the schemas or a standalone license file. A small source pin records the upstream commit; explicit regeneration reads that commit from a supplied local checkout without fetching or changing it. The only retained upstream inputs are the conformance test fixtures, located beside the compiled tests and copied by the normal build. Ordinary builds and tests do not require the Copilot host checkout or network access.
Add a basic public-helper compatibility matrix, 24 controlled-peer wire-to-feature tests through the real protocol client and registered production handler, and regression coverage for the actual Chat retry/model paths and steering persistence. The upstream vector runner executes 109 client cases from 17 fixture files.
Validation
npm run gulp compile-client— passed, including copying all 17 conformance fixtures intact.env -u COPILOT_HOME ./scripts/test.sh --runGlob '{**/platform/agentHost/test/common/*.test.js,**/platform/agentHost/test/electron-browser/agentHostProtocolClient.test.js,**/platform/agentHost/test/node/{copilotMetadataConformance,chatContributions,sessionDatabase,copilotAgentSession,copilotAgent,mapSessionEvents,copilotSlashCommand,copilotSlashCommandCompletionProvider,proxyChatError,copilotSdkChatError,copilotToolDisplay,copilotNonPtyShellTerminals,copilotShellTools,copilotFailureTelemetry,localAgentHostMetadata}.test.js,**/workbench/contrib/chat/test/browser/agentSessions/*.test.js,**/workbench/contrib/chat/test/common/{chatErrorMessages,chatService/chatService,model/chatModel,attachments/chatDraft}.test.js,**/workbench/contrib/chat/test/browser/agentHostUsageSidecar.test.js,**/sessions/contrib/providers/agentHost/test/browser/**/*.test.js,**/sessions/contrib/providers/remoteAgentHost/test/browser/{remoteAgentHostSessionsProvider,cloudSandboxAgentHostContribution}.test.js}'— 6,181 passed, 17 existing pending.npm run agent-host:check-copilot-meta -- --source "$COPILOT_HOST_CHECKOUT"— passed against the pinned upstream checkout.npm run valid-layers-check— passed.node --test --test-reporter=dot .eslint-plugin-local/tests/code-no-private-agent-host-meta-import.test.ts— passed.git diff --check— passed.The test process omits the agent session's inherited
COPILOT_HOMEso mocked home directories remain isolated. Explicit override tests are included. Validation was on macOS; live two-host and Windows/Linux runs were not performed.Review notes
Latest
main(072617082f2) has been merged inb8d230a1138, resolving the conflict-blocked checks. The merged client compiles, and the expanded Agent Host/protocol/metadata/Chat compatibility baseline passes 7,315 tests with 33 pending. GitHub now reports the PR as mergeable and CI has restarted. No authentication, transport, relay, or provisioning redesign is included.Most of the structural diff moves existing metadata readers behind the public boundary. Valid
copilot.modelTextis intentionally honored on either host. Error readers fall back from unusable VS Code data to copilotd; attachment detail remains available alongside unrelated VS Code attachment metadata.(Written by Copilot)