Archive session on /clear instead of backgrounding#289317
Merged
Conversation
Co-authored-by: bpasero <900690+bpasero@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement clear command to archive current session
Archive session on /clear instead of backgrounding
Jan 21, 2026
bpasero
approved these changes
Jan 21, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR modifies the /clear slash command behavior to archive the current chat session before creating a new one, distinguishing it from passive session switching via the plus button.
Changes:
- The
/clearcommand now archives the current session by callingsetArchived(true)before executingACTION_ID_NEW_CHAT - Updated the command description from "Start a new chat" to "Start a new chat and archive the current one" to reflect the new behavior
- Injected
IAgentSessionsServicedependency to access session management functionality
Tyriar
approved these changes
Jan 21, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The
/clearcommand now archives the current session before creating a new one, distinguishing explicit clearing from passive session switching (plus button).Changes
Modified the
/clearslash command handler inchat.contribution.ts:IAgentSessionsServiceto access session statesessionResourceparameter and archive session viasetArchived(true)before executingACTION_ID_NEW_CHATOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.