Repository navigation
Allow Policy Helper registration through VS Code settings - #345712
Merged
Ross Wollman (rwoll) merged 5 commits intoNov 4, 2026
Merged
Ross Wollman (rwoll) merged 5 commits into
Ross Wollman (rwoll) merged 5 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5af45bc5-bd78-4717-a21d-b847191b3cb6
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Live verification used an override artifact and the external runtime contract was unavailable, leaving bundled-runtime compatibility, policy precedence, and the Agency rollout gate dependent on maintainer confirmation.
No open issues 🎉
What changed in this PR
Enables extensions to register or clear a Policy Helper for local Copilot Agent Host sessions without restarting VS Code or reloading the window, using the existing safe runtime-restart lifecycle.
Changes:
- Adds an application-scoped helper setting, normalization, and local-host synchronization with explicit removal handling.
- Captures helper configuration at runtime startup, preserves other feature flags, and redacts helper values from change logs.
- Adds lifecycle and configuration tests and documents the registration contract.
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/test/browser/chatConfiguration.test.ts |
Tests setting metadata and serializable removal handling. |
src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts |
Registers the local-only setting and synchronization transform. |
src/vs/platform/agentHost/test/node/copilotAgentStartupConfig.test.ts |
Tests helper comparisons and redacted change descriptions. |
src/vs/platform/agentHost/test/node/copilotAgent.test.ts |
Tests environment injection, captured values, and safe restart behavior. |
src/vs/platform/agentHost/test/common/copilotCliConfig.test.ts |
Tests helper normalization and schema validation. |
src/vs/platform/agentHost/node/copilot/copilotAgentStartupConfig.ts |
Includes helper configuration in startup comparisons without logging values. |
src/vs/platform/agentHost/node/copilot/copilotAgent.ts |
Passes captured helper configuration and its feature flag to runtime launches. |
src/vs/platform/agentHost/common/copilotCliConfig.ts |
Defines the helper setting, type, schema, and normalizer. |
src/vs/platform/agentHost/AGENTS.md |
Documents registration, restart behavior, and policy precedence. |
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5af45bc5-bd78-4717-a21d-b847191b3cb6
monil-patel
marked this pull request as ready for review
November 3, 2026 03:20
Preserve Policy Helper registration and upstream progress prompt configuration. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 13a6c083-7976-461a-8eb2-6ed734379b30
Extract the shared setting schema to avoid duplicate command registration during full unit test discovery. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 13a6c083-7976-461a-8eb2-6ed734379b30
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 13a6c083-7976-461a-8eb2-6ed734379b30
Ross Wollman (rwoll)
approved these changes
Nov 4, 2026
Federico Brancasi (federicobrancasi)
approved these changes
Nov 4, 2026
2 tasks
Vijay Upadya (vijayupadya)
approved these changes
Nov 4, 2026
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
Let extensions register a Policy Helper for local Copilot Agent Host sessions without a VS Code restart or window reload.
The Agency extension can write
chat.agentHost.copilot.policyHelperthrough the configuration API. VS Code forwards the registration to the local Agent Host. The Copilot runtime executes the helper and resolves policy.Related issue: github/copilot-agent-runtime#28101.
Extension contract
The setting accepts an executable
pathand optional stringargs. It uses application scope and excludes Settings Sync. Theadvancedtag limits default visibility in the Settings editor.doNotSuggest: trueomits the key from settings JSON suggestions. The configuration API remains available, and users can inspect the value in raw settings JSON.An unset, malformed, or whitespace-only path means no helper. Omitted arguments normalize to
[]. A cleared setting crosses the protocol as an empty-path object, so removal clears the host's previous registration.Runtime lifecycle
The normalized registration belongs to the existing client startup snapshot. Addition, removal, path changes, and argument changes trigger the existing safe restart flow. Equivalent registrations do not trigger another restart.
Shared clients wait until active turns, subagents, and credential updates finish. Scoped clients refresh stale configuration at the next idle use. Each runtime launch receives the captured startup value. Change logs report
policyHelperwithout its path or arguments.The next fresh chat receives the helper configuration. Existing chats can retain their previous skill inventory after resume. Helper script content changes do not trigger a restart.
Policy boundary
A valid registration sets
COPILOT_CLI_POLICY_HELPERand addsPOLICY_HELPERtoCOPILOT_CLI_ENABLED_FEATURE_FLAGS. Other feature flags remain intact. An absent registration clears the helper environment variable and adds no helper flag.Device and server policy remain authoritative. VS Code provides registration, not policy enforcement. This change covers the local Agent Host path only. It does not change the Copilot extension's separate
copilotclisession path.Validation
npx --yes --package=pnpm@12.16.0 pnpm run build-fastnpm run typecheck-clientgit diff --checkThe tests cover normalization, registration metadata, removal transport, environment injection, redacted comparisons, captured startup values, scoped clients, and deferred restarts.
Live verification
An isolated regular Code OSS workbench used a cloned profile and a Windows ARM64 runtime override. The source profile remained untouched.
ConfigurationTarget.Globalpolicy helper skill for repo devprod.commitlinksThe live run used runtime artifact
70ffdab, not the bundled runtime. It does not establish published runtime availability. Full integration and smoke suites, remote hosts, and the Agency rollout gate were not exercised.Manual test