Skip to content

fix(shell): skip session picker when no other sessions exist#1811

Open
kevinWangSheng wants to merge 1 commit intoMoonshotAI:mainfrom
kevinWangSheng:fix/sessions-single-session-skip
Open

fix(shell): skip session picker when no other sessions exist#1811
kevinWangSheng wants to merge 1 commit intoMoonshotAI:mainfrom
kevinWangSheng:fix/sessions-single-session-skip

Conversation

@kevinWangSheng
Copy link
Copy Markdown

@kevinWangSheng kevinWangSheng commented Apr 9, 2026

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 returns None without launching the full-screen picker.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked the related issue, if any.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have run make gen-changelog to update the changelog.
  • I have run make gen-docs to update the user documentation.

Open with Devin

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
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +76 to +77
other_sessions = [s for s in self._sessions if s.id != self._current_session.id]
if not other_sessions:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

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.

fix(shell): /sessions shows pointless picker when only current session exists

1 participant