MiniMax-AI / MiniMax-AI/minimax-code

[Feature]: Permanent session deletion in the /sessions archived view

Open
#237 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement needs-triage
Dominant language
TypeScript
Stars
1.3k
Forks
141
Avg merge
2h 45m
Merged PRs (30d)
46

Description

Product or interface

CLI - interactive TUI

Use case and problem

I keep the /sessions picker tidy by archiving finished conversations, but archived sessions can never actually be removed: the Archived list only ever grows, and there is no way to delete individual sessions' local data from the product. Today my only options are leaving them archived forever, or manually deleting the whole data directory (which loses everything, including active work).

The surprising part: the full deletion chain already exists end-to-end (TuiSessionPort.deleteSession → local-runtime-v2 SessionLifecycleApplication.deleteSession → SQLite cleanup), and it is already used by ACP cleanup, cron lifecycle, and side-session rollback — only the user-facing surface in /sessions is missing.

Desired behavior

A trash-bin model: permanent delete lives only in the Archived view; archive/restore stays the sole removal path from the Active view.

Interaction example:

/sessions                        open the Session manager
Ctrl+D  → Enter                  archive the selected session (existing)
Tab                              switch to the Archived view
Ctrl+X                           Delete session? "<title>"
                                 Session and messages will be permanently deleted.
                                 This cannot be undone. Branches are kept.
                                 Enter delete · Esc cancel
Enter                            → "Session deleted." (row gone)
Ctrl+E                           Delete all archived sessions?
                                 Permanently delete 23 archived sessions in this workspace?
                                 … Enter delete · Esc cancel
Enter                            → "Deleting 3/23…" … "Deleted 23 sessions."

Acceptance criteria:

  • Ctrl+X permanently deletes the selected archived session after a single inline confirmation (Enter/Esc); the confirm copy states it is irreversible and that branch children are kept (the runtime re-parents them, no cascade).
  • Ctrl+E permanently deletes every archived session in the current scope (workspace / all), with an authoritative count that includes pages the visible window has not loaded; hidden/internal sessions are not touched; sessions owned by scheduled tasks are skipped and the summary reads Deleted N. Skipped M..
  • Ctrl+X does nothing in the Active view (archive remains the only path there — the archive flow runs plugin session-end hooks, the delete flow does not; the active session can never appear in the Archived view).
  • Zero archived sessions → No archived sessions. without a confirm panel; Esc always cancels; in-flight pagination cannot resurrect deleted rows.

Why this shape: deleting only already-archived sessions means every deletion is a deliberate two-step act (archive first, delete later), the archive flow's plugin session-end hooks have already run before any data is removed, and the live session can never be targeted from this surface. A single confirmation is enough because the trigger key is already a deliberate act — the panel's job is to show exactly what will be deleted, not to ask twice.

Platform

Multiple platforms

Alternatives and additional context

What I tried / considered:

  • Archiving — not deletion; data accumulates indefinitely.
  • Removing the data directory manually — all-or-nothing, loses active work, and the docs' uninstall path is outside the product.
  • No existing CLI flag or slash command covers per-session deletion.

I went ahead and implemented this on my fork (happy to hand it over — per the collaborators-only PR policy I'm not opening a PR; feel free to review and port it as a maintainer PR, partial adoption welcome):

  • Branch feat/session-delete, single commit 9f6effe on top of current main: https://github.com/kele98/minimax-code/commit/9f6effe
  • TUI-only: 8 files (packages/tui + a correction to the now-outdated "Ctrl+X is unused" note in docs/installation.md); no runtime, persistence, or protocol changes. Keys are raw-byte-safe for legacy terminals (Ctrl+Shift combos deliberately avoided).
  • Validation: 139/139 across the three affected registered suites; typecheck / build / check:standalone pass; pnpm verify passes all gates up to test:capabilities, which fails only in 23 pre-existing Windows-environment baseline cases (zh-CN locale assertions, symlink EPERM) — reproduced identically on a clean tree with the patch stashed; remaining gates pass individually (status-contract 9/9, smoke 16 pass/1 skip, byok 11/11). Interactive smoke via real pty against a local fixture provider with an isolated MINIMAX_DATA_DIR covered the full flow above. Not claimed: macOS/Linux manual acceptance, live-model runs, Desktop app.

Key bindings, copy, and bulk semantics are all open to adjustment if maintainers prefer a different shape.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/tui and trace the existing /sessions archived-view flow and TuiSessionPort.deleteSession; review the referenced commit 9f6effe and the Ctrl+X note in docs/installation.md. Done means archived-only single and bulk deletion, authoritative counts, skipped scheduled-task sessions, cancellation, and pagination that cannot restore deleted rows, with the affected registered suites passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.