fix: accept the short provider alias in session clear#515
Draft
cdayAI wants to merge 1 commit into
Draft
Conversation
`session import chatgpt` stores the session under the canonical name 'chatgpt-session', but `session clear` passed its argument through verbatim -- so `session clear chatgpt` reported "No session stored" immediately after a successful import, and the user had to discover the '-session' suffix from `session list`. clear now canonicalizes the same short aliases that import accepts; unknown names still pass through.
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.
Problem
maverick session importtakes a short provider name (e.g.chatgpt) but stores the blob under the canonical namechatgpt-session.maverick session clearpassed its argument through verbatim tocookie_store.clear_session, so the natural follow-up failed:The user had to run
session list, notice the-sessionsuffix, and retypesession clear chatgpt-session.importandclearaccepted different vocabularies for the same thing.Fix
session clearnow canonicalizes through the same_SESSION_IMPORT_PROFILESalias map thatimportuses, soclear chatgptresolves tochatgpt-session. The canonical name still works, and unknown free-form names still pass through unchanged (the cookie store is generic — users may have stored sessions under arbitrary names).Tests
tests/test_session_clear_alias.py:clear chatgptsucceeds right afterimport chatgpt(the regression)clear chatgpt-session(canonical) still worksFull suite green (2909 passed), ruff clean.
https://claude.ai/code/session_01KUbbAGDTacAKWJdYHnCzfa
Generated by Claude Code