DSH officially supports session archiving, but it does not provide a way to view the archived session list, close in-memory sessions, unarchive sessions, or delete archived sessions. This plugin fills this operational gap.
Features¶
- Browse Archived Sessions: Lists sessions in the archive collection, showing the title, session ID, workspace path, creation time, run status, and log path.
- Close Sessions Without Restart: Uses
archived_session_closeto detach and persist idle in-memory sessions without restarting DSH. - Unarchive: Removes a session from the archive collection so it appears again in the sidebar.
- Delete Archive: Physically deletes the session log directory after explicit confirmation.
- Settings UI: Provides a dedicated “Archived Sessions” management page in DSH Web Settings.
- HTTP API: Provides simple JSON endpoints for automated operations.
Installation¶
Prerequisites¶
- DSH is installed, and the
dshcommand is available from the command line. - If building from source, Node.js and npm are required.
Installation Steps¶
- Download or build the plugin package (using the release version is recommended).
- Run the installation command:
dsh plugin --profile web add dsh-external-dsh-archive-session-0.0.9.tgz
- After installation is complete, restart the DSH service.
Usage¶
Agent Tools¶
| Tool | Description |
|---|---|
archived_sessions_list |
Lists archived sessions that still point to real sessions. |
archived_session_close |
Closes idle in-memory archived sessions (flush and detach) without restarting DSH. |
archived_session_unarchive |
Removes a session from the archive collection so it can be accessed through the regular UI. |
archived_session_delete |
Completely deletes an archived session. Requires the parameter confirm: true. |
HTTP API¶
The plugin is hosted under the /dsh-archive-session/api path.
| Method | Path | Body | Description |
|---|---|---|---|
| GET | /archived |
- | Lists archived sessions. |
| POST | /close |
{ "sessionId": "..." } |
Closes idle in-memory sessions. |
| POST | /unarchive |
{ "sessionId": "..." } |
Unarchives a session. |
| POST | /delete |
{ "sessionId": "...", "confirm": true } |
Deletes an archived session. |
Notes¶
- Close Before Deleting: DSH keeps session objects in memory after a conversation ends. To delete a session in a “running/idle” state, first use
archived_session_closeto persist it, or restart DSH. - Unarchive for Management: Archived sessions are hidden from the sidebar by default. To open, close, or restore a session through the regular UI, use
archived_session_unarchive. - Ignore Expired IDs: If an archived ID no longer points to a real session log, that ID is ignored.
- Backend Limitation: Deletion only supports the JSONL persistence backend (usually located under
~/.dsh/sessions). The SQLite backend is rejected because DSH does not provide a public deletion API.