fix(shell): skip session picker when no other sessions exist#1811
fix(shell): skip session picker when no other sessions exist#1811kevinWangSheng wants to merge 1 commit intoMoonshotAI:mainfrom
Conversation
When /sessions is invoked and only the current session exists, the picker now returns early with an informative message instead of showing a single-item list that only says "You are already in this session" when selected. Closes MoonshotAI#1794
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8becbd15da
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| other_sessions = [s for s in self._sessions if s.id != self._current_session.id] | ||
| if not other_sessions: |
There was a problem hiding this comment.
Keep picker open when cross-directory sessions exist
This early return checks other_sessions from the initial _load_sessions() call, which is always in current scope, so /sessions now exits before rendering whenever the current directory has no alternatives. In that case users can no longer press Ctrl+A to switch to all scope and resume sessions that exist in other work directories, which regresses the directory-scope toggle behavior in SessionPickerApp.run().
Useful? React with 👍 / 👎.
Related Issue
Resolve #1794
Description
When
/sessions(or/resume) is invoked and only the current session exists, the picker previously showed a single-item list with just the current session marked "(current)". Selecting it only displayed "You are already in this session." — confusing UX for no benefit.This change adds an early return in
SessionPickerApp.run()that checks whether any non-current sessions exist after loading. If not, it prints an informative message and returnsNonewithout launching the full-screen picker.Checklist
make gen-changelogto update the changelog.make gen-docsto update the user documentation.