Skip to content

Comments

Try cleaning up api around acquiring/loading/creating sessions#296628

Merged
mjbvz merged 2 commits intomicrosoft:mainfrom
mjbvz:dev/mjbvz/nuclear-dingo
Feb 20, 2026
Merged

Try cleaning up api around acquiring/loading/creating sessions#296628
mjbvz merged 2 commits intomicrosoft:mainfrom
mjbvz:dev/mjbvz/nuclear-dingo

Conversation

@mjbvz
Copy link
Collaborator

@mjbvz mjbvz commented Feb 20, 2026

We have a number of methods that have fairly similar names (get, load, acquire, start). This change tries to align these names a bit more so it's easier to understand which one to use

We have a number of methods that have fairly similar names (get, load, acquire, start). This change tries to align these names a bit more so it's easier to understand which one to use
Copilot AI review requested due to automatic review settings February 20, 2026 21:07
@mjbvz mjbvz enabled auto-merge February 20, 2026 21:08
@vs-code-engineering
Copy link

vs-code-engineering bot commented Feb 20, 2026

📬 CODENOTIFY

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

@jrieken

Matched files:

  • src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts
  • src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.ts
  • src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.ts

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

Aligns and clarifies the internal IChatService session lifecycle API by renaming/reshaping methods so call sites consistently express whether they are starting a new local session vs acquiring/loading an existing one.

Changes:

  • Renames session lifecycle methods (e.g. startSessionstartNewLocalSession, loadSessionForResource/getOrRestoreSessionacquireOrLoadSession, loadSessionFromContentloadSessionFromData, getActiveSessionReferenceacquireExistingSession).
  • Updates call sites across chat hosts (view pane/editor/quick/terminal/inline chat) and sessions UI to use the new API.
  • Adjusts tests/mocks and small model-store typing cleanups to match the new interface.

Reviewed changes

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

Show a summary per file
File Description
src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcome.ts Uses new acquire/load + start-new-local session APIs when initializing welcome chat.
src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.ts Starts terminal chat sessions via startNewLocalSession.
src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.ts Starts inline-editor chat sessions via startNewLocalSession.
src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.ts Updates panel-chat helper to start new local sessions.
src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts Updates edit review flows to start new local sessions.
src/vs/workbench/contrib/chat/test/common/chatService/mockChatService.ts Renames mocked methods to match the updated IChatService API.
src/vs/workbench/contrib/chat/test/common/chatService/chatService.test.ts Updates tests to use the new session lifecycle method names/params.
src/vs/workbench/contrib/chat/test/browser/chatEditing/chatEditingService.test.ts Updates editing tests to use startNewLocalSession.
src/vs/workbench/contrib/chat/test/browser/agentSessions/localAgentSessionsController.test.ts Updates test mock method names for session acquisition/loading.
src/vs/workbench/contrib/chat/common/model/chatModelStore.ts Removes redundant IDisposable usage/import (Disposable already covers it).
src/vs/workbench/contrib/chat/common/model/chatModel.ts Updates self-reference acquisition to acquireExistingSession.
src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts Implements the renamed APIs and splits local vs remote load paths.
src/vs/workbench/contrib/chat/common/chatService/chatService.ts Updates IChatService interface docs and method names for clarity.
src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.ts Uses acquireOrLoadSession + startNewLocalSession for restore/start flows.
src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditorInput.ts Uses acquireOrLoadSession, startNewLocalSession, and loadSessionFromData in editor resolution.
src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.ts Uses startNewLocalSession for quick chat model initialization.
src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts Loads sessions for chat-options execution via acquireOrLoadSession.
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.ts Loads hover session models via acquireOrLoadSession.
src/vs/workbench/contrib/chat/browser/actions/chatImportExport.ts Imports now load sessions via loadSessionFromData.
src/vs/workbench/contrib/chat/browser/actions/chatForkActions.ts Fork now uses loadSessionFromData for creating the new forked model.
src/vs/workbench/api/browser/mainThreadChatSessions.ts Updates main thread session handling to use new acquire/load methods.
src/vs/sessions/contrib/sessions/browser/sessionsManagementService.ts Uses acquireOrLoadSession when opening remote sessions / applying options.
src/vs/sessions/contrib/chat/browser/branchChatSessionAction.ts Loads branched session data via loadSessionFromData.

…pl.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mjbvz mjbvz merged commit 7a05c7f into microsoft:main Feb 20, 2026
17 of 18 checks passed
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.

2 participants