[Cherry-pick] Remove last-used session type and agent logic (#323484)#324826
Conversation
There was a problem hiding this comment.
Pull request overview
This PR is a cherry-pick of #323484 that re-removes the "last-used editor session type / agent" logic which was accidentally reintroduced during a merge-conflict resolution in #323914. It strips the storage key and helper functions that remembered the last non-local agent, along with the code paths that consumed them across the chat editor input, chat input part, and chat widget service.
Changes:
- Remove
ChatLastUsedEditorSessionTypeStorageKey,getNewChatEditorSessionType, andgetNewChatEditorSessionResourcefromconstants.ts. - Drop the
IStorageService-backed last-used resolution inChatEditorInput.resolve()(falling back togetDefaultNewChatSessionResource) and remove the remembered-model seeding inChatInputPart. - Remove
recordLastUsedSessionTypeand its call sites (plus theIStorageServicedependency) fromChatWidgetService.
Show a summary per file
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/common/constants.ts |
Removes the last-used storage key and the two editor-session-type resolution helpers. |
src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditorInput.ts |
Reverts resolve() to default-resource logic and removes the IStorageService dependency; leaves explicitSessionType plumbing and tests inconsistent/broken. |
src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts |
Removes _getRememberedSessionTypeModel and the empty-input model seeding it drove. |
src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.ts |
Removes recordLastUsedSessionType, its callers, and the now-unused storage imports/dependency. |
The removals in constants.ts, chatInputPart.ts, and chatWidgetService.ts are clean (no orphaned references). However, in chatEditorInput.ts the revert removed the explicitSessionType branch and the IStorageService constructor parameter while chatEditorInput.test.ts still constructs the input with an extra IStorageService argument and asserts the removed resolveExplicitLocal behavior — this breaks compilation and the tests, and leaves the explicitSessionType feature only half-present.
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Medium
Related: #324669
This is a cherry-pick of PR #323484 merge commit.
Context
#323914 started from a base that existed before #323484. Merge conflict resolution accidentally ended with the version prior to #323484 being accepted.