Skip to content

[1.142] chat: add a managed Local harness opt-out - #341190

Merged
Connor Peet (connor4312) merged 1 commit into
release/1.142from
connor4312/temporary-local-harness-policy-1.142
Oct 12, 2026
Merged

Connor Peet (connor4312) merged 1 commit into
release/1.142from
connor4312/temporary-local-harness-policy-1.142

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]

(cherry picked from commit 2b21fb4)

Backport of #341188 to release/1.142. No associated issue. The cherry-pick applied without conflicts or release-specific code changes.

Validation on release/1.142

  • npm run install-fast — passed; dependencies are independent of the main worktree.
  • 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; no additional catalog changes.
  • git diff --check — passed.

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. Current-session inheritance is preserved.

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]>
(cherry picked from commit 2b21fb4)
Copilot AI balanced review requested due to automatic review settings October 12, 2026 22:39
@connor4312
Connor Peet (connor4312) enabled auto-merge (squash) October 12, 2026 22:39
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Base: a2073f4d Current: 6e5d440f

No screenshot changes.

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.

🟢 Approval recommended

The backport consistently applies the policy and includes comprehensive validation with no unresolved issues.

0 open findings

What changed in this PR

Adds an enterprise-managed opt-out that keeps the Local chat harness available despite Copilot routing requirements.

Changes:

  • Registers and exports the managed policy.
  • Applies it to harness selection, visibility, and request blocking.
  • Adds coverage for delivery, precedence, live updates, and removal.
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 behavior.
src/​vs/​workbench/​contrib/​chat/​common/​constants.ts Updates harness selection rules.
src/​vs/​workbench/​contrib/​chat/​test/​common/​constants.test.ts Tests selection and preservation behavior.
src/​vs/​workbench/​contrib/​chat/​common/​chatService/​chatServiceImpl.ts Reacts to policy changes.
src/​vs/​workbench/​contrib/​chat/​test/​common/​chatService/​chatService.test.ts Tests request blocking updates.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​chatWidget.ts Refreshes 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 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 6ba3b00 into release/1.142 Oct 12, 2026
57 of 60 checks passed
@connor4312
Connor Peet (connor4312) deleted the connor4312/temporary-local-harness-policy-1.142 branch October 12, 2026 23:10
@vs-code-engineering vs-code-engineering Bot added this to the 1.142.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