Repository navigation
[Perf] sessions: list cloud tasks without execution lookups - #346419
Conversation
List cloud sandbox task summaries without resolving every execution or constructing per-environment providers. Acquire execution details and private runtimes only when needed, while preserving stable task identity, existing history behavior and legacy resource routing. Refs #345234, #345481. Co-authored-by: Copilot <[email protected]>
Integrate task-based cloud listing with upstream archive scopes, bounded inventory refreshes, focused-session targeting and per-chat model configuration. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved restoration and provider-handoff bugs can leave chats non-interactive, accept stale provider results, overwrite read-state changes, and silently ignore settings saves.
9 open issues
Refresh cached Agent Merge state when the provider changes · New Resolve filesystem settings with the session ID · New Rebind the active chat when the runtime replaces the fallback · New Index legacy read states once and only use them as a fallback · New Preserve catalog read state when hydrating the runtime · New Persist read-state actions for summary-only tasks · New Cancel pending loads when disposing the live store · New Resolve the workspace using the task resource · New Register completion triggers for the task content provider · New
What changed in this PR
This PR separates cloud task listing from execution acquisition to reduce discovery requests and renderer work when restoring large inventories, addressing #345234 and #345481.
Changes:
- Introduces task-based catalogs and stable session resources, resolving execution details on demand.
- Routes session operations to acquired runtimes and adds legacy identity/state migration.
- Adds regression coverage for catalog restoration, runtime routing, shared environments and connection replacement.
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/test/common/mockChatSessionsService.ts |
Supports previous-resource mappings in tests. |
src/vs/workbench/contrib/chat/test/browser/widgetHosts/editor/chatEditorInput.test.ts |
Tests editor reuse across identity migration. |
src/vs/workbench/contrib/chat/test/browser/remoteAgentHost/cloudSandboxSessionHandler.test.ts |
Tests live-provider replacement. |
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentSessionViewModel.test.ts |
Tests cross-scheme state migration. |
src/vs/workbench/contrib/chat/common/chatSessionsService.ts |
Adds task recognition and identity-migration contracts. |
src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditorInput.ts |
Matches editors through previous identities. |
src/vs/workbench/contrib/chat/browser/remoteAgentHost/editorCloudSandboxContribution.ts |
Integrates the Editor task catalog and routing. |
src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxTaskSessionRegistration.ts |
Registers task content and request routing. |
src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxTaskListController.ts |
Lists task summaries and delegates task actions. |
src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionListController.ts |
Adds task aliases and runtime-resource translation. |
src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionHandler.ts |
Preserves transcripts across live-provider replacement. |
src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxReadOnlySessionHandler.ts |
Resolves recorded history using execution session IDs. |
src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxApiService.ts |
Separates summary listing from execution resolution. |
src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts |
Exposes controller-owned previous identities. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.ts |
Migrates state through explicit identity mappings. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts |
Preserves public session identity when forking chats. |
src/vs/sessions/SESSIONS.md |
Documents catalog identity and runtime routing. |
src/vs/sessions/services/sessions/test/browser/sessionsProvidersService.test.ts |
Tests routing without extra provider registration. |
src/vs/sessions/services/sessions/test/browser/sessionsListModelService.test.ts |
Tests pin and ordering migration. |
src/vs/sessions/services/sessions/test/browser/sessionGroupsService.test.ts |
Tests one-time group migration. |
src/vs/sessions/services/sessions/common/sessionsProvider.ts |
Adds acquired-runtime lookup. |
src/vs/sessions/services/sessions/common/session.ts |
Declares previous session identities. |
src/vs/sessions/services/sessions/browser/visibleSessions.ts |
Forwards previous identities through wrappers. |
src/vs/sessions/services/sessions/browser/sessionsService.ts |
Uses session-aware provider routing. |
src/vs/sessions/services/sessions/browser/sessionsProvidersService.ts |
Resolves acquired providers by session ID. |
src/vs/sessions/services/sessions/browser/sessionsManagementService.ts |
Recognizes legacy resources and routes operations. |
src/vs/sessions/services/sessions/browser/sessionsListModelService.ts |
Migrates persisted list state. |
src/vs/sessions/services/sessions/browser/sessionScopedContextKeys.ts |
Resolves context keys against session providers. |
src/vs/sessions/services/sessions/browser/sessionGroupsService.ts |
Migrates group membership and explicit ungrouping. |
src/vs/sessions/services/agentHostFilter/test/browser/agentHostFilterService.test.ts |
Tests catalog-only host grouping. |
src/vs/sessions/services/agentHostFilter/browser/agentHostFilterService.ts |
Includes catalog providers in host groups. |
src/vs/sessions/services/agentHost/browser/agentHostCustomizationService.ts |
Routes customizations to acquired runtimes. |
src/vs/sessions/contrib/worktreeSuggestion/browser/worktreeSuggestionService.ts |
Uses session-aware worktree routing. |
src/vs/sessions/contrib/terminal/browser/sessionsTerminalContribution.ts |
Resolves terminals through session runtimes. |
src/vs/sessions/contrib/terminal/browser/agentHostSessionTaskRunner.ts |
Resolves task-runner host by session. |
src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts |
Uses session-specific environment metadata. |
src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.ts |
Resolves session-specific host labels. |
src/vs/sessions/contrib/sessions/browser/sessionHoverContent.ts |
Resolves session-specific hover metadata. |
src/vs/sessions/contrib/sessionComparison/browser/modelEvaluationTools.ts |
Routes evaluations through the caller’s runtime. |
src/vs/sessions/contrib/remoteSessions/test/browser/remoteSessionInspector.test.ts |
Tests inspection through a catalog. |
src/vs/sessions/contrib/remoteSessions/browser/remoteSessionMessageRouter.ts |
Routes messages to session runtimes. |
src/vs/sessions/contrib/remoteSessions/browser/remoteSessionInspector.ts |
Finds acquired runtimes behind catalogs. |
src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/remoteAgentHostSessionsProvider.test.ts |
Tests task identities and runtime membership. |
src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/cloudSandboxAgentHostContribution.test.ts |
Tests lazy resolution and bounded restoration. |
src/vs/sessions/contrib/providers/remoteAgentHost/REMOTE_AGENT_HOST_SESSIONS_PROVIDER.md |
Documents task catalogs and execution acquisition. |
src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostSessionsProvider.ts |
Supports mapped resources and catalog provider IDs. |
src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxTaskSessionsProvider.ts |
Implements the Agents Window task catalog. |
src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxSessionsProvider.ts |
Reconciles task identities and withheld sessions. |
src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHostContribution.ts |
Registers one catalog with private runtimes. |
src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.ts |
Publishes created sessions by execution ID. |
src/vs/sessions/contrib/providers/agentHost/browser/openSubagentChat.ts |
Resolves subagent chats through session runtimes. |
src/vs/sessions/contrib/providers/agentHost/browser/openAgentHostStateFileAction.ts |
Uses session-aware state-file routing. |
src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileChatPhoneInputPresenter.ts |
Routes mobile controls to session runtimes. |
src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileChatInputConfigPicker.ts |
Uses session-aware configuration lookup. |
src/vs/sessions/contrib/providers/agentHost/browser/exportDebugLogsAction.ts |
Resolves the selected session’s runtime. |
src/vs/sessions/contrib/providers/agentHost/browser/baseAgentHostSessionsProvider.ts |
Supports public-resource rebinding and cached read-state access. |
src/vs/sessions/contrib/providers/agentHost/browser/agentSessionSettingsFileSystemProvider.ts |
Makes schema lookup session-aware. |
src/vs/sessions/contrib/providers/agentHost/browser/agentMergeActions.ts |
Routes merge actions to session runtimes. |
src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionConfigPicker.ts |
Resolves configuration providers by session. |
src/vs/sessions/contrib/providers/agentHost/browser/agentHostPermissionPickerDelegate.ts |
Uses session-aware permission-provider lookup. |
src/vs/sessions/contrib/providers/agentHost/browser/agentHostModePicker.ts |
Uses session-aware mode configuration. |
src/vs/sessions/contrib/providers/agentHost/browser/agentHostAgentPicker.ts |
Resolves agent pickers through session runtimes. |
src/vs/sessions/contrib/chat/electron-browser/chat.contribution.ts |
Uses session-aware folder connection routing. |
src/vs/sessions/contrib/chat/browser/sessionTypePicker.ts |
Resolves session-specific harness types. |
src/vs/sessions/contrib/chat/browser/sessionModelSelection.ts |
Resolves model selection through session runtimes. |
src/vs/sessions/contrib/chat/browser/sessionChatInputToolbar.ts |
Reads configuration from session runtimes. |
src/vs/sessions/contrib/chat/browser/newSessionAction.ts |
Resolves the active session’s environment. |
src/vs/sessions/contrib/chat/browser/newChatWidget.ts |
Makes draft and comparison routing session-aware. |
src/vs/sessions/contrib/chat/browser/newChatInSessionWidget.ts |
Routes nested-chat workspace operations. |
src/vs/sessions/contrib/chat/browser/chatView.ts |
Resolves respondent and model data by session. |
src/vs/sessions/contrib/browserView/browser/sessionBrowserNetwork.ts |
Resolves browser networking through session providers. |
src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackItemsBackend.ts |
Routes feedback channels to acquired runtimes. |
src/vs/sessions/common/agentHostSessionsProvider.ts |
Adds catalog membership to host groups. |
src/vs/sessions/browser/sessionAgentMerge.ts |
Uses session-aware Agent Merge lookup. |
src/vs/sessions/browser/parts/sessionRemoteConnection.ts |
Resolves connection controls through session runtimes. |
src/vs/sessions/browser/parts/chatCompositeBar.ts |
Uses session-specific harness and action providers. |
src/vs/platform/agentHost/test/browser/agentHostConnectionsService.test.ts |
Tests alias resolution and disposal. |
src/vs/platform/agentHost/common/cloudSandboxAgentHost.ts |
Defines task summaries and lazy resolution APIs. |
src/vs/platform/agentHost/common/agentHostSessionType.ts |
Recognizes the cloud task scheme. |
src/vs/platform/agentHost/common/agentHostConnectionsService.ts |
Declares lifetime-scoped resource aliases. |
src/vs/platform/agentHost/browser/agentHostConnectionsService.ts |
Implements aliases to exact backend identities. |
Review effort: Balanced
Preserve runtime routing, read state, metadata, model selection, and input capabilities behind stable cloud task identities. Normalize application labels and hide stale queued placeholders without execution-detail reads. Co-authored-by: Copilot <[email protected]>
Adapt the cloud task catalog to the workbench Sessions modules and pane-based session model while preserving summary-only listing and discovery diagnostics. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Supply the required connection service and provider events in dependent chat input, blocking, and banner fixtures. Co-authored-by: Copilot <[email protected]>
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Kyle Cutler (@kycutler)Matched files:
Joaquín Ruales (@jruales)Matched files:
Sandeep Somavarapu (@sandy081)Matched files:
Ladislau Szomoru (@lszomoru)Matched files:
|
|
roblourens heads-up: main CI has been red since this PR merged. 493783 (
The new These unit tests gate Linux x64, Windows x64 and macOS arm64 publishing, so the 23:00 UTC insider won't ship those platforms unless main is fixed before then. Could you add
|
#346419 made sessionAgentMerge observe ISessionsProvidersService.onDidChangeProviders. The chat window test doubles only stubbed getProvider, so binding session action context keys threw 'this.event is not a function' whenever agentMergeActions was loaded in the same renderer. Co-authored-by: Copilot <[email protected]>
…nd leaked question carousels (#346643) * sessions: stub onDidChangeProviders in chat window test doubles #346419 made sessionAgentMerge observe ISessionsProvidersService.onDidChangeProviders. The chat window test doubles only stubbed getProvider, so binding session action context keys threw 'this.event is not a function' whenever agentMergeActions was loaded in the same renderer. Co-authored-by: Copilot <[email protected]> * chat: remove every question carousel the tests create Tests that create several carousels removed only the last one in teardown, so the others stayed in the page. Since #346600 they add about 130px above every later fixture, which broke the drag-buffer tests of Sessions - Headers and the compact menu direction tests of Workbench - Titlebar Part on main. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>

Related: #345234, #345481.
Summary
Cloud session listing currently needs execution details and per-environment providers before it can show task rows. That causes one task-detail request per task and expensive provider registration when restoring a large cached inventory.
Reviewer notes
New remote sessionthat are explicitly queued and have not been modified for at least 24 hours. Failed, recently modified, or insufficiently described tasks remain visible.How to test
Locally exercised repository-backed cloud creation, existing-session continuation, rename, archive/restore, cross-window history restoration, and Editor model selection with real replies in an isolated Code OSS build. Folderless creation returned a service error and was not validated successfully; changed-value session-settings writes were not live-verified.
(Written by Copilot)