Skip to content

agentHost: graduate the legacy-settings managed-permissions bridge - #333290

Closed
joshspicer wants to merge 4 commits into
mainfrom
joshspicer/graduate-legacy-settings-bridge
Closed

joshspicer wants to merge 4 commits into
mainfrom
joshspicer/graduate-legacy-settings-bridge

Conversation

@joshspicer

@joshspicer joshspicer commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Graduates the supported legacy-settings → managedSettings.permissions bridge from experimental opt-in to default-on enforcement for Copilot sessions on the machine's Agent Host. Existing host permission enforcement remains in place.

Refs #332011. This is bridge graduation, not full Local → Agent Host control parity. Local means the legacy harness. MCP, network allow-only, per-tool redesign, external managed-policy activation, and picker synchronization remain separate workstreams.

Behavior

Client-injected deny/ask restrictions bind without making unrelated permission families require managed approval. External managed sources intentionally have different activation semantics; this PR does not change them. The bridge contributes no allow list and reads only supported explicit global layers, not workspace/folder values. Policy-only mappings remain policy-only.

chat.agentHost.copilot.mapLegacySettingsToManagedSettings is removed from the registry and resolver dependencies. Stale true and false entries are ignored; neither can disable a mapped restriction. Settings no longer advertises an ineffective opt-in. The stale activation warning and contributor guidance are corrected.

Refresh and coverage

Updated head: 8c6df6e7acfbc2d98269d466cda504d2e9e6596e.

Merged main 7b1026af053270cc810e734d841fa7dc44fa97be without rebasing or rewriting published commits. Conflict resolution preserves newer workspace-trust, session-catalog, and Claude Advisor changes. Two main-added IPv4/IPv6 test fixtures also needed their obsolete gate entries removed. The resulting nine-file PR delta merges cleanly with the subsequently fetched main; unrelated later UI changes are not part of this work.

Added copilotManagedPermissions.integrationTest.ts and managed-permission-specific active-turn restart coverage. Production update/removal/reconnect behavior and idle-boundary restart semantics are unchanged.

Executed native runtime evidence

Installed SDK: 1.0.15-unstable.35393089353.gfc44743. The running bundled runtime reported 1.0.85-unstable.r35379093703.g3514c9a, protocol 3. This supersedes the earlier package/tag-containment discussion: versions, dates, symbols, or ancestry alone are not behavior evidence.

The new integration tests pass bridge-generated restrictions into the real SDK and exercise the runtime's native tool pipeline. An existing loopback BYOK proxy supplies one synthetic model response solely to establish persisted history. No production credentials or paid model calls are used.

Scenario Fresh session and cold resume after runtime restart Cold resume with injected policy omitted
No restriction Baseline shell/read/write/URL approval request shapes Same baseline
One denied domain Matching URL is runtime-denied without reaching the approval handler; unrelated requests retain baseline behavior Formerly blocked URL reaches ordinary approval
One terminal ask Matching command has managedApprovalRequired=true; unrelated requests retain baseline behavior Matching command no longer requires managed approval

Shell/read/write operations run against temporary files. URL requests that reach the handler are deliberately rejected before network access. Assertions inspect real permission requests and operation results, not just DTO serialization. This is SDK/runtime integration, not full Agent Host/AHP E2E.

Passed on macOS ARM64:

  • ./scripts/test-integration.sh --run src/vs/platform/agentHost/test/node/providerIntegration/copilotManagedPermissions.integrationTest.ts: 4 passing (three runtime scenarios plus registry guard), repeated successfully.
  • Focused bridge/service/protocol/launcher/provider unit selection: 110 passing, including stale flags, aggregation/removal, forwarding, reconnect, and active-turn deferral.
  • npm run typecheck-client and ESLint over the six changed TypeScript files.

Remaining validation and rollout limits

  • Factory behavior is not validated. The bundled empty-mode runtime rejects extension initialization with No extension launch provider is registered for standalone extensions; no substitute success is claimed.
  • A broader unit selection produced 163 passing, 1 pending, 3 failing due to unavailable @vscode/sqlite3 loading: the two cold-start self-healing tests and managed-shell materialization test.
  • The existing full-host synthetic-LLM hello test failed in setup (Real server exited prematurely with code 1); the runner also reports missing @vscode/fs-copyfile native binding. Full AHP evidence remains unavailable in this environment.
  • npm run export-policy-data failed because the native @vscode/policy-watcher binding is absent. Generated policy data was not manually changed; the removed gate has no policy entry.
  • Dependencies were restored through the required feed with lifecycle scripts disabled; those restrictions were not bypassed.
  • Windows/Linux validation and updated-head CI remain required. Old-head Electron CI failures are not evidence about this update.
  • All five existing review threads were already resolved. This changed head needs renewed review and the user's trusted signed empty approval checkpoint. The new merge commit is unsigned; no user approval is claimed.
  • The first released default-on build remains an open acceptance criterion in Agent Host: graduate the legacy-settings bridge #332011. This update does not establish release readiness, full parity, or permission to merge.

Copilot AI balanced review requested due to automatic review settings August 29, 2026 00:02

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.

Copilot review overview

Review tier: Balanced
Findings: 3 Low severity

New issues introduced by this change (3)
Severity Finding
Low severity src/​vs/​workbench/​contrib/​chat/​browser/​chat.shared.contribution.ts — The deprecation text says this value is ignored, but the adjacent description still says “When…
Low severity src/​vs/​platform/​agentHost/​common/​agentHostManagedSettings.ts — This semantic update leaves the repository's managed-settings guidance stale:…
Low severity src/​vs/​platform/​agentHost/​test/​common/​agentHostManagedSettings.test.ts — The default-on coverage stops at the resolver, while agentHostProtocolClient.test.ts:1214-1217…
What changed in this PR

Graduates the legacy-settings permissions bridge to default enforcement following the runtime fix referenced by #332011.

Changes:

  • Removes the experimental opt-in gate.
  • Deprecates the now-ignored setting.
  • Adds default-on and explicit-false tests.
File Description
agentHostManagedSettings.ts Makes permission mapping unconditional.
chat.shared.contribution.ts Deprecates the compatibility setting.
agentHostManagedSettings.test.ts Updates bridge behavior tests.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@joshspicer
joshspicer force-pushed the joshspicer/graduate-legacy-settings-bridge branch from 8d85ef1 to 6ee5415 Compare August 31, 2026 18:09
@joshspicer
joshspicer requested a balanced review from Copilot August 31, 2026 18:11

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.

Copilot review overview

Review tier: Balanced
Findings: 1 Medium severity · 3 Low severity

New issues introduced by this change (1)
Severity Finding
Medium severity src/​vs/​platform/​agentHost/​test/​common/​agentHostManagedSettings.test.ts — This default-on test only verifies the VS Code DTO. It cannot catch the regression that originally…
Pre-existing issues (3)
Severity Finding
Low severity src/​vs/​platform/​agentHost/​test/​common/​agentHostManagedSettings.test.ts — The default-on coverage stops at the resolver, while agentHostProtocolClient.test.ts:1214-1217… View comment
Low severity src/​vs/​platform/​agentHost/​common/​agentHostManagedSettings.ts — This semantic update leaves the repository's managed-settings guidance stale:… View comment
Low severity src/​vs/​workbench/​contrib/​chat/​browser/​chat.shared.contribution.ts — The deprecation text says this value is ignored, but the adjacent description still says “When… View comment
Suppressed comments (1)

src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts:1617

  • The new deprecation text says the value is ignored, but the adjacent setting description still says mapping happens “When enabled.” Both are displayed as user-facing setting documentation, so existing users now receive contradictory guidance. Update the description to describe the always-on bridge without conditioning it on this boolean.
			markdownDeprecationMessage: nls.localize('chat.agentHost.copilot.mapLegacySettingsToManagedSettings.deprecated', "This setting is no longer used. Supported legacy settings are always mapped to Copilot SDK managed settings, so this value is ignored."),

The bridge from legacy VS Code settings to the Copilot SDK's per-session
managedSettings.permissions shipped behind the experimental opt-in
chat.agentHost.copilot.mapLegacySettingsToManagedSettings because the runtime
treated any managed rule from any source as activating the global managed
policy, so one narrow restriction forced unmatched shell/read/write/URL/factory
requests to prompt.

github/copilot-agent-runtime#16249 makes client/session-injected managed
permissions non-activating, which removes that broadening. The bundled runtime
VS Code spawns contains the fix, so the bridge becomes the default enforcement
path.

The setting is deprecated and its value is now ignored rather than honored as an
opt-out: the mappings only ever contribute administrator-configured
restrictions, so honoring an explicit false would let a user switch off an
enterprise policy.

Also drops the now-inert opt-in fixture from the per-tool auto-approval tests
added in #333264, so no test implies the gate still influences the result.

Refs #332011

Co-authored-by: Copilot <[email protected]>
@joshspicer
joshspicer force-pushed the joshspicer/graduate-legacy-settings-bridge branch from 6ee5415 to 6898071 Compare August 31, 2026 18:22
@joshspicer
joshspicer marked this pull request as ready for review August 31, 2026 18:31
@joshspicer
joshspicer requested a balanced review from Copilot August 31, 2026 18:31

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.

Copilot review overview

Review tier: Balanced
Findings: 2 Medium severity · 3 Low severity

New issues introduced by this change (1)
Severity Finding
Medium severity src/​vs/​workbench/​contrib/​chat/​browser/​chat.shared.contribution.ts — The setting is now ignored for both true and false, but the Settings UI still says mapping…
Pre-existing issues (4)
Severity Finding
Medium severity src/​vs/​platform/​agentHost/​test/​common/​agentHostManagedSettings.test.ts — This default-on test only verifies the VS Code DTO. It cannot catch the regression that originally… View comment
Low severity src/​vs/​platform/​agentHost/​test/​common/​agentHostManagedSettings.test.ts — The default-on coverage stops at the resolver, while agentHostProtocolClient.test.ts:1214-1217… View comment
Low severity src/​vs/​platform/​agentHost/​common/​agentHostManagedSettings.ts — This semantic update leaves the repository's managed-settings guidance stale:… View comment
Low severity src/​vs/​workbench/​contrib/​chat/​browser/​chat.shared.contribution.ts — The deprecation text says this value is ignored, but the adjacent description still says “When… View comment

joshspicer and others added 2 commits August 31, 2026 11:39
Follow-up to the gate graduation, from PR review:

- The managed-settings skill guidance still listed the false-by-default
  experimental gate as a bridge invariant, which would instruct future work to
  restore the removed gate. Updated in sdk-runtime-policy.md, and in the two
  further places carrying the same claim (legacy-permission-policy.md and
  SKILL.md).
- The protocol-boundary tests still supplied the deprecated opt-in to their
  forwarding fixtures, so they did not prove a local connection forwards
  restrictions without it. Removed, along with the now-unused import.

Co-authored-by: Copilot <[email protected]>
The bridge is now unconditional, so the gating setting had no effect while
still presenting a checkbox in Settings whose description claimed mapping
happens "when enabled". A user with an existing `false` value was told the
bridge was disabled while restrictions were in fact enforced.

Remove the setting from the configuration registry and drop the now-unused
constant. The resolver already ignores the value, so behaviour is unchanged;
this only stops Settings from advertising a control that does nothing.

The unit test keeps the regression guard using the raw setting id, so a stale
settings.json entry still cannot switch off an administrator restriction.

Co-authored-by: Copilot <[email protected]>
Resolve bridge graduation conflicts without reverting newer configuration features. Remove stale opt-in fixtures and verify real bundled runtime restrictions on create, cold resume, and removal, with active-turn lifecycle coverage.

Co-authored-by: Copilot App <[email protected]>
@rwoll

Copy link
Copy Markdown
Member

Superseded by #337108: #337108

The replacement preserves the same published changes and head (8c6df6e7acfbc2d98269d466cda504d2e9e6596e) on an independent branch. Please continue review there; this PR was closed, not merged.

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.

4 participants