Make chat session "new chat" actions available on all provider views and scope to correct provider #264798
+55
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, the "new chat" actions (Open New Chat in New Window, Open New Chat Editor to the Side, New Chat Editor button, and Ctrl+N) were only available when viewing local chat sessions. Users couldn't access these quick actions when viewing Claude sessions, coding agent sessions, or other external provider sessions.
Additionally, when these actions were triggered from external provider views, they always created new chat sessions with the default copilot provider instead of the provider associated with the current view.
This change:
Makes actions available on all provider views by updating the
when
conditions from exact view matching to regex pattern matching that matches any view starting withworkbench.view.chat.sessions.
Ensures new chats are scoped to the correct provider by extracting the provider type from the current view context and passing it as
chatSessionType
when creating new editorsHow it works
The actions now:
^workbench\.view\.chat\.sessions\.
to match all provider viewscontextKeyService.getContextKeyValue('view')
chatSessionType
in editor optionslockToCodingAgent()
mechanismResult
Users can now access "new chat" actions from any provider view (local, Claude, coding agent, etc.) and the new chat sessions will interact with the same provider as the view they were triggered from, providing a seamless experience across different AI assistants.
Fixes #264787.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.