Introduction

By default, DSH session management provides only an “archive” feature, which hides sessions but does not remove them from disk. Long-term use or shared environments can cause the $DSH_HOME/sessions/ log directory to grow significantly. The dsh-delete-session plugin fills this gap by adding real session deletion capabilities to the Web sidebar. It supports right-click deletion for individual sessions and batch deletion, and it synchronizes cleanup by removing the corresponding log directory entries and projection cache items.

Plugin Overview

This is a client-side plugin maintained by NIGHT576 under the MIT license. It addresses the limitation that the product itself does not provide a “true deletion” capability. It is suitable for scenarios that require freeing disk space, managing shared machine environments, or keeping demo environments clean.

Core Features

  1. Right-click menu deletion: Adds a “Delete conversation” option to the right-click menu of each row in the session list, allowing you to delete a single session.
  2. Batch deletion dialog: Displays a trash bin icon in the workspace title bar. Clicking it opens a batch deletion dialog that supports filtering by title and selecting all items.
  3. Archive-first mechanism: Before deletion, the session is added to the archive set first (the only persistent mechanism provided by the product for hiding sessions), ensuring the logical order is correct.
  4. Disk cleanup: Deletes the session log files under the $DSH_HOME/sessions/ directory and removes the related projection cache entries.
  5. Running-session protection: Rejects deletion of sessions whose agent status is running, preventing data corruption caused by files being in use.

Installation and Enablement

Use the following command to install the plugin into the Web configuration file. After installation, you must restart the DSH process to load the host-side components.

dsh plugin --profile web add github:NIGHT576/dsh-delete-session

Common Usage

  1. Delete a single session: Right-click a row in the session list, select “Delete conversation,” and confirm.
  2. Delete multiple sessions: Click the trash bin icon in the workspace title bar, select the sessions you want to delete in the dialog, and confirm.

Notes

  • Irreversible operation: Once deleted, the log directory will be permanently removed and cannot be recovered.
  • Running-session guard: Sessions that are running (agent status is running) cannot be deleted.
  • Data isolation: Deletion only applies to the current session and does not affect attachments, other sessions, or workspace records.
  • Process restart: After installation, the process must be restarted to load the host-side components.

Conclusion

This plugin helps developers resolve disk-space usage issues in DSH environments by thoroughly cleaning up logs and caches. For more details or to contribute code, visit the plugin directory or GitHub.