dsh-session-delete: Double Confirmation for Deleting a Session in the DSH Session List

Introduction

DeepSeek Harness (DSH) stores conversations by project in the local session directory, while the workspace ledger records states such as archiving and pinning. Trial branches, duplicate drafts, or mistakenly created sessions accumulate in the list. Manually deleting directories, reconciling ledgers, and clearing caches is both slow and prone to error. The built-in capabilities of the DSH desktop client focus on continuing conversations and archiving, but do not provide a one-click option to “permanently delete” a session in the list.

Below is an introduction to the community plugin dsh-session-delete (maintainer: ze579, category: Client). It adds a right-click menu to session list rows. After two confirmations, it deletes the corresponding session file, ledger entry, and session project cache, without touching attachments or other session data.

What is it

dsh-session-delete is a DSH client-side Web plugin: right-click any row in the session list, select “Delete Session” at the bottom of the menu, and confirm twice to complete the deletion. The plugin’s current version is 0.1.8 (see package.json in the repo), licensed under MIT.

The declared compatibility range is DeepSeek Harness >=0.2.2-rc.3 <0.3.0, and it has been verified on desktop version 0.2.2-rc.3. Lower versions have not been verified; dependencies such as webServer.register, workspaceRegistry.archiveSession / detachSession, contextMenus, and shell.overlay may not be available or behave differently on older versions of DSH.

Core Features

Interaction and Feedback

  1. Right-click the target session and select “Delete Session”;
  2. Click “Continue” in the first popup;
  3. Click “Permanently Delete” in the second popup;
  4. After successful deletion, the row disappears from the list, and a notification appears in the bottom-right corner: “Session deleted: Title”.

Actual Deletion Scope

The plugin cleans up the following items (paths are rooted at the environment variable DSH_HOME):

  • Session directory: $DSH_HOME/sessions/<project>/<session id>/
  • Ledger entries related to the session in the workspace ledger (including collections like archives and pins)
  • Session project cache: $DSH_HOME/storages/session_projcache/sessions/<session id>.json

It will not delete attachments, workspace directories, or other session data.

Running Sessions and Fallbacks

  • If a session is still running (determined by DSH’s workspace/session-activity; if the check fails, it is treated as running), the plugin will refuse to delete it.
  • Sessions still in memory will be archived and then deleted, causing them to disappear from the default list as soon as possible. The archive mark is removed after a startup cleanup confirms the session file no longer exists.
  • If the session file on disk is missing but the ledger entry still exists, running the delete command again will clean up the ledger and cache.

Limitations (README Description)

  • DSH does not expose a public session destruction API, so the in-memory copy is released by DSH itself. Fallback behaviors such as “Archived” may appear in the list.
  • It only supports local owners; relevant routes only listen on the loopback address and require same-origin requests.

For more detailed implementation details, see docs/DETAIL.md in the repository.

Installation and Enablement

Plugins in the DSH ecosystem are installed via the “Discover” index or a local package directory. The documentation does not provide CLI strings like dsh plugin add github:...; the path below refers to the original README.

Method 1: Marketplace / Index

  1. Open DSH and go to “Plugins -> Discover”;
  2. Add a plugin index source (e.g., from the community directory skillhub plugin page, use your actual configured index);
  3. Find dsh-session-delete in the list and install with one click.

Method 2: Local Directory

  1. Open DSH Plugin Page -> “Add Plugin”;
  2. Select the plugin’s package directory (must include package.json, index.js, client.js, cordis.patch.yml, etc.).

In package.json, dsh.client is configured with platform: web and immediately: true, injecting client modules such as context menus, layouts, and localization. Once installed and enabled, client-side capabilities load with DSH. Runtime requires Node >=18 (for build/dev environments, refer to the repo engines).

It is recommended to browse the GitHub repository source code and the MIT license before installing: the plugin accesses local session paths and the ledger using the current DSH process permissions and should only be used on packages from trusted sources.

Typical Usage

When cleaning up mistakenly created or no longer needed sessions daily:

  1. Right-click the target row in the DSH session list;
  2. Click the red “Delete Session”;
  3. Complete the two confirmations as prompted;
  4. Confirm the row disappears from the list and check the deletion notification in the bottom-right corner.

If the prompt indicates deletion is not possible, first confirm if the session is still running; try again after ending or switching the active session. If the file was deleted externally but the list entry remains, run the delete command again to sync the ledger and cache.

Applicable Scenarios and Notes

Who is this for

  • DSH desktop users who frequently create multiple trial sessions under the same project and need to regularly reclaim disk space and reduce list clutter;
  • Operations personnel or individual developers who want the deletion action to cover “directory + ledger + session_projcache” without manually assembling paths.

Please confirm before using

  • DSH version falls within >=0.2.2-rc.3 <0.3.0, consistent with your desktop build;
  • Accept the two-confirm design to avoid accidentally deleting ongoing conversations (running sessions are blocked);
  • Understand that the deletion scope does not include attachments or the workspace root directory; after deleting sessions with attachments, the attachments may still remain in their original location.

Community plugin directories (such as skillhub.cn) are independent of DeepSeek/Hypersphere and are not official app stores. Indexes and package versions depend on the source you added and the local installation result.

Conclusion

dsh-session-delete turns “deleting a conversation segment” into a right-click menu in the session list: two confirmations, deletion of files, ledger, and cache, interception of running sessions, and fallback archiving. The semantics are clearly explained in the README. If you are organizing sessions on the DSH desktop of the 0.2.2-rc.3 generation, you can obtain the package from the directory page or GitHub and install it as described above.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye