Repository navigation
Save sandbox path access in user settings - #341208
Merged
Dileep Yavanmandha (dileepyavan) merged 4 commits intoOct 14, 2026
Merged
Dileep Yavanmandha (dileepyavan) merged 4 commits into
Dileep Yavanmandha (dileepyavan) merged 4 commits into
Conversation
Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Pending refreshes can strand confirmations, and stale session grants can override persistent read/write upgrades.
2 open findings
What changed in this PR
Adds session-scoped and persistent sandbox path grants while preserving sandbox enforcement.
Changes:
- Introduces validated path-grant metadata and persistence acknowledgements.
- Adds confirmation UI, settings persistence, configuration synchronization, and accessibility guidance.
- Adds focused coverage for grant handling, failures, cancellation, and platform paths.
| File | Description |
|---|---|
src/vs/platform/agentHost/common/agent.ts |
Extends permission response context. |
src/vs/platform/agentHost/common/meta/vscode/agentPermissionResponseMeta.ts |
Serializes persistence acknowledgements. |
src/vs/platform/agentHost/common/meta/vscode/agentToolCallMeta.ts |
Reads path-grant metadata. |
src/vs/platform/agentHost/common/sandboxPathGrant.ts |
Defines and applies grants. |
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts |
Executes and tracks grants. |
src/vs/platform/agentHost/node/copilot/copilotToolDisplay.ts |
Builds grant confirmations. |
src/vs/platform/agentHost/node/sessionPermissions.ts |
Preserves grant options. |
src/vs/platform/agentHost/test/common/agentPermissionResponseMeta.test.ts |
Tests acknowledgement metadata. |
src/vs/platform/agentHost/test/common/sandboxPathGrant.test.ts |
Tests grant validation and application. |
src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts |
Tests runtime grant flows. |
src/vs/platform/agentHost/test/node/copilotToolDisplay.test.ts |
Tests confirmation content. |
src/vs/platform/agentHost/test/node/sessionSandbox.test.ts |
Tests option construction. |
src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.ts |
Documents grant controls. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSandboxNotifications.ts |
Generalizes failure text. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSandboxPathGrant.ts |
Serializes settings writes. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts |
Saves grants before confirmation. |
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts |
Tests save/dispatch ordering. |
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostSandboxNotifications.test.ts |
Updates notification expectations. |
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostSandboxPathGrant.test.ts |
Tests persistent settings writes. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+3585
to
+3586
| if (!isCurrent()) { | ||
| return; |
Comment on lines
+5994
to
+5996
| if (!response.persist) { | ||
| this._sessionSandboxPathGrants.push(grant); | ||
| } |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Dileep Yavanmandha (dileepyavan)
marked this pull request as ready for review
October 14, 2026 07:02
Dileep Yavanmandha (dileepyavan)
enabled auto-merge (squash)
October 14, 2026 07:02
Aiday Marlen Kyzy (aiday-mar)
approved these changes
Oct 14, 2026
Dileep Yavanmandha (dileepyavan)
merged commit Oct 14, 2026
d548c2a
into
microsoft:main
35 checks passed
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.


Summary
This change lets the user save file access when the sandbox blocks an operation. The runtime must supply the path and access type.
settings.json. Usechat.agent.sandbox.fileSystem.userConfiguredPaths.Preserve unrelated user settings. Do not copy workspace path permissions into user settings. If the save fails, show an error and keep the confirmation open.
Remove the session-only path grant option. Put sandbox configuration and request handling in
CopilotSessionSandbox. Process configuration updates and grants in sequence. Reject expired requests and grants without a save acknowledgement.Select and track path grants in
CopilotSessionSandbox, not inCopilotAgentSession. Use the SDK's path grant contract. Do not repeat its sandbox bypass check. Keep the request-kind checks for type safety. Keep the managed-approval check because that flow permits only a one-time human decision.Update the accessibility help and tests to match the controls.
How to test
These manual steps were not run in this session. Live-provider flows were not tested.
Validation
runTeststool reported 1,325 passed, 0 failed across these files:src/vs/platform/agentHost/test/node/copilotAgentSession.test.tssrc/vs/platform/agentHost/test/node/copilotToolDisplay.test.tssrc/vs/platform/agentHost/test/node/sessionSandbox.test.tssrc/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.tssrc/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostSandboxPathGrant.test.tsnpm run -s precommit: passed through the normal Git hook. Hygiene checked all 10 committed files.Final grant-selection refactor
npm run -s precommit: passed through the normal Git hook. Hygiene checked all 3 files in commitbc407d0e362.Earlier validation commands
The header and confirmation-flow tests passed with this command:
Changed-file ESLint: passed, 10 files.
npm run eslint -- src\vs\platform\agentHost\common\sandboxPathGrant.ts src\vs\platform\agentHost\node\copilot\copilotAgentSession.ts src\vs\platform\agentHost\node\copilot\copilotSessionSandbox.ts src\vs\platform\agentHost\node\copilot\copilotToolDisplay.ts src\vs\platform\agentHost\test\node\copilotAgentSession.test.ts src\vs\platform\agentHost\test\node\copilotToolDisplay.test.ts src\vs\platform\agentHost\test\node\sessionSandbox.test.ts src\vs\workbench\contrib\chat\browser\actions\chatAccessibilityHelp.ts src\vs\workbench\contrib\chat\test\browser\agentSessions\agentHostChatContribution.test.ts src\vs\workbench\contrib\chat\test\browser\agentSessions\agentHostSandboxPathGrant.test.ts