Skip to content

fix: accept the short provider alias in session clear#515

Draft
cdayAI wants to merge 1 commit into
mainfrom
claude/session-clear-alias
Draft

fix: accept the short provider alias in session clear#515
cdayAI wants to merge 1 commit into
mainfrom
claude/session-clear-alias

Conversation

@cdayAI
Copy link
Copy Markdown
Owner

@cdayAI cdayAI commented Jun 1, 2026

Problem

maverick session import takes a short provider name (e.g. chatgpt) but stores the blob under the canonical name chatgpt-session. maverick session clear passed its argument through verbatim to cookie_store.clear_session, so the natural follow-up failed:

$ maverick session import chatgpt --token ...
Saved session to .../chatgpt-session.json (chmod 600)
$ maverick session clear chatgpt
No session stored for chatgpt        # exit 1 — but it IS stored

The user had to run session list, notice the -session suffix, and retype session clear chatgpt-session. import and clear accepted different vocabularies for the same thing.

Fix

session clear now canonicalizes through the same _SESSION_IMPORT_PROFILES alias map that import uses, so clear chatgpt resolves to chatgpt-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 chatgpt succeeds right after import chatgpt (the regression)
  • clear chatgpt-session (canonical) still works
  • an unknown name still reports missing + exit 1

Full suite green (2909 passed), ruff clean.

https://claude.ai/code/session_01KUbbAGDTacAKWJdYHnCzfa


Generated by Claude Code

`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.
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.

2 participants