Repository navigation
chat: add a managed Local harness opt-out - #341188
Merged
Connor Peet (connor4312) merged 2 commits intoOct 12, 2026
Merged
Conversation
Add a temporary enterprise control for the VS Code chat harness. - Add vscode.temporaryDefaultToLocalHarness as an enterprise managed setting. - Keep Local available and stop automatic promotion to Copilot when the policy is enabled. - Override managed sandbox and permission routing, without changing runtime enforcement. - Preserve explicit, remembered, and current harness choices. - Update Local request blocking when the policy changes. - Add tests for delivery, selection, request blocking, and policy removal. - Export policy data with VS Code 1.142 as the minimum version. (Commit message generated by Copilot) Co-authored-by: Copilot <[email protected]>
…local-harness-policy
Paul (pwang347)
approved these changes
Oct 12, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The policy metadata advertises support beginning in 1.142 although this checkout introduces it for version 1.143.
1 open finding
What changed in this PR
Adds an enterprise-managed opt-out that keeps the Local chat harness available despite Copilot routing policies.
Changes:
- Adds and exports the managed policy.
- Applies it to harness selection, visibility, and request blocking.
- Adds delivery, selection, and policy-removal tests.
| File | Description |
|---|---|
.github/skills/policy-and-managed-settings/vscode-policy.md |
Documents the policy contract. |
build/lib/policies/policyData.jsonc |
Exports policy metadata. |
src/vs/platform/agentHost/common/agentHostEnablementService.ts |
Registers the policy-backed setting. |
src/vs/platform/agentHost/common/agentHostPolicySupport.ts |
Classifies Agent Host support. |
src/vs/platform/policy/common/copilotManagedSettings.ts |
Resolves the managed opt-out. |
src/vs/platform/policy/test/common/copilotManagedSettings.test.ts |
Tests projection and routing override. |
src/vs/workbench/contrib/chat/common/constants.ts |
Updates harness selection rules. |
src/vs/workbench/contrib/chat/test/common/constants.test.ts |
Tests selection behavior. |
src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts |
Reacts to live policy changes. |
src/vs/workbench/contrib/chat/test/common/chatService/chatService.test.ts |
Tests request blocking changes. |
src/vs/workbench/contrib/chat/browser/widget/chatWidget.ts |
Updates widget policy state. |
src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.ts |
Refreshes picker availability. |
src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditorInput.ts |
Applies policy to editor sessions. |
src/vs/workbench/contrib/chat/test/browser/widgetHosts/editor/chatEditorInput.test.ts |
Updates configuration test fixtures. |
src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.ts |
Applies policy to sidebar sessions. |
src/vs/workbench/services/policies/test/browser/accountPolicyService.test.ts |
Tests delivery channels and removal. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Connor Peet (connor4312)
deleted the
connor4312/temporary-local-harness-policy
branch
October 12, 2026 23:01
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.

chat: add a managed Local harness opt-out
Add a temporary enterprise control for the VS Code chat harness.
(Commit message generated by Copilot)
Co-authored-by: Copilot [email protected]
No associated issue.
Validation
npm run build-fast -- --client-only— passed../scripts/test.sh --reporter dot --run src/vs/platform/policy/test/common/copilotManagedSettings.test.ts --run src/vs/workbench/contrib/chat/test/common/constants.test.ts --run src/vs/workbench/services/policies/test/browser/accountPolicyService.test.ts --run src/vs/workbench/contrib/chat/test/common/chatService/chatService.test.ts --run src/vs/workbench/contrib/chat/test/browser/widgetHosts/editor/chatEditorInput.test.ts --run src/vs/workbench/contrib/chat/test/browser/widgetHosts/viewPane/chatViewPane.test.ts --run src/vs/workbench/contrib/chat/test/browser/widget/input/sessionTargetPickerActionItem.test.ts --run src/vs/workbench/contrib/chat/test/browser/widget/chatWidget.test.ts— 570 passed, 4 existing pending.npm run typecheck-client— passed.npm run eslint -- src/vs/platform/policy/common/copilotManagedSettings.ts src/vs/platform/policy/test/common/copilotManagedSettings.test.ts src/vs/platform/agentHost/common/agentHostEnablementService.ts src/vs/platform/agentHost/common/agentHostPolicySupport.ts src/vs/workbench/contrib/chat/common/constants.ts src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts src/vs/workbench/contrib/chat/browser/widget/chatWidget.ts src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.ts src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditorInput.ts src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.ts src/vs/workbench/contrib/chat/test/common/constants.test.ts src/vs/workbench/contrib/chat/test/common/chatService/chatService.test.ts src/vs/workbench/contrib/chat/test/browser/widgetHosts/editor/chatEditorInput.test.ts src/vs/workbench/services/policies/test/browser/accountPolicyService.test.ts— passed.npm run valid-layers-check— passed.npm run check-cyclic-dependencies— passed.npm run export-policy-data -- --skip-transpile— passed for both Workbench and Agents window.trueand a new Local chat editor. Existing Copilot sidebar chats retain Copilot on New Chat, as intended.Manual test
chat.defaultToCopilotHarnessandchat.editor.preferCopilotHarnesstotrue, andchat.editor.localAgent.enabledtofalse.{"vscode":{"temporaryDefaultToLocalHarness":true}}.falseor remove it and verify normal routing and Local request blocking return.Local does not enforce runtime-only sandbox or permission rules. The escape hatch is administrator-controlled and does not disable their enforcement in Copilot runtime sessions.