Load managed-settings.json from well-known disk path#321870
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a file-based delivery channel for Copilot managed settings (read from a well-known path on disk) and wires it into the existing policy/managed-settings pipeline so enterprise configuration management tools can deploy settings without MDM.
Changes:
- Introduces
FileManagedSettingsServiceto read + watchmanaged-settings.jsonand normalizes it via a sharednormalizeManagedSettings()path. - Adds IPC plumbing (
FileManagedSettingsChannel/Client) and wires the client into both the desktop workbench window and the Agents window so file-based managed settings participate in policy evaluation. - Extends policy export to include cross-window
policyReferencesettings via a shared external manifest (externalPolicyReferences), and updates the generatedpolicyData.jsonc.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/services/policies/common/accountPolicyService.ts | Merges file-based managed settings at lowest priority into account policy data. |
| src/vs/workbench/services/accounts/browser/managedSettings.ts | Switches server response adaptation to the shared managed-settings normalizer. |
| src/vs/workbench/electron-browser/desktop.main.ts | Wires up the file-based managed settings IPC client and passes it into AccountPolicyService. |
| src/vs/workbench/contrib/policyExport/electron-browser/policyExport.contribution.ts | Includes cross-window external policyReference settings in exported policy catalog. |
| src/vs/sessions/electron-browser/sessions.main.ts | Wires up the file-based managed settings IPC client for the Agents window. |
| src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessions.contribution.ts | Uses shared external policy reference manifest for Claude gating. |
| src/vs/platform/policy/test/common/fileManagedSettingsService.test.ts | Adds unit tests for normalization and file-managed settings service behavior. |
| src/vs/platform/policy/common/policyIpc.ts | Disposes the policy IPC listener by registering it on the client’s disposable store. |
| src/vs/platform/policy/common/fileManagedSettingsService.ts | Implements file read/watch + normalization for managed settings on disk. |
| src/vs/platform/policy/common/fileManagedSettingsIpc.ts | Adds IPC channel/client to expose file-managed settings from main → renderer. |
| src/vs/platform/policy/common/externalPolicyReferences.ts | Introduces a shared manifest for cross-window policy references. |
| src/vs/platform/policy/common/copilotManagedSettings.ts | Adds file path constants, shared normalizeManagedSettings(), and the file managed settings service interface. |
| src/vs/code/electron-main/main.ts | Creates and registers FileManagedSettingsService in the main process service collection. |
| src/vs/code/electron-main/app.ts | Registers the file-managed settings IPC channel. |
| build/lib/policies/policyData.jsonc | Updates generated policy catalog to include the Agents window Claude setting reference. |
Copilot's findings
- Files reviewed: 15/15 changed files
- Comments generated: 2
6713a7f to
ab9c22d
Compare
Contributor
|
Base:
|
a4683a7 to
f5f0477
Compare
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @deepak1556Matched files:
|
roblourens
previously approved these changes
Jun 24, 2026
f5f0477 to
19c443a
Compare
Add a file-based managed-settings delivery channel that reads managed-settings.json from a well-known per-OS disk path in the main process and exposes it to renderer windows over IPC. Mirrors the existing Copilot managed-settings (server / native MDM) channels. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
19c443a to
be7acd8
Compare
connor4312
approved these changes
Jun 24, 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.
Adds a file-based delivery channel for Copilot managed settings, so enterprises using config management (Chef, Puppet, Ansible) can deploy settings without MDM.
The main process reads
managed-settings.jsonfrom a well-known per-OS path and exposes it to renderer windows over IPC, mirroring the existing server and native-MDM channels./Library/Application Support/GitHubCopilot/managed-settings.json%ProgramFiles%\GitHubCopilot\managed-settings.json/etc/github-copilot/managed-settings.jsonPrecedence
Server > native MDM > file — a single authoritative source wins; the channels are not merged. The file channel slots in as the lowest precedence via the shared
selectManagedSettings(server, nativeMdm, file).Notes
normalizeManagedSettings()is the single normalizer shared by all channels (the server adapteradaptManagedSettings()is now a thin wrapper around it).FileManagedSettingsServicereads/watches the file viaIFileService(follows theFilePolicyServicepattern); IPC followsCopilotManagedSettingsIpc.'file'active-source label, and now attributes managed-settings-driven policies to their actual channel (e.g.Managed Settings: File (managed-settings.json)) instead of the genericAccountPolicyService.Rebased onto latest
mainand aligned with the managed-settings refactor in #322439.Ref: microsoft/vscode-internalbacklog#7932