Skip to content

fix #320774#321173

Merged
sandy081 merged 1 commit into
mainfrom
sandy081/valuable-tyrannosaurus
Jun 12, 2026
Merged

fix #320774#321173
sandy081 merged 1 commit into
mainfrom
sandy081/valuable-tyrannosaurus

Conversation

@sandy081

Copy link
Copy Markdown
Member

fix #320774

Copilot AI review requested due to automatic review settings June 12, 2026 15:49
@sandy081 sandy081 enabled auto-merge (squash) June 12, 2026 15:49
@sandy081 sandy081 self-assigned this Jun 12, 2026

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.

Pull request overview

This PR addresses issue #320774 in the Agents window by making the “New Session / New Chat” flow (Cmd/Ctrl+N and the Sessions sidebar “New” button) inherit the currently active session’s workspace, so the new-session composer starts with the same workspace preselected.

Changes:

  • Route the Sessions view “New” button through the registered command (workbench.action.sessions.newChat) instead of calling services directly.
  • Update the workbench.action.sessions.newChat action to open the new-session composer with folderUri set from the active session’s workspace URI.
  • Centralize the command id string into a shared constant.
Show a summary per file
File Description
src/vs/sessions/contrib/sessions/browser/views/sessionsView.ts Uses ICommandService + shared action id constant to trigger the “New Chat” command from the Sessions view button and to resolve its keybinding hint.
src/vs/sessions/contrib/chat/common/constants.ts Introduces NEW_SESSION_ACTION_ID constant for reuse across contributions.
src/vs/sessions/contrib/chat/browser/chat.contribution.ts Updates the Cmd/Ctrl+N action to pass the active session workspace URI into openNewSession(...), enabling workspace inheritance.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 3

Comment on lines 67 to 71
override run(accessor: ServicesAccessor): void {
const sessionsManagementService = accessor.get(ISessionsManagementService);
const sessionsViewService = accessor.get(ISessionsViewService);
const sessionsPartService = accessor.get(ISessionsPartService);
sessionsViewService.openNewSession();
sessionsPartService.focusSession(sessionsManagementService.activeSession.get());
sessionsViewService.openNewSession({ folderUri: sessionsManagementService.activeSession.get()?.workspace.get()?.uri });
}
Comment on lines 12 to 13
import { ISessionsManagementService } from '../../../services/sessions/common/sessionsManagement.js';
import { ISessionsPartService } from '../../../services/sessions/browser/sessionsPartService.js';
import { ISessionsViewService } from '../../../services/sessions/browser/sessionsViewService.js';
const sessionsPartService = accessor.get(ISessionsPartService);
sessionsViewService.openNewSession();
sessionsPartService.focusSession(sessionsManagementService.activeSession.get());
sessionsViewService.openNewSession({ folderUri: sessionsManagementService.activeSession.get()?.workspace.get()?.uri });
@sandy081 sandy081 merged commit 4cf8f57 into main Jun 12, 2026
26 checks passed
@sandy081 sandy081 deleted the sandy081/valuable-tyrannosaurus branch June 12, 2026 20:15
@vs-code-engineering vs-code-engineering Bot added this to the 1.125.0 milestone Jun 12, 2026
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.

Creating a new session in Agents window should inherit my current session's workspace

3 participants