Skip to content

Fix session resource aliasing in chat sessions#298374

Merged
TylerLeonhardt merged 1 commit intomainfrom
tyler/soft-limpet
Feb 27, 2026
Merged

Fix session resource aliasing in chat sessions#298374
TylerLeonhardt merged 1 commit intomainfrom
tyler/soft-limpet

Conversation

@TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Feb 27, 2026

Implement a mechanism to register aliases for session resources, allowing session-option lookups to redirect to the correct canonical resource. This change enhances the handling of chat sessions by ensuring that the correct resources are used in session management.

I think this is pretty fragile, but it fixes the critical issues that need to be fixed this release.

ref #298378

Copilot AI review requested due to automatic review settings February 27, 2026 23:08
@TylerLeonhardt TylerLeonhardt enabled auto-merge (squash) February 27, 2026 23:08
@TylerLeonhardt TylerLeonhardt self-assigned this Feb 27, 2026
@TylerLeonhardt
Copy link
Member Author

FYI @mjbvz

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 adds session-resource aliasing to the chat sessions infrastructure so that when an untitled session is later resolved to a “real” session resource, session-option lookups continue to work against the canonical resource stored in the internal session map.

Changes:

  • Extend IChatSessionsService with registerSessionResourceAlias(untitledResource, realResource) for redirecting option lookups.
  • Implement alias resolution in ChatSessionsService for session-option getters/setters and option-change notifications.
  • Update MainThreadChatAgents2 to register an alias when an untitled session is resolved via newChatSessionItemHandler and update the model’s contributed session resource.

Reviewed changes

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

File Description
src/vs/workbench/contrib/chat/test/common/mockChatSessionsService.ts Adds the new interface method as a no-op in the mock implementation.
src/vs/workbench/contrib/chat/common/chatSessionsService.ts Adds the alias-registration API to IChatSessionsService.
src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts Implements alias mapping and resolves option lookups + option-change events through the alias map.
src/vs/workbench/api/browser/mainThreadChatAgents2.ts Registers aliases when resolving untitled sessions to real resources, and updates the contributed session metadata.

@TylerLeonhardt TylerLeonhardt merged commit 536950d into main Feb 27, 2026
24 checks passed
@TylerLeonhardt TylerLeonhardt deleted the tyler/soft-limpet branch February 27, 2026 23:24
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.

3 participants