Repository navigation
agentHost: enable local network access from the sandbox banner - #351082
Merged
Dileep Yavanmandha (dileepyavan) merged 2 commits intoNov 30, 2026
Merged
Dileep Yavanmandha (dileepyavan) merged 2 commits into
Dileep Yavanmandha (dileepyavan) merged 2 commits into
Conversation
Fixes microsoft#349798 Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The change removes the Settings remediation link for connected older hosts without sandbox-profile support, leaving local-network warnings without an action even though those hosts can still inherit the user setting.
1 open issue
What changed in this PR
Replaces Settings-only guidance in the chat sandbox banner with a profile-aware confirmation, so enabling local network access updates the configuration used by the connected agent host.
Changes:
- Updates user settings for Default hosts or the assigned sandbox profile, including connected hosts sharing a locally saved profile.
- Prevents grants when organization policy blocks access or the target changes during confirmation.
- Adds tests for grant targets, cancellation, stale assignments, and policy-blocked guidance.
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostSandboxNotification.test.ts | Tests confirmation, profile updates, cancellation, and policy behavior. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSandboxNotification.ts | Implements the profile-aware banner action and guarded configuration updates. |
| src/vs/platform/agentHost/common/sandboxProfiles.ts | Extracts a helper for writing host profile assignments directly. |
Review effort: Balanced
Dileep Yavanmandha (dileepyavan)
marked this pull request as ready for review
November 29, 2026 22:54
Dileep Yavanmandha (dileepyavan)
enabled auto-merge
November 29, 2026 22:54
Co-authored-by: Copilot <[email protected]>
Sandeep Somavarapu (sandy081)
approved these changes
Nov 29, 2026
Alexandru Dima (alexdima)
approved these changes
Nov 29, 2026
Dileep Yavanmandha (dileepyavan)
deleted the
fix/349798-sandbox-local-network
branch
November 30, 2026 00:29
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.

Fixes #349798.
The local network warning previously opened Settings, even when the connected agent host had an assigned sandbox profile. Updating the user setting there need not change the host's effective configuration. This keeps the existing warning trigger and lets the user confirm the change directly in chat.
How to test
Connect the Agents window to a Windows agent host that reports local network access is required. With Default selected, click Enable Local Network Access and verify that the dialog identifies user settings. Cancel and verify no setting changes.
In Manage Remote Environments, assign a test sandbox profile that does not enable local network access. From the chat banner, confirm that the dialog names that profile. Accept, then check
/sandbox policyin a fresh session and verify local network access is enabled while the user setting remains unchanged.Connect to a host that reports the warning but does not advertise sandbox profiles. Verify Open Local Network Settings opens the local network setting without changing it.
Validation
pnpm run typecheck-clientandpnpm run build-fast --client-only— passed.scripts\test.bat --run src\vs\workbench\contrib\chat\test\browser\agentSessions\agentHostSandboxNotification.test.ts --reporter dot— 171 passing, 1 pending after the fallback change, including the regression test for loading versus unsupported host state.pnpm run oxlint src\vs\workbench\contrib\chat\browser\agentSessions\agentHost\agentHostSandboxNotification.ts src\vs\workbench\contrib\chat\test\browser\agentSessions\agentHostSandboxNotification.test.ts— passed.Live remote Windows testing has not been performed.