Skip to content

[FEATURE]: Add session migration dialog to recover orphaned or misplaced sessions #23249

Description

@sim590

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Add a TUI dialog that allows users to migrate sessions between projects. This serves three main use cases:

  1. Recovering orphaned sessions — When a project directory is renamed or moved (Sessions become orphaned when project directory is renamed #23248, Session lookup fails with NotFoundError when PTY spawned from non-git directory context #8538), sessions become invisible because their directory field points to a path that no longer exists. The migration dialog shows all sessions across all projects, marks orphaned ones with a visual indicator, and allows moving them to the correct project.

  2. Intentionally migrating sessions between projects — When work was started in the wrong project, users can move the session (with its full conversation history) to another project rather than starting over.

  3. Deleting orphaned sessions — Since orphaned sessions don't appear in the normal /sessions list, there is currently no way to delete them. The migration dialog provides access to these sessions for deletion.

Proposed solution:

  • A new "Migrate Session" dialog accessible via ctrl+o from the session list
  • The dialog shows all sessions across all projects, grouped by project
  • Orphaned sessions are marked with a ! indicator in the gutter
  • Selecting a session opens a destination picker (current project, home directory, or any known project)
  • ctrl+d allows deleting sessions (with double-press confirmation)
  • New server routes GET /session/orphans and POST /session/:sessionID/migrate

Note: this does not fix the root cause of orphaned sessions (#23248). An automatic fix in fromDirectory() would still be valuable.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions