Skip to content

chat: add a managed Local harness opt-out - #341188

Merged
Connor Peet (connor4312) merged 2 commits into
mainfrom
connor4312/temporary-local-harness-policy
Oct 12, 2026
Merged

Connor Peet (connor4312) merged 2 commits into
mainfrom
connor4312/temporary-local-harness-policy

Conversation

@connor4312

Copy link
Copy Markdown
Member

chat: add a managed Local harness opt-out

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]

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.
  • Manual test in the development Workbench — verified effective policy true and a new Local chat editor. Existing Copilot sidebar chats retain Copilot on New Chat, as intended.

Manual test

  1. Set chat.defaultToCopilotHarness and chat.editor.preferCopilotHarness to true, and chat.editor.localAgent.enabled to false.
  2. Deliver managed settings {"vscode":{"temporaryDefaultToLocalHarness":true}}.
  3. Verify a fresh Chat: New Chat Editor uses Local and Local remains selectable.
  4. Add managed sandbox or permission settings and verify Local requests are allowed by the escape hatch.
  5. Set the managed value to false or 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.

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]>
Copilot AI balanced review requested due to automatic review settings October 12, 2026 22:33
@connor4312
Connor Peet (connor4312) enabled auto-merge (squash) October 12, 2026 22:33

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

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.

@connor4312
Connor Peet (connor4312) merged commit 57c2329 into main Oct 12, 2026
36 checks passed
@connor4312
Connor Peet (connor4312) deleted the connor4312/temporary-local-harness-policy branch October 12, 2026 23:01
@vs-code-engineering vs-code-engineering Bot added this to the 1.143.0 milestone Oct 12, 2026
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.

3 participants