dsh-delete-archived-session: List and Delete DSH Archived Sessions

Preface

In DeepSeek Harness (DSH), sessions can be “archived” or “unarchived.” Archiving merely hides a session from the active list; the logs corresponding to the chat history remain on disk, and there is no official path provided to reclaim this space. During long-term development or when running multiple profiles in parallel, archived sessions accumulate over time, occupying directories and making it difficult to distinguish which ones can be cleared.

The community plugin dsh-delete-archived-session (maintainer ocelot-D) addresses exactly this issue: it lists archived sessions within DSH and, following secondary confirmation and ownership verification, moves the specified sessions out of the session directory (into a recycle bin by default, allowing for recovery).

What is this

dsh-delete-archived-session is a standard DSH plugin package: it declares dsh.bundle.patch in package.json, and uses cordis.patch.yml to inject tool/command descriptions into the Harness. It does not replace DSH’s built-in archiving capabilities but rather handles session log directories under the premise that a session is “already archived and confirmed for deletion.”

In the SkillHub directory, it is categorized under “Memory”; the current GitHub repository has approximately 1 star. The license is MIT, and the package version in the repository’s package.json is 0.1.0, requiring DSH >=0.2.0-rc.1 <0.3.0-0 and Node >=20.

Core Features and Security Design

The plugin README treats session deletion as “destroying chat history,” so its behavior is conservative. The key points are as follows:

  1. Only delete archived ones: Unarchived sessions are out of scope.
  2. Explicit confirmation required: Silent bulk erasure is not supported.
  3. Ownership must be proven first: Performs per-log ownership verification based on logs to avoid accidentally deleting data belonging to others or in incorrect paths.
  4. No escaping the root directory: Path operations are restricted to the configured session root directory.
  5. Recoverable by default: By default, moves session-related logs to a recycle bin instead of directly wiping the disk.
  6. Cleans up archive records: The deletion process handles records related to the archived status.
  7. DSH does not crash: The implementation avoids crashing the Harness process (a design goal stated in the README).

In terms of implementation, the plugin does not import dependencies outside the Node standard library, only registers plain tool/command objects, and does not use schemastery’s Config, allowing it to mount even with varying dependency versions across different profiles.

Installation and Activation

Installation follows the repository README. There is no separate command like dsh plugin add github:... provided; do not attempt to construct one based on the plugin name.

Method 1 (Recommended): State in a conversation that you wish to install this plugin, and let the AI complete the installation via the DSH plugin manager.

Method 2: Add a local dependency and register the bundle in the profile’s package.json, for example:

{
  "dependencies": { "dsh-delete-archived-session": "file:./dsh-delete-archived-session" },
  "dsh": { "profile": { "bundles": ["dsh-delete-archived-session"] } }
}

A DSH restart is required for it to take effect after installation.

Configuration

Configuration is passed via environment variables (no schemastery config block):

Environment Variable Default Value Description
DSH_DELETE_ARCHIVED_SESSIONS_ROOT $DSH_HOME/sessions The session root directory to operate on
DSH_DELETE_ARCHIVED_SESSIONS_TRASH <root>/../.deleted-sessions The recycle bin to move files into upon deletion
DSH_DELETE_ARCHIVED_SESSIONS_PERMANENT Unset (allows permanent deletion) Set to 0, false, or no to prohibit permanent deletion and force the recoverable path

The resolution of $DSH_HOME is consistent with DSH: it prioritizes the environment variable DSH_HOME, otherwise using ~/.dsh.

Typical Usage

After installation and restart, ask the model in a Harness conversation to call the tools registered by the plugin: first list the archived sessions, then initiate deletion for selected items; the process will require confirmation and perform log ownership verification. Default deletion moves the content to the directory specified by DSH_DELETE_ARCHIVED_SESSIONS_TRASH. To completely wipe the data, the process must be handled with explicit permission for permanent deletion (if DSH_DELETE_ARCHIVED_SESSIONS_PERMANENT is set to prohibit permanent deletion, only the recycle bin path is available).

Specific tool names and parameters are subject to the descriptions exposed by the Harness after installation; the repository provides node test/self-test.js and node test/check-manifest.js for self-testing. You can run npm test in the local plugin directory (see scripts.test in package.json).

Use Cases and Notes

Suitable for: Developers who use DSH locally for long periods, have many old archived sessions, need to periodically inventory and reclaim session directory space, and prefer a default setting where “deleted items can be retrieved from the recycle bin.”

Notes:

  • The plugin reads and writes to the disk with the permissions of the current DSH process; you should read the source code and the MIT license before installation to ensure the paths and deletion semantics align with your backup strategy.
  • The community directory SkillHub Plugin Page and the GitHub repository are maintained by the community and have no official affiliation with DeepSeek / High-Flyer; the DSH ecosystem emphasizes “everything is a plugin,” and this plugin is a supplementary capability for session storage, not a built-in feature.

Conclusion

DSH’s built-in archiving does not reclaim session logs on disk; dsh-delete-archived-session supplements this chain by “listing and deleting archived sessions with strict confirmation and ownership verification, defaulting to recoverability.” For installation instructions and implementation details, refer to the directory page and the repository README.

  • Directory Page: https://www.skillhub.cn/plugins/ocelot-D/dsh-delete-archived-session
  • GitHub: https://github.com/ocelot-D/dsh-delete-archived-session
羽毛球分组比赛记分
小程序二维码

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

Xiaoye