Skip to content

[Perf] sessions: list cloud tasks without execution lookups - #346419

Merged
roblourens merged 6 commits into
mainfrom
roblou/agents/problem-summary-and-solution-suggestion
Nov 6, 2026
Merged

roblourens merged 6 commits into
mainfrom
roblou/agents/problem-summary-and-solution-suggestion

Conversation

@roblourens

@roblourens roblourens commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

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.

  • List task summaries through one Cloud catalog, with stable task-based session resources in both windows.
  • Resolve the execution and acquire its environment runtime on demand. Preserve recorded/live history, task actions, creation, and separate ownership for tasks sharing an environment.
  • Preserve legacy session links and list state, including pins, ordering, groups, and read state.
  • Route session-specific settings, models, capabilities, and chat references through the acquired runtime without making list reads acquire one.
  • Normalize creation-application labels before opening a task, and hide stale queued default-title placeholders using summary metadata rather than execution/history probes.

Reviewer notes

  • Integrated upstream's workbench Sessions modules and pane-based chat selection.
  • Preserves lazy archive scopes, bounded recent-inventory windows, automatic-refresh/feed suppression, connection recovery, and discovery diagnostics.
  • Existing-session provider lookups accept session context to select an already acquired runtime behind the catalog. A URI-based API simplification is left for a follow-up.
  • The placeholder heuristic applies only to tasks named exactly New remote session that are explicitly queued and have not been modified for at least 24 hours. Failed, recently modified, or insufficiently described tasks remain visible.
  • No shared HTTP-client migration or archive-loading redesign.

How to test

  1. With many cloud tasks, open/reload the session list. Listing and cached restoration should not resolve every task's execution, read every conversation's history, or construct one runtime provider per environment. Targeted task-feed updates may still read the indicated task.
  2. Open a row, inspect its conversation, send a follow-up, and reopen it. Verify only the selected execution is acquired and then reused. In the Editor, verify the model picker uses that environment's models; chat-reference drops must not cross environments.
  3. Expand/collapse Archives; rename, archive, and delete tasks; reload and check list state and old session links. With tasks sharing an environment, actions must still target the correct task. Newly discovered tasks should default to unread unless saved or migrated state says otherwise.
  4. Verify creation-application badges remain consistent before and after opening, stale queued placeholders are hidden, and legitimate failed or recently modified default-title tasks remain visible.

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)

roblourens and others added 2 commits November 5, 2026 17:47
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]>
Copilot AI balanced review requested due to automatic review settings November 6, 2026 00:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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
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

roblourens and others added 4 commits November 6, 2026 10:54
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]>
Supply the required connection service and provider events in dependent chat input, blocking, and banner fixtures.

Co-authored-by: Copilot <[email protected]>
@roblourens
roblourens marked this pull request as ready for review November 6, 2026 17:42
@roblourens
roblourens enabled auto-merge (squash) November 6, 2026 17:42
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Kyle Cutler (@kycutler)

Matched files:

  • src/vs/sessions/contrib/browserView/browser/sessionBrowserNetwork.ts

Joaquín Ruales (@jruales)

Matched files:

  • src/vs/sessions/contrib/browserView/browser/sessionBrowserNetwork.ts

Sandeep Somavarapu (@sandy081)

Matched files:

  • src/vs/workbench/contrib/sessions/browser/agentHostCustomizationService.ts
  • src/vs/workbench/contrib/sessions/browser/agentHostFilterService.ts
  • src/vs/workbench/contrib/sessions/browser/sessionGroupsService.ts
  • src/vs/workbench/contrib/sessions/browser/sessionsListModelService.ts
  • src/vs/workbench/contrib/sessions/browser/sessionsManagementService.ts
  • src/vs/workbench/contrib/sessions/browser/sessionsProvidersService.ts
  • src/vs/workbench/contrib/sessions/browser/sessionsService.ts
  • src/vs/workbench/contrib/sessions/common/agentHostSessionsProvider.ts
  • src/vs/workbench/contrib/sessions/common/session.ts
  • src/vs/workbench/contrib/sessions/common/sessionApplication.ts
  • src/vs/workbench/contrib/sessions/common/sessionsProvider.ts

Ladislau Szomoru (@lszomoru)

Matched files:

  • src/vs/workbench/contrib/sessions/browser/agentHostCustomizationService.ts
  • src/vs/workbench/contrib/sessions/browser/agentHostFilterService.ts
  • src/vs/workbench/contrib/sessions/browser/sessionGroupsService.ts
  • src/vs/workbench/contrib/sessions/browser/sessionsListModelService.ts
  • src/vs/workbench/contrib/sessions/browser/sessionsManagementService.ts
  • src/vs/workbench/contrib/sessions/browser/sessionsProvidersService.ts
  • src/vs/workbench/contrib/sessions/browser/sessionsService.ts
  • src/vs/workbench/contrib/sessions/common/agentHostSessionsProvider.ts
  • src/vs/workbench/contrib/sessions/common/session.ts
  • src/vs/workbench/contrib/sessions/common/sessionApplication.ts
  • src/vs/workbench/contrib/sessions/common/sessionsProvider.ts

@roblourens
roblourens merged commit fbdefe8 into main Nov 6, 2026
51 checks passed
@roblourens
roblourens deleted the roblou/agents/problem-summary-and-solution-suggestion branch November 6, 2026 18:25
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone Nov 6, 2026
@bryanchen-d

Copy link
Copy Markdown
Collaborator

roblourens heads-up: main CI has been red since this PR merged. 493783 (3bd71c378f) fails the same 10 unit tests on Linux, Windows and macOS, in both the Electron and Browser runners:

  • Chat window changeset actions
  • Sessions chat window provider
  • Sessions - Headers
  • Workbench - Titlebar Part
TypeError: this.event is not a function
    at FromEventObservableSignal.onFirstObserverAdded (observableSignalFromEvent.js:26)
    ...
    at Derived._computeFn (sessionAgentMerge.js:30)

The new observeSessionProvider in sessionAgentMerge.ts calls observableSignalFromEvent(session, providers.onDidChangeProviders). The ISessionsProvidersService test doubles in those suites only override getProvider (for example chatWindowChangesetActions.test.ts and sessionsChatWindowProvider.test.ts), so onDidChangeProviders is undefined. The last green main CI (493768, 169a1c1656) doesn't include this PR, and it's the only change in the range that touches this code.

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 onDidChangeProviders: Event.None to those doubles, or guard the call site? We have a test-only fix ready as a fallback and will open it if you'd rather we do.

Co-authored with Copilot

Bryan Chen (bryanchen-d) added a commit that referenced this pull request Nov 6, 2026
#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]>
Bryan Chen (bryanchen-d) added a commit that referenced this pull request Nov 6, 2026
…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]>
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.

4 participants