Skip to content

Revert "Don't add agent-host worktree as workspace folder (#310888)"#311525

Merged
roblourens merged 2 commits intomainfrom
roblou/agents/revert-agenthost-workspace-folder-change
Apr 20, 2026
Merged

Revert "Don't add agent-host worktree as workspace folder (#310888)"#311525
roblourens merged 2 commits intomainfrom
roblou/agents/revert-agenthost-workspace-folder-change

Conversation

@roblourens
Copy link
Copy Markdown
Member

@roblourens roblourens commented Apr 20, 2026

Reverts #310888, and removes the remaining AGENT_HOST_SCHEME guard (and its now-unused import) in getActiveSessionFolderData so that agent-host repository URIs are once again added as workspace folders too.

Fixes #311383.

(Written by Copilot)

This reverts commit f97c287.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 20, 2026 22:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_SCHEME guard that previously prevented repo.workingDirectory (worktree) from being added as a workspace folder.
  • Keeps an AGENT_HOST_SCHEME guard only for the repository fallback 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 worktree branch returns the session working directory as a workspace folder without excluding AGENT_HOST_SCHEME. If repo.workingDirectory is an agent-host URI (remote agent host sessions), this will re-add the agent-host worktree to the workspace, reintroducing the noisy PromptFilesLocator warnings/extra probing that #310888 addressed. Consider restoring the scheme guard for worktree as well (or hoisting the guard above both the worktree and repository branches).
		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

@github-actions
Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 641cbea2 Current: 88c7c29c

Changed (1)

editor/inlineCompletions/other/JumpToHint/Dark
Before After
before after

vijayupadya
vijayupadya previously approved these changes Apr 20, 2026
@roblourens roblourens marked this pull request as draft April 20, 2026 22:44
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@roblourens roblourens marked this pull request as ready for review April 20, 2026 23:17
@roblourens roblourens enabled auto-merge (squash) April 20, 2026 23:17
@roblourens roblourens merged commit 25032cf into main Apr 20, 2026
40 of 41 checks passed
@roblourens roblourens deleted the roblou/agents/revert-agenthost-workspace-folder-change branch April 20, 2026 23:24
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent host via tunnel: Files view is empty

4 participants