kagurazakayashi/dsh-delete-session: DeepSeek Harness Web Plugin for Session Deletion

Preface

In DeepSeek Harness (DSH) workflows, session management is a routine task. When a session is no longer needed, it typically requires cleanup via the file system or specific UI operations. For developers accustomed to using the Web interface, deleting a session directly from the list saves time.

The dsh-delete-session plugin was created to solve this pain point. It does not rely on modifying additional configuration files; instead, by registering with official slots, it integrates a “Delete session” option directly into the session row menu.

Overview

This is a DeepSeek Harness Web plugin maintained by kagurazakayashi. It aims to provide fast and thorough session deletion capabilities for the Web UI.

The plugin functions by:
* Registering a “Delete session” menu item to the session row menu slot.
* Registering a configuration card to the official plugins.bundle.config slot to manage deletion confirmation policies.
* Offering three confirmation modes to suit different security requirements.

Core Features

  1. Menu Integration
    The plugin registers the “Delete session” option in the session row’s ... menu. Under default configuration, this option appears below “Archive session”.

  2. Three Confirmation Modes
    Users can select the confirmation method for deletion via plugin settings:

    • click-again (Default): Clicking changes the item to a warning state; a second click is required to execute the deletion.
    • dialog: Pops up a confirmation dialog.
    • instant: No confirmation; clicking immediately deletes the session.
  3. Two-Step Deletion Flow (Default Mode)
    In the default click-again mode:

    • First click: The menu item turns red as a warning, prompting “Click again to delete”.
    • Second click: Calls the deletion API and refreshes the list.
    • Timeout/Failure: If the second click is not completed within 8 seconds, the state automatically resets.
  4. Running Session Protection
    The plugin checks the session status. If a session is running (Agent status is not idle), the deletion request is rejected with HTTP 409. This prevents corruption of log files currently being written.

  5. Configuration Persistence
    Plugin settings are saved via the official plugin manager, written into the config: field of the id: delete-session entry in cordis.patch.yml.

Installation and Activation

To install the plugin, run the following command:

dsh plugin --profile web add @kagurazakayashi/dsh-delete-session

Once installed, start the Web service:

dsh web

After restarting the service and refreshing the page, the “Delete session” option will be visible in the menu of any session row.

Typical Usage

By default, the plugin uses the two-step confirmation mode. The steps are as follows:

  1. In the session list, click the ... button on the corresponding session row.
  2. In the pop-up menu, click “Delete session”.
  3. The menu item changes to a red warning state; click the option again.
  4. The session is deleted, and the list refreshes.

To change the confirmation mode, use the plugin’s configuration card. This card is located on the Plugins page in the sidebar. Find the plugin in the installed list, enter the details page, and expand the configuration card to select the mode.

Notes

  • Running sessions cannot be deleted: If a session is processing a task, the plugin returns an HTTP 409 error and displays an error message. Only sessions with an idle status can be deleted.
  • Idle but open sessions can be deleted: Even if the user has switched sessions, as long as the session is not in a running state, it can usually still be deleted.
  • No core modification: This plugin does not modify the DSH core installation or patched core files; it is implemented entirely through official plugin mechanisms.

Conclusion

The dsh-delete-session plugin provides a more convenient session cleanup method for DSH Web users through standardized slot registration and configurable confirmation mechanisms. It is a practical tool for users who need to manage sessions frequently.

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

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

Xiaoye