agentHost: isolate created sessions across projects - #333745
Merged
Sandeep Somavarapu (sandy081) merged 1 commit intoSep 1, 2026
Merged
Conversation
Only inherit the source session's isolation when the requested workspace matches its project root. Default cross-project and workspace-less session creation to worktree isolation while preserving existing validation for unsupported folders. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sandeep Somavarapu (sandy081)
enabled auto-merge (squash)
September 1, 2026 09:53
Copilot started reviewing on behalf of
Sandeep Somavarapu (sandy081)
September 1, 2026 09:54
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: None
What changed in this PR
This PR prevents delegated Agent Host sessions from directly modifying unrelated projects.
Changes:
- Propagates the source session’s project root into creation defaults.
- Inherits isolation only for matching projects; otherwise defaults to worktree isolation.
- Updates focused tests for same-project, cross-project, and workspace-less creation.
| File | Description |
|---|---|
src/vs/platform/agentHost/node/shared/sessionServerTools.ts |
Selects isolation based on project equality. |
src/vs/platform/agentHost/node/agentService.ts |
Exposes the source project in creation defaults. |
src/vs/platform/agentHost/test/node/sessionServerTools.test.ts |
Tests project-aware isolation selection. |
src/vs/platform/agentHost/test/node/agentService.test.ts |
Updates end-to-end creation expectations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Dirk Bäumer (dbaeumer)
approved these changes
Sep 1, 2026
Sandeep Somavarapu (sandy081)
deleted the
sandy081/agents/create-session-tool-worktree-isolation
branch
September 1, 2026 10:36
Bhavya U (bhavyaus)
pushed a commit
that referenced
this pull request
Sep 1, 2026
Only inherit the source session's isolation when the requested workspace matches its project root. Default cross-project and workspace-less session creation to worktree isolation while preserving existing validation for unsupported folders. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2 tasks
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.
What changed
create_sessiondefaultsWhy
A Quick Chat or a session working in another repository should not cause newly delegated work to run directly in the target folder. Isolation inheritance is only appropriate when both sessions belong to the same project.
Validation
npm run hygienenpm run typecheck-client