Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dsh-delete-session

License: MIT DeepSeek Harness

Delete sessions and manage archived sessions in the DeepSeek Harness (DSH) Web UI.

中文说明见 README.zh.md

Adds Delete session to every session row's menu (below Rename / Fork / Archive), plus a View archived sessions toolbar button that opens a DSH-native window for restoring or permanently deleting archived sessions.

Screenshots

⋯ menu with Delete session

Delete confirmation

⋯ menu with Archive session

Archived sessions window

Quick start

dsh plugin --profile web add github:Da-Mie/dsh-delete-session

Restart DSH and refresh the Web UI. Every non-blank session's menu now has Delete session, and the sidebar toolbar shows View archived sessions between View options and Add workspace.

Features

Delete a session (⋯ menu)

  • Delete session item below Archive session in every non-blank session row's ⋯ menu, using the official trash icon.
  • Shows a confirmation dialog before deleting.
  • On confirm:
    1. cancels and waits for a running agent (if any);
    2. archives the session first so it disappears from the sidebar immediately;
    3. removes the session's persisted JSONL directory (permanent).
  • Best-effort refreshes the session/workspace lists so cold sessions also leave search/list right away.

Archived sessions manager (toolbar)

  • View archived sessions button between View options and Add workspace, using the official archive icon.
  • Opens a DSH-native modal (the official Modal primitive) listing every archived session: title, workspace, working directory, and last-update time.
  • Restore — returns the session to the workspace it was archived from; all timestamps and the session's files are kept, because archiving never touches workspace accounting or the session log.
  • Delete permanently — two-step confirmation, then removes the session's persisted log and drops it from the archive set.

Requirements

  • DeepSeek Harness ≥ 0.1.0-rc.5 (Web UI profile; check with dsh --version)

Installation

The package ships prebuilt (lib/ is committed), so no build step is needed.

Install with DSH (AI)

Just hand this repository URL to your DSH agent:

https://github.com/Da-Mie/dsh-delete-session

DSH reads the repository's AGENTS.md and installs the plugin automatically.

From GitHub

dsh plugin --profile web add github:Da-Mie/dsh-delete-session

Or manually: link this directory into $DSH_HOME/profiles/node_modules/dsh-delete-session, register it in profiles/web/package.json under dependencies and dsh.profile.bundles, then restart DSH.

After installing, restart DSH (plugin-set changes take effect on restart), then refresh the Web UI.

How it works

  • Host side — registers /dsh-delete-session <sessionId>, /dsh-archived-restore <sessionId> and /dsh-archived-delete <sessionId>. Delete cancels/waits for the agent, flushes the session, calls workspaceRegistry.archiveSession to hide it, then locates and removes the session directory via sessionPersistence.locate. Restore drops the id from the registry-global archive set — archiving never touches workspace accounting, so unarchiving restores the session's position, timestamps, and files.
  • Client side — uses a MutationObserver to inject the Delete session menu item (cloned from the native Archive item) and the View archived sessions toolbar button (anchored to the stable View-options button, self-healing against React re-renders, with a CSS fix for the fixed-width header-actions row). The management window renders with the official Modal primitive through the shell.overlay slot.

Notes

  • DSH's official session storage has no delete API; this plugin performs the documented out-of-band maintenance of removing the JSONL log directory. For live in-memory sessions it also best-effort detaches them from the session and agent registries so the log is not recreated by a later shutdown flush. If the internal detach fails, the session is still archived/hidden and residual logs may need manual cleanup.
  • Deletion is permanent and cannot be undone.
  • If no session context is available to run the host command (e.g. no opened session at all), the dialog reports that the command cannot run.
  • If the log file is locked by a live session and removal fails, the session is still archived/hidden first and the command returns an error; the residual log may need manual cleanup.

License

MIT

About

DSH Web UI plugin: delete sessions from the menu and manage archived sessions (restore / permanent delete)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages