Agent Host: Open Dev Container workspaces in Agents - #334249
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Base:
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Ordinary local workspaces are incorrectly marked as Dev Container-preferred, and cold Agent Host startup can lose the requested handoff.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 2
New issues introduced by this change (3)
| Severity | Finding |
|---|---|
src/vs/sessions/contrib/chat/electron-browser/chat.contribution.ts — resolveWorkspace() is not a readiness check: the local Agent Host provider resolves every file:… |
|
src/vs/workbench/contrib/chat/electron-browser/agentSessions/agentSessionsActions.ts — This marks every ordinary file: workspace handoff as preferring a Dev Container, not just… |
|
src/vs/sessions/services/sessions/browser/sessionsService.ts — This new branch makes the existing _restoreCts and _cancelRestore documentation inaccurate:… |
What changed in this PR
Adds Dev Container-aware Open in Agents handoff support.
Changes:
- Decodes Dev Container authorities to local folders.
- Propagates and applies a Dev Container preference.
- Cancels startup restoration and adds focused tests.
| File | Description |
|---|---|
agentSessionsActions.test.ts |
Tests workspace handoff options. |
agentSessionsActions.ts |
Decodes Dev Container workspace authorities. |
sessionsManagementService.test.ts |
Tests restoration cancellation. |
sessionsService.ts |
Adds optional restoration cancellation. |
localAgentHostSessionsProvider.test.ts |
Tests asynchronous preference handling. |
localAgentHostSessionsProvider.ts |
Tracks pending Dev Container preferences. |
agentsWindowOpenIntent.test.ts |
Tests preference gating and routing. |
chat.contribution.ts |
Handles the incoming handoff intent. |
agentsWindowOpenIntent.ts |
Creates and configures the preferred draft. |
agentHostSessionsProvider.ts |
Extends the Agent Host provider contract. |
windowsMainService.ts |
Forwards preference through window IPC. |
windows.ts |
Extends the window service API. |
nativeHostMainService.ts |
Propagates the native handoff option. |
native.ts |
Adds the native option type. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The restoration implementation still documents an invariant contradicted by the new cancellation path.
Review tier: Balanced
Findings: None
Issues resolved since last review (3)
| Severity | Finding |
|---|---|
src/vs/sessions/services/sessions/browser/sessionsService.ts — This new branch makes the existing _restoreCts and _cancelRestore documentation inaccurate:… View resolved comment |
|
src/vs/workbench/contrib/chat/electron-browser/agentSessions/agentSessionsActions.ts — This marks every ordinary file: workspace handoff as preferring a Dev Container, not just… View resolved comment |
|
src/vs/sessions/contrib/chat/electron-browser/chat.contribution.ts — resolveWorkspace() is not a readiness check: the local Agent Host provider resolves every file:… View resolved comment |
Suppressed comments (1)
src/vs/sessions/services/sessions/browser/sessionsService.ts:1056
- This new cancellation path leaves the comment in
_restoreVisibleSessions(around line 1472) contradictory: it still says the restore token is cancelled only when the user explicitly opens a session. Please document thecancelRestorenew-session exception there as well so the restore lifecycle has one consistent contract.
if (options?.cancelRestore) {
this._cancelRestore();
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Benjamin Christopher Simmonds (@benibenj)Matched files:
Sandeep Somavarapu (@sandy081)Matched files:
Ladislau Szomoru (@lszomoru)Matched files:
|


Summary
Make Open in Agents from an editor connected to an Agent Host Dev Container open the new-session page for the corresponding local folder and preselect Dev Container execution when the feature is enabled.
Session Context
Key decisions from the development session:
main; it does not depend on Agent Host: Manage idle Dev Container lifecycle #333955.vscode-remote://dev-container+<hex-host-path>/..., decodes the local folder, and derives the Dev Container preference there; no Dev Container-specific flag or new options bag crosses the native or main-process APIs.chat.agentHost.devContainer.enabledis enabled and the local folder passes the existing asynchronous availability check. Unsupported folders remain unchecked.Changes
Validation
Refs #317380