Repository navigation
Fix sandbox state reconciliation when resuming Copilot sessions - #343654
Merged
Dileep Yavanmandha (dileepyavan) merged 10 commits intoOct 29, 2026
Merged
Conversation
Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Security-sensitive resume authorization needs human validation, and a concurrent-update reconciliation defect remains unresolved.
What changed in this PR
This PR corrects sandbox-state reconciliation when Copilot sessions resume in the Agent Host, separating prior attachment state from authorization for the resumed runtime.
Changes:
- Resolve resume-time sandbox configuration without reusing previous bypass authorization.
- Reconcile saved selections after successful updates, preserve pending bypass requests, and fail resume on managed-policy conflicts.
- Add regression coverage and document the resume behavior.
| File | Description |
|---|---|
src/vs/platform/agentHost/test/node/sessionSandbox.test.ts |
Tests resolution without prior bypass authorization. |
src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts |
Covers resume reconciliation, concurrent selections, bypass requests, and failures. |
src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts |
Updates launch calls for the resume flag. |
src/vs/platform/agentHost/node/sessionSandbox.ts |
Allows resolution to ignore applied state. |
src/vs/platform/agentHost/node/copilot/copilotSessionSandbox.ts |
Implements resume-aware application and selection reconciliation. |
src/vs/platform/agentHost/node/copilot/copilotSessionLauncher.ts |
Passes resume context into sandbox initialization. |
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts |
Forwards resume context to sandbox handling. |
src/vs/platform/agentHost/AGENTS.md |
Documents reconciliation and failure behavior. |
Review effort: Balanced
| this._configurationService.setChatSandboxEnabled(target, sandboxConfig.enabled); | ||
| if (isResume && requestedSelection === undefined && sandboxConfig.enabled | ||
| && values?.[SessionConfigKey.SandboxEnabled] === 'off' | ||
| && this._configurationService.getChatConfigValues(writeTarget) === values) { |
Preserve confirmed sandbox state, deduplicate conflict notifications, and cover background reporting and recovery. Co-authored-by: Copilot <[email protected]>
Member
Author
|
Copilot resolve the merge conflicts in this pull request |
Co-authored-by: dileepyavan <[email protected]>
Contributor
Resolved the conflicts and merged current |
Restore confirmed sandbox opt-outs through the runtime session command when current policy allows bypass. Keep policy enforcement, newer selections, and rejection handling authoritative. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Resolve sandbox test import conflicts while retaining both branches' coverage. Co-authored-by: Copilot <[email protected]>
Observe changes to sandbox state rather than every session metadata event. Windows diagnostics also updates session metadata when sandboxing is disabled, unlike Linux and macOS. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Dileep Yavanmandha (dileepyavan)
marked this pull request as ready for review
October 29, 2026 06:18
Dileep Yavanmandha (dileepyavan)
enabled auto-merge (squash)
October 29, 2026 06:19
Martin Aeschlimann (aeschli)
approved these changes
Oct 29, 2026
Alex Ross (alexr00)
approved these changes
Oct 29, 2026
Dileep Yavanmandha (dileepyavan)
deleted the
DileepY/sandbox-resume-fix
branch
October 29, 2026 08:47
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
Fix sandbox state reconciliation when resuming Copilot sessions:
offselection for the affected chat only, without overwriting newer selections or changing sibling chats.Validation
Validation after merging the fetched
origin/mainon October 28, 2026:npm run build-fast -- --client-only: passed.npm run eslint -- src/vs/platform/agentHost/test/node/sessionSandbox.test.ts src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts: passed.npm run test-node -- --run src\vs\platform\agentHost\test\node\sessionSandbox.test.ts --run src\vs\platform\agentHost\test\node\copilotSessionLauncher.test.ts --run src\vs\platform\agentHost\test\node\copilotAgentSession.test.ts --reporter dot: passed, 1,736 tests..\scripts\test.bat --run src\vs\platform\agentHost\test\node\sessionSandbox.test.ts --run src\vs\platform\agentHost\test\node\copilotSessionLauncher.test.ts --run src\vs\platform\agentHost\test\node\copilotAgentSession.test.ts --reporter dot: blocked before running tests byEPERMreplacing the Electron executable; the Node runner above passed.$files = @(git diff --name-only origin/main HEAD); node --experimental-strip-types build\hygiene.ts @files: passed, 14 eligible files checked from 16 requested paths.git diff --cached --checkbefore the merge commit andgit diff origin/DileepY/sandbox-resume-fix..HEAD --checkbefore pushing: passed.Base Branch Status
Fetched
originand mergedorigin/mainat5be653c66d6b2b47c068e2b0a40df3db66dc8b3f. Resolved import conflicts in two sandbox test files, retaining both branches' imports. Merge commit:e1942b84ee0. The pre-existing test-call updates were preserved in separate commitc3d8cc5be84.Related Issue
Fixes #344903
Fixes #343371