Merged
Conversation
Co-authored-by: Copilot <copilot@github.com>
Contributor
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes working-directory handling for agent-host terminals in the Agents/Sessions web experience, aiming to avoid incorrect/duplicate terminal creation and to provide a sensible default cwd when the terminal service can’t infer one.
Changes:
- Normalize contributed-profile
cwdvalues and allow subclasses to provide a context-aware default cwd for agent-host terminals. - Prevent Sessions window from creating a duplicate “home” terminal for agent-host sessions.
- Resolve agent-host terminal cwd to a usable filesystem path server-side and fall back when the directory is inaccessible.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostTerminalContribution.ts | Adds cwd normalization and a subclass hook for supplying a default cwd when terminal service doesn’t provide one. |
| src/vs/sessions/contrib/terminal/browser/sessionsTerminalContribution.ts | Skips local “home” terminal creation for agent-host sessions to prevent duplicates. |
| src/vs/sessions/contrib/remoteAgentHost/browser/remoteAgentHostTerminal.contribution.ts | Derives a default cwd from the active session’s worktree for the selected remote agent host. |
| src/vs/platform/agentHost/node/agentHostTerminalManager.ts | Converts protocol cwd into a filesystem path and adds a fallback if the directory is missing/inaccessible. |
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 1
Co-authored-by: Copilot <copilot@github.com>
pwang347
approved these changes
Apr 17, 2026
joshspicer
approved these changes
Apr 17, 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.
Co-authored-by: Copilot copilot@github.com