Revert "Don't add agent-host worktree as workspace folder (#310888)"#311525
Merged
roblourens merged 2 commits intomainfrom Apr 20, 2026
Merged
Revert "Don't add agent-host worktree as workspace folder (#310888)"#311525roblourens merged 2 commits intomainfrom
roblourens merged 2 commits intomainfrom
Conversation
This reverts commit f97c287. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reverts prior behavior in the Agents/Sessions window workspace-folder management by allowing a session’s workingDirectory (worktree) to be added as the workspace folder again, even when it’s an agent-host URI.
Changes:
- Removes the
AGENT_HOST_SCHEMEguard that previously preventedrepo.workingDirectory(worktree) from being added as a workspace folder. - Keeps an
AGENT_HOST_SCHEMEguard only for therepositoryfallback branch.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/contrib/workspace/browser/workspaceFolderManagement.ts | Reverts agent-host scheme exclusion for worktree-derived workspace folder selection. |
Copilot's findings
Comments suppressed due to low confidence (1)
src/vs/sessions/contrib/workspace/browser/workspaceFolderManagement.ts:79
- The
worktreebranch returns the session working directory as a workspace folder without excludingAGENT_HOST_SCHEME. Ifrepo.workingDirectoryis an agent-host URI (remote agent host sessions), this will re-add the agent-host worktree to the workspace, reintroducing the noisyPromptFilesLocatorwarnings/extra probing that #310888 addressed. Consider restoring the scheme guard forworktreeas well (or hoisting the guard above both theworktreeandrepositorybranches).
if (worktree) {
return {
uri: worktree,
name: repository ? `${this.uriIdentityService.extUri.basename(repository)} (${branchName ?? this.uriIdentityService.extUri.basename(worktree)})` : this.uriIdentityService.extUri.basename(worktree)
};
- Files reviewed: 1/1 changed files
- Comments generated: 0
Contributor
vijayupadya
previously approved these changes
Apr 20, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
benvillalobos
approved these changes
Apr 20, 2026
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.
Reverts #310888, and removes the remaining
AGENT_HOST_SCHEMEguard (and its now-unused import) ingetActiveSessionFolderDataso that agent-host repository URIs are once again added as workspace folders too.Fixes #311383.
(Written by Copilot)