Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

Enables multi-select support in the agent sessions tree view, allowing batch operations on multiple sessions at once.

Changes

  • Tree control: Set multipleSelectionSupport: true to enable standard multi-select gestures (Ctrl/Cmd+click, Shift+click)
  • Context handling: Extended IMarshalledAgentSessionContext with sessions array; context menu now passes all selected sessions when multiple are selected
  • Actions: Refactored BaseAgentSessionAction from runWithSession to runWithSessions to iterate over all selected sessions for:
    • Mark as Read / Unread
    • Archive / Unarchive
  • Consolidated confirmation dialog: When archiving multiple sessions with pending edits, shows a single confirmation dialog that displays the count of affected sessions and provides "Keep & Archive" or "Undo & Archive" options, rather than showing separate dialogs for each session
  • Backward compatibility: Uses context.sessions ?? [context.session] fallback for callers that don't provide the new field

Selection behavior

Follows standard file explorer pattern: right-clicking a session in the current selection operates on all selected sessions; right-clicking outside the selection operates on only that session.

Original prompt

This section details on the original issue you should resolve

<issue_title>Agent sessions: support multi select for operations like marking read or archive</issue_title>
<issue_description>This would make it much easier to cleanup many sessions from the view.</issue_description>

<agent_instructions>start with allowing multi select for marking read, marking unread, archiving and unarchiving.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…ve/unarchive operations

Co-authored-by: bpasero <900690+bpasero@users.noreply.github.com>
Copilot AI changed the title [WIP] Add multi select support for agent session operations Agent sessions: support multi-select for mark read/unread and archive/unarchive Jan 16, 2026
Copilot AI requested a review from bpasero January 16, 2026 19:28
@bpasero bpasero marked this pull request as ready for review January 17, 2026 06:04
Copilot AI review requested due to automatic review settings January 17, 2026 06:04
@bpasero bpasero enabled auto-merge (squash) January 17, 2026 06:05
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 17, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enables multi-select support for the agent sessions tree view, allowing users to perform batch operations on multiple sessions simultaneously. The implementation follows standard file explorer multi-select patterns with Ctrl/Cmd+click and Shift+click gestures.

Changes:

  • Enabled multi-select support in the tree control and extended context handling to pass selected sessions
  • Refactored mark read/unread and archive/unarchive actions to iterate over multiple sessions
  • Added context key tracking for multi-selection state and appropriate preconditions for single-session operations

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/vs/workbench/contrib/chat/common/actions/chatContextKeys.ts Adds new context key to track when multiple agent sessions are selected
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.ts Extends IMarshalledAgentSessionContext with sessions array for multi-selection support; includes label splitting defensive fix
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.ts Enables multipleSelectionSupport in tree config and updates context menu to pass all selected sessions
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.ts Refactors BaseAgentSessionAction from runWithSession to runWithSessions to handle batch operations; adds precondition to rename action
Comments suppressed due to low confidence (1)

src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.ts:170

  • The sessions field should be marked as optional with a question mark since the code handles its absence with a fallback (context.sessions ?? [context.session]). This would make the TypeScript type definition match the runtime behavior and provide better type safety.
	readonly sessions: IAgentSession[]; // support for multi-selection

Copilot AI and others added 2 commits January 17, 2026 07:12
…s with pending edits

Co-authored-by: bpasero <900690+bpasero@users.noreply.github.com>
Co-authored-by: bpasero <900690+bpasero@users.noreply.github.com>
Copilot AI requested a review from bpasero January 17, 2026 07:15
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.

Agent sessions: support multi select for operations like marking read or archive

2 participants