Skip to content

Reduce size of IChatSessionContext#300266

Merged
mjbvz merged 1 commit intomicrosoft:mainfrom
mjbvz:dev/mjbvz/characteristic-salamander
Mar 9, 2026
Merged

Reduce size of IChatSessionContext#300266
mjbvz merged 1 commit intomicrosoft:mainfrom
mjbvz:dev/mjbvz/characteristic-salamander

Conversation

@mjbvz
Copy link
Copy Markdown
Collaborator

@mjbvz mjbvz commented Mar 9, 2026

All of this info is already on the chatSessionResource. I want to have a single source of truth that can't get out of sync

All of this info is already on the chatSessionResource
Copilot AI review requested due to automatic review settings March 9, 2026 21:25
@mjbvz mjbvz enabled auto-merge March 9, 2026 21:25
@vs-code-engineering vs-code-engineering bot added this to the 1.112.0 milestone Mar 9, 2026
Copy link
Copy Markdown
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 reduces IChatSessionContext to only carry the session resource (and initial options), deriving chatSessionType and “untitled-ness” from the chatSessionResource so there’s a single source of truth.

Changes:

  • Shrinks IChatSessionContext by removing chatSessionType and isUntitled.
  • Adds isUntitledChatSession(URI) and replaces ad-hoc untitled checks with the helper.
  • Updates call sites to derive session type via getChatSessionType(resource) (and untitled status via isUntitledChatSession(resource)).

Reviewed changes

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

Show a summary per file
File Description
src/vs/workbench/contrib/chat/common/model/chatUri.ts Adds isUntitledChatSession helper to centralize untitled detection.
src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts Stops populating removed IChatSessionContext fields when setting contributed session context.
src/vs/workbench/contrib/chat/common/chatService/chatService.ts Removes chatSessionType and isUntitled from IChatSessionContext.
src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.ts Derives session type from sessionResource via getChatSessionType.
src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts Replaces ctx.chatSessionType usage with getChatSessionType(ctx.chatSessionResource) throughout.
src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts Uses isUntitledChatSession when deciding whether to synthesize a new untitled session with options.
src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.ts Replaces 'local' literal with localChatSessionType for the debug display label logic.
src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.ts Replaces 'local' literal with localChatSessionType in context key expressions for menus.
src/vs/workbench/api/browser/mainThreadChatAgents2.ts Computes isUntitled/chatSessionType from chatSessionResource instead of reading them from IChatSessionContext.
src/vs/sessions/contrib/sessions/browser/sessionsManagementService.ts Uses isUntitledChatSession to set activeSessionItem.isUntitled.

@mjbvz mjbvz merged commit c3c1766 into microsoft:main Mar 9, 2026
21 of 22 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.

3 participants