Introduction¶
DeepSeek Harness (DSH) uses a plugin-based architecture that allows developers to extend functionality. Over time, persisted logs generated by sessions, workspace registry records, and search indexes consume disk space and increase search overhead. The dsh-session-delete plugin provides an interface under “Settings → Session Management” to directly manage these sessions and supports permanently deleting cold sessions.
Core Features¶
Deletion Semantics¶
The plugin performs the following actions when deleting a session:
* Delete persisted logs (~/.dsh/sessions/<项目>/<session-id>/).
* Remove session references from the workspace registry (workspaceRegistry.detachSession).
* Clean up search indexes (SQLite FTS), automatically synchronized on the next query.
* Use a two-step confirmation mechanism, with validation before and after deletion to ensure the persisted list no longer contains the session.
* Record a log for each deletion (info on success, warn on exception). If detaching from the workspace registry fails, the failure is returned to the UI as a warning and is not silently swallowed.
Listing and Batch Operations¶
- Sub-agent sessions: Sessions with
origin: "subagent"are hidden by default. Enable the “Show sub-agent sessions (N)” toggle to list them. - Sidebar conversation isolation: Side Chat threads in Better-Sidebar carry the
subagentmarker. This plugin identifies them by the title prefixSide:and never displays them. - Search: Search by title, session ID, type label (sub-agent/main session), workspace path, or Agent Preset (e.g.,
qq-chat). Entering子代理automatically unhides and displays all sub-agent sessions. - Grouping: Group by time (today/last 7 days/last 30 days/earlier) or by workspace (
cwdwhen the session was created). - Bulk selection and deletion: Supports selecting entire groups, selecting all, and selecting individual rows. The selection scope strictly follows entries visible on the screen. Bulk deletions are processed serially, one at a time, showing progress (e.g.,
删除中 12/357); a single failure does not abort the entire batch, and after completion the number of successes and failures is summarized. - Size used: Each row displays the size of the session log files.
Safety and Limitations¶
- Directory guard: Before recursively deleting a session directory, verify that the directory name equals the session ID. If a path structure change causes a mismatch, only log files are deleted and a warning is recorded, preventing accidental deletion of an entire workspace group.
- Active session restriction: Sessions opened during the current app launch (including the session currently being viewed) cannot be deleted, because active Agents may rewrite logs and make deletion incomplete. After restarting the application, these sessions become cold sessions and can be deleted normally.
- Status detection: If the Host list API is unavailable, the UI displays an error and disables all delete buttons.
- Request timeout: Front-end requests are configured with a 20-second timeout (
AbortController) to prevent the UI from freezing if the Host becomes unresponsive.
Compatibility¶
- DSH Desktop 2.0.10 / kernel 0.1.5-rc.2: Verified.
- DSH Desktop 2.0.9 / kernel 0.1.5-rc.1: Not verified. If the
list()method in this version returns a bare header rather than a snapshot, the list cannot retrieve the ID.
Installation and Enabling¶
Add the dependency and bundle to the package.json of the target profile (e.g., ~/.dsh/profiles/desktop/package.json):
{
"dependencies": {
"dsh-session-delete": "github:<你的用户名>/dsh-session-delete"
},
"dsh": {
"profile": {
"bundles": [
"@deepseek-ai/dsh-base",
"@deepseek-ai/dsh-web-app",
"…其他插件…",
"dsh-session-delete"
]
}
}
}
Run pnpm install in the profile directory, then restart the DSH application.
Typical Usage¶
Go to Settings (gear icon) → Session Management. Use search, grouping, or toggles to filter sessions, then select one or more and click Delete.
Summary¶
dsh-session-delete provides a safe and controllable entry point for session cleanup. It is suitable for DSH users who need to periodically organize session data, free up disk space, or maintain workspace registry records. Before installation, confirm compatibility with the host version.