MiniMax-AI / MiniMax-AI/minimax-code
[Feature]: Permanent session deletion in the /sessions archived view
Nobody has claimed this yet.
- 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 commit9f6effeon top of currentmain: 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 indocs/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:standalonepass;pnpm verifypasses all gates up totest: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-contract9/9,smoke16 pass/1 skip,byok11/11). Interactive smoke via real pty against a local fixture provider with an isolatedMINIMAX_DATA_DIRcovered 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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