Repository navigation
Convert workspace-less sessions to workspace sessions - #334250
Sandeep Somavarapu (sandy081) merged 10 commits into
Conversation
|
Base:
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
One or more issues must be addressed before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 4
New issues introduced by this change (5)
| Severity | Finding |
|---|---|
src/vs/platform/agentHost/common/state/sessionActions.ts — This type widening does not actually put null on the wire. SessionSummaryNotifier.flush still… |
|
src/vs/platform/agentHost/node/agentHostStateManager.ts — This mutates authoritative SessionState without an action, so already-subscribed clients never… |
|
src/vs/platform/agentHost/node/chatContributions/sessionWorkspaceConversion/sessionWorkspaceConversionService.ts — When unsafe provider cleanup succeeds, error.quarantined is false, so this removes the pending… |
|
src/vs/platform/agentHost/node/copilot/copilotAgent.ts — These three writes are not atomic despite representing one metadata snapshot. A crash or write… |
|
src/vs/platform/agentHost/node/agentServiceComposition.ts — This lazily resolves a service through IInstantiationService, hiding the dependency and the… |
What changed in this PR
Adds in-place conversion of workspace-less Agent Host sessions into workspace-backed sessions while preserving session identity and history.
Changes:
- Adds the
set_workspacetool, workspace trust flow, and optional worktree isolation. - Adds conversion lifecycle handling, continuation turns, and queue gating.
- Synchronizes workspace metadata and confirmation presentation across Agent Host and Sessions UI.
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/browser/agentSessions/stateToProgressAdapter.test.ts | Updated as part of this pull request. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/stateToProgressAdapter.ts | Updated as part of this pull request. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListStore.ts | Updated as part of this pull request. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts | Updated as part of this pull request. |
| src/vs/sessions/contrib/providers/agentHost/browser/baseAgentHostSessionsProvider.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/shared/worktreeIsolation.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/sessionServerTools.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/sessionDatabase.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/serverToolGroups.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/protocolServerHandler.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/mockAgent.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/copilotToolDisplay.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/copilotShellTools.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/codex/codexCreateChat.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/claudeAgent.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/chatContributions.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/agentSideEffects.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/agentServiceTestUtils.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/agentService.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/agentHostTurnTelemetry.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/agentHostTurnHangTelemetry.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/agentHostToolCallTelemetry.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/node/agentHostPromptRegistry.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/electron-browser/agentHostProtocolClient.test.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/test/common/sessionTestHelpers.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/shared/worktreeIsolation.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/shared/sessionServerTools.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/shared/artifactServerTools.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/shared/agentServerToolHost.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/shared/agentMergeServerTools.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/shared/agentFeedbackServerTools.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/sessionDatabase.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/protocolServerHandler.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/copilot/prompts/systemMessage.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/copilot/copilotToolDisplay.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/copilot/copilotShellTools.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/copilot/copilotAgent.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/copilot/agentHostSandboxEngine.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/codex/codexAgent.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/claude/claudeCanUseTool.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/claude/claudeAgent.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/chatContributions/sessionWorkspaceConversion/sessionWorkspaceConversionService.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/chatContributions/sessionWorkspaceConversion/sessionWorkspaceConversionContribution.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/chatContributions/queueDrain/queueDrainContribution.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/chatContributions/builtInChatContributions.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/agentSideEffects.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/agentServiceFoundation.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/agentServiceComposition.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/agentService.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/agentHostTurnService.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/agentHostStateManager.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/agentHostServices.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/agentHostClientConnectionService.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/node/agentHostBootstrap.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/state/sessionState.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/state/sessionActions.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/sessionDataService.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/serverToolNames.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/agentHostExtensionProtocol.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/common/agent.ts | Updated as part of this pull request. |
| src/vs/platform/agentHost/browser/agentHostProtocolClient.ts | Updated as part of this pull request. |
Suppressed comments (4)
src/vs/platform/agentHost/node/agentHostTurnService.ts:29
- This class is stateless routing, but the established contribution architecture keeps such logic as a plain
ServicesAccessorfunction (agentHostTurnStarter.ts:45-47) to avoid adding registrations to every hand-built service graph. This new service already forces several unrelated telemetry tests to wire it. KeephandleTurnStarted/host-authored start as plain helpers instead.
/** Standard turn admission and provider routing shared by client- and host-authored turns. */
export class AgentHostTurnService implements IAgentHostTurnService {
src/vs/platform/agentHost/node/chatContributions/sessionWorkspaceConversion/sessionWorkspaceConversionService.ts:415
setSessionConfigis a create/restore seeding API that only mutates host memory. During this live conversion, existing subscribers do not receive the added schema; when they previously had no config, the followingSessionConfigChangedaction is also a no-op inchannels-session/reducer.ts:214-216. Publish a config-replacement action (schema and values), or ensure this schema is part of the initial snapshot.
this._stateManager.setSessionConfig(session.toString(), {
schema: { type: 'object', properties },
values: { ...currentConfig?.values },
});
src/vs/platform/agentHost/node/chatContributions/sessionWorkspaceConversion/sessionWorkspaceConversionService.ts:473
- This text is rendered as a visible system-initiated request row, so these hard-coded English strings are user-facing. Localize the success/failure variants with placeholders, as is already done for the labels below.
const text = converted
? `The current session is now attached to ${(pending.resolvedWorkingDirectory ?? pending.workspaceFolder).fsPath}${pending.isolation ? ' in an isolated worktree' : ''}. Continue the user's original task in this workspace. Do not request another session or workspace conversion.`
: `The requested workspace setup did not complete successfully: ${errorMessage}. Do not run the user's task. Tell the user that workspace setup failed and include this error.`;
src/vs/platform/agentHost/node/chatContributions/sessionWorkspaceConversion/sessionWorkspaceConversionService.ts:250
- Publish the new working directory before clearing the workspace-less marker. Each state-manager mutation is delivered separately, so the current order briefly exposes a regular workspace session whose only root is still the scratch directory; Sessions clients can react to that intermediate snapshot and open/group the session under the wrong workspace. Keeping the marker set until the replacement action lands avoids making that stale state observable.
this._stateManager.setSessionMeta(session.toString(), withSessionWorkspaceless(finalState._meta, false));
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
f01d3c0 to
1bf3d6b
Compare
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: TylerLeonhardtMatched files:
|
1bf3d6b to
a99508b
Compare
Allow an agent to attach a workspace-less session to a folder or managed worktree without replacing the session or losing conversation history. Propagate the new project, working directory, continuation, and activity state through Agent Host and Sessions UI. Co-authored-by: Copilot <[email protected]>
Reserve a visible host-authored turn while workspace setup completes, then route that same turn through normal provider admission. Keep project updates catalog-only, durably quarantine disposed provider sessions, atomically persist Copilot workspace metadata, and wire conversion without lazy service lookup.\n\nCo-authored-by: Copilot <[email protected]>
Use a stable visible continuation request and add synchronized Workspace Set or Workspace Setup Failed notifications to the same turn.\n\nCo-authored-by: Copilot <[email protected]>
Clean up imports left behind while adapting the workspace conversion changes to the current Agent Host composition. Co-authored-by: Copilot <[email protected]>
Pass operation names through the updated Copilot chat queue API for working-directory mutations and their sequencing tests. Co-authored-by: Copilot <[email protected]>
Create in-memory customization directories before writing fixtures and derive expected paths from URI.fsPath so assertions follow the host platform.\n\nCo-authored-by: Copilot <[email protected]>
Serialize creation of customization fixture directories because the in-memory filesystem's recursive mkdir path is not safe when sibling operations race.\n\nCo-authored-by: Copilot <[email protected]>
Use the real disk provider for native Windows customization paths, prevent late aborted-idle events from cancelling replacement turns, and give the full property initialization checker enough heap for the expanded Agent Host sources.\n\nCo-authored-by: Copilot <[email protected]>
667f3ac to
45224c7
Compare
Co-authored-by: Copilot <[email protected]>


This pull request implements the conversion of workspace-less sessions to workspace sessions, addressing user requests for a seamless transition between session types. Key changes include:
New Features:
sessionWorkspaceConversionContributionandsessionWorkspaceConversionServiceto manage the conversion process.agentHostTurnServiceto support a two-phase continuation for a smoother user experience during workspace setup.Improvements:
Bug Fixes:
This update aims to provide a more integrated experience for users transitioning from quick chats to full workspace sessions, maintaining session identity and improving UI responsiveness.