Skip to content

feat(shell): add /delete command for session removal (#1783)#1839

Draft
bloodycoder wants to merge 1 commit intoMoonshotAI:mainfrom
bloodycoder:autopilot/issue-1783-delete-session
Draft

feat(shell): add /delete command for session removal (#1783)#1839
bloodycoder wants to merge 1 commit intoMoonshotAI:mainfrom
bloodycoder:autopilot/issue-1783-delete-session

Conversation

@bloodycoder
Copy link
Copy Markdown

Summary

Implements #1783 by adding /delete command (with /remove alias) for session removal in shell slash commands.

Scope / behavior

  • New command: /delete [session_id]
  • Alias: /remove
  • Safety constraints:
    • cannot delete current session
    • invalid session id is rejected early
    • v1 deletion is limited to current work_dir
  • Confirmation hook is injectable for tests.
  • Stable user-facing messages for success/failure paths.

Implementation details

  • Added guarded delete flow in shell slash command registry.
  • Added helper functions for:
    • session id validation
    • delete confirmation
    • metadata cleanup handling
  • Added docs updates (EN/ZH) for slash command reference + data location notes.

Files changed

  • src/kimi_cli/ui/shell/slash.py
  • tests/ui_and_conv/test_shell_slash_commands.py
  • docs/en/reference/slash-commands.md
  • docs/zh/reference/slash-commands.md
  • docs/en/configuration/data-locations.md
  • docs/zh/configuration/data-locations.md

Test plan

Added/updated tests around:

  • command registration and alias parity
  • by-id delete path
  • picker-based delete path
  • failure paths (invalid id / not found / cross-work-dir / current session)

Current status

Draft PR due to local environment mismatch:

  • local Python: 3.9
  • repo requires: >=3.12 (.python-version is 3.14)
  • missing tools: uv, tmux

I will rerun and attach full passing logs once environment is aligned.

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.

1 participant