Introduction¶
DeepSeek Harness’s built-in capability can only “archive” a session—hiding it from view, but the conversation log remains on disk. If you need to truly “delete” a session’s logs, workspace association, archive/pin status, and projection cache, an additional tool is required. dsh-session-delete-easy is built for exactly this scenario: it adds a “Delete Session” entry to the … menu on each session row, and upon confirmation, cleans up all the above in one go.
Plugin Overview¶
- Package name:
dsh-session-delete-easy - Maintainer: Yanis1024
- Type: Client plugin (Bundle patch + Client injection)
- License: MIT
It is not an official feature but a community-maintained plugin, published via npm, with a plugin market index provided to support installation from the “Discover” page.
Installation & Enablement¶
The plugin is published on npm. The entire installation process is completed within the DeepSeek Harness GUI—no command line required. After installation, you must quit and relaunch Harness for it to take effect.
Method A: Install by Package Name Directly (Recommended)¶
- Open DeepSeek Harness, go to Settings → Plugins
- Click Add Plugin
- In the “Package name or URL” field, enter:
dsh-session-delete-easy - For Install Source, select npm Official Registry (
registry.npmjs.org)
- If your corporate network has slow or no access to npmjs, switch to China Mainland Mirror (registry.npmmirror.com)
- ⚠️ Do not leave it on “Default Source”: it uses the local~/.npmrc(usually npmmirror). If the mirror hasn’t synced the latest version, you’ll get a “plugin not found” error, and it will not automatically fall back to the official registry - Click Install, then quit and relaunch DeepSeek Harness
- You’ll see the “Delete Session” entry in the
…menu on any session row
Method B: Install from the “Discover” Page (Requires Enabling the Plugin Market)¶
- Settings → Plugins → Experimental Plugins (More) → Enable the Plugin Market / Discover bundle (
@deepseek-ai/dsh-experimental-plugin-market-bundle) → Restart Harness - Open Plugins page → “Discover” tab
- Manage Index Sources → Add Index URL, choose one based on your network:
- If npmjs is reachable:https://cdn.jsdelivr.net/gh/Yanis1024/dsh-session-delete-easy@main/market/index.json
- If npmjs is unreachable (using domestic mirror):https://cdn.jsdelivr.net/gh/Yanis1024/dsh-session-delete-easy@main/market/index-npmmirror.json - Search for
deleteorsessionin “Discover”, find “Permanent Session Delete” → Install → Restart Harness
Team-Wide Index Source (Optional)¶
Prerequisite: the profile has already enabled the market bundle above. Add the following snippet to the profile’s cordis.patch.yml so that team members don’t need to manually add the index:
- id: plugin-market
config:
indexes:
- https://cdn.jsdelivr.net/gh/Yanis1024/dsh-session-delete-easy@main/market/index.json
indexes is a volatile field, so you don’t need to remount the plugin after changing it.
Command-Line Equivalent (for Authors or CI)¶
dsh plugin --profile web add dsh-session-delete-easy
Scope of Functionality¶
- Sidebar menu item: Adds a “Delete Session” row to the
…menu on each session row, using the built-in destructive-action warning color. Clicking it triggers a confirmation dialog; the deletion only proceeds after confirmation. - Agent tools:
session_delete: Deletes a single session.session_delete_list: Lists sessions and shows which ones can be immediately deleted and which still have pending-delete markers.- What gets deleted:
- Conversation logs (all events + header): located at
<session-root>/<workspace>/<session-id>/ - Workspace association: the
sessionIdsin the workspace record - Archive / Pin records: persisted state in the workspace registry
- Projection cache: the
session_projcachestorage domain - Empty workspace directories: cleaned up when the last session under that workspace is deleted; non-empty directories are preserved
- The full-text search index (
session-query-sqlite, default:memory:) will automatically reconcile on the next search—no extra handling needed.
Handling of Live Sessions¶
When Harness is running and still holds an open log handle for a session, only the agent that created the session is authorized to close it. The plugin cannot directly operate on an open handle. If the file is deleted while the handle is open, the next append will produce a corrupted log without a header.
Therefore, live sessions are handled in two steps:
- Immediately: Stop all in-progress work (turns, sub-agents, background jobs, scheduled reminders), archive and hide the session, and write a
.dsh-session-delete-pendingmarker file in the session’s log directory. - On next Harness startup: The startup scan detects the marker, confirms the session is no longer live, and then truly deletes the log directory, projection cache, and archive/pin records.
The marker filename is intentionally a fixed name independent of the package name, so if the plugin is renamed in the future, already-marked sessions won’t become orphaned (the scan is also backward-compatible with the former .dsh-session-erase-pending).
For sessions that have never been opened, a single call will delete everything cleanly.
Verified Scenarios¶
Tested in a real Harness instance using temporary sub-agent sessions (no real sessions were touched). Results:
| Scenario | Result |
|---|---|
| Unopened session | Log directory, projection cache, workspace association, and archive/pin all removed in one pass |
| Live session | Reports pending-restart; activity summary accurately lists running jobs and turns, and job processes are killed; session becomes archived and hidden |
| Deferred deletion | On next load, the marker is detected → confirmed non-live → log/cache/archive entries deleted, no residual markers |
| Safety boundaries | Non-empty workspace directories are not deleted; execution is refused when the directory name does not match the session ID |
Known Limitations¶
- Deletion is irreversible—there is no recycle bin. For a reversible option, use Harness’s built-in “Archive”.
- A live session’s logs are only truly removed on the next Harness startup, but it is immediately hidden from the list.
- After successful confirmation, the dialog closes and the feedback is simply the session row disappearing.
- The plugin’s UI depends on Harness’s session menu slot; a major Harness version change may alter the menu item’s position.
Configuration¶
The bundle patch exposes a single tunable option, configured in the profile’s cordis.patch.yml:
- id: session-delete-easy
name: 'dsh-session-delete-easy'
config:
sweepDelayMs: 4000 # How long after startup to run the deferred deletion scan
Ecosystem Context¶
DeepSeek Harness is designed around the philosophy of “everything is a plugin.” The community directory is an independent skills and plugins site with no official affiliation to DeepSeek or High-Flyer. This plugin is a community-maintained project; it is recommended to review the source code and license before use.
Summary¶
dsh-session-delete-easy fills the gap in Harness’s session-level “complete deletion” capability: it adds a delete entry to the menu, cleans up logs, workspace associations, archive/pin status, and projection cache. Live sessions are handled via a marker mechanism that triggers cleanup on the next startup, avoiding handle conflicts. If you need to manage session lifecycle within a team, this plugin serves as a useful complement to archiving.
- Directory page: https://www.skillhub.cn/plugins/Yanis1024/dsh-session-delete-easy
- GitHub: https://github.com/Yanis1024/dsh-session-delete-easy