Preserve session target when using Send to New Chat#295185
Draft
Preserve session target when using Send to New Chat#295185
Conversation
When clicking the "Send to New Chat" tip or using the Ctrl+Shift+Enter shortcut, the Session Target (e.g., Claude, Background, Cloud) was resetting to Local because widget.clear() always creates a new local session. Now the SendToNewChatAction checks the current session type and, for non-local sessions in the sidebar, calls view.loadSession() with a new resource of the same type instead of widget.clear(). This follows the same pattern already used by the New Chat action (chatNewActions.ts). Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix session target reset when creating new session
Preserve session target when using Send to New Chat
Feb 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Clicking the "Send to New Chat" tip (or Ctrl+Shift+Enter) while in a non-local session (Claude, Cloud, Background) resets the Session Target back to Local. This happens because
SendToNewChatActionunconditionally callswidget.clear(), which always creates a new local session.The fix mirrors the existing pattern in
runNewChatAction(chatNewActions.ts): check the current session type from the resource URI scheme, and for non-local sidebar sessions, useview.loadSession()with a new resource of the same type instead ofwidget.clear().Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.