
Security News
Deno Goes the Way of the Dinosaur
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.
dsh-session-pruner
Advanced tools
DSH session lifecycle management plugin — full-type session lifecycle management: one-shot subagents archived on completion, continuable subagents and main sessions archived when idle, a capacity cap, and projection-cache cleanup. Prevents session-library accumulation stalls at the source.
Every session type has a defined destination: finished one-shot subagents are archived automatically, idle continuable subagents / main sessions are archived, and overflow is recycled by priority. Archive first (recoverable), delete after expiry — the GUI syncs within 30s, fully panel-configured with hot reload.
简体中文 · Apache-2.0 · npm
DSH (DeepSeek Harness) caches a full projection of every session in session_projcache.json (token stats, context pressure, ...), and the storage backend rewrites the whole file atomically on every write. When the session library accumulates thousands of subagent sessions:
GET / times outManaging session lifecycle (this plugin) is the root fix: no session accumulation → no cache rows → no stalls.
| Session type | Trigger | Action | Default |
|---|---|---|---|
| one-shot subagent | subagent/end / agent/disposed event (+ grace) | archive within seconds (event-driven) | event + 3min grace |
| continuable subagent | idle over N days | archive (recoverable) | off (0 days) |
| main session | idle over N days | archive (recoverable) | off (0 days) |
| any type | total exceeds capacity cap | recycle by one-shot → continuable → main + oldest | 400 |
| archive directory | kept over N hours | physically deleted | 24 hours |
Cleaned sessions are moved to ~/.dsh/sessions-archive/ first (workspace/session-id structure preserved) — they disappear from the GUI immediately (the list only reads the sessions directory), but the files remain and can be restored manually:
# Restore: mv back into the sessions directory
mv ~/.dsh/sessions-archive/<workspace>/<session-id> ~/.dsh/sessions/<workspace>/
A "delete directly" mode (no archive, irreversible) is also available.
session/end-seed are never cleaned (checked in both the one-shot path and the capacity cap)Dual-track triggers (events = hot path, disk = source of truth)
┌─ Event-driven (seconds): subagent/end + agent/disposed
│ ├─ 500ms batch window merges storms → oneShotMinAge grace re-check
│ └─ single-session check (memory-first, at most one zstd decompress) → archive
└─ Scheduled reconcile (fallback, default 60min)
├─ pruneArchive: physically delete expired archive sessions
├─ iterate ~/.dsh/sessions/*/ decompress log (system zstd, multi-frame)
│ ├─ origin: main | subagent (session header)
│ ├─ mode: one-shot | continuable (subagent/descriptor event)
│ └─ ended: contains session/end-seed
├─ one-shot + ended ──→ archive (archiveMode)
├─ continuable/main idle N days ──→ archive
├─ total > cap ──→ recycle by priority + oldest (skip running/live)
└─ each archive also: purge projcache row + workspace accounting
GUI sync — change-driven primary, full-refresh fallback:
/plugins/dsh-session-pruner/archived every 3s and only issues
refreshList() + refreshSubagents() when a change is reported — sidebar and
task panel stay consistent within seconds, zero RPC when nothing changed.uiRefreshSeconds seconds the client refreshes both
data sources anyway (main list via refreshList(), each known parent's
subagent catalog via refreshSubagents()), covering dirty-flag failures
(older host / route unavailable). No page reload needed.dsh plugin --profile web add dsh-session-pruner
dsh plugin --profile web add /path/to/dsh-session-pruner
Restart dsh web after install (launchctl kickstart -k gui/$(id -u)/com.deepseek.dsh-web).
After install, open Settings → Plugins → 会话生命周期管理 card. All 9 options save with hot reload (no restart):
| Field | Default | Description |
|---|---|---|
| Scan interval (min) | 60 | reconcile fallback (events are primary) |
| Capacity cap (sessions) | 400 | recycle by priority + oldest when exceeded |
| UI fallback refresh interval (s) | 30 | dirty-flag primary (3s change poll); full refresh fallback |
| Archive retention (hours) | 24 | physical delete after retention |
| Archive mode | archive | archive (recoverable) / delete directly (irreversible) |
| Continuable idle archive (days) | 0 | archive after N idle days, 0 = off |
| Main idle archive (days) | 0 | archive after N idle days, 0 = off |
| Clean main on overflow | off | main participates in capacity recycling |
| One-shot min survival (min) | 3 | newly finished subagents are not cleaned within N minutes (protects finishing/references) |
Env vars (fallback, panel wins): DSH_SESSION_PRUNER_INTERVAL_MS / _MAX / _CLEAN_MAIN / _ARCHIVE_HOURS / _ARCHIVE_MODE / _CONTINUABLE_IDLE_DAYS / _MAIN_IDLE_DAYS / _ONE_SHOT_MIN_AGE_MINUTES.
Output in guard server-*.out.log:
[dsh-session-pruner] armed: interval=60min cap=400 cleanMain=false
[dsh-session-pruner] hot-reloaded: interval=60min cap=400 ... contIdle=0d mainIdle=0d
[dsh-session-pruner] archived a1b2c3d4 (subagent/one-shot) one-shot done cache=true
[dsh-session-pruner] archive pruned: 2 expired
cache=true/false tells whether the projection cache row was purged along with the session.
node test/dry-run.js # read-only full-library scan, verify classification (no deletion)
node test/e2e.js # create a fake one-shot session, verify the real cleanup path
zlib decodes a single frame only, so the plugin shells out to the system zstd CLI (brew install zstd on macOS)storageDomain.get('session_projcache').table('sessions').delete(id) — the official write chain (atomic persistence + in-memory sync)installSettingsSection + hand-written client card (__ModuleLoader__ bundle), onChange re-schedules the timer instantlydocs/DEVELOPMENT-GUIDE.md — DSH plugin development practice guide (architecture, Host/Client, settings panel, deployment ops, 10 pitfalls with fixes), the foundation for future plugin work.
zstd CLIFAQs
会话生命周期管理:one-shot 完成归档/删除、可续与主会话闲置归档、容量保底、连带清理 projcache——全类型生命周期管理。
The npm package dsh-session-pruner receives a total of 66 weekly downloads. As such, dsh-session-pruner popularity was classified as not popular.
We found that dsh-session-pruner demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.

Security News
Anthropic’s free OSS Scanner uses Mythos and other Claude models to find open source vulnerabilities and send maintainers reports with proposed fixes.

Security News
On Front Lines’ Early Adopters: CISO podcast, Andrew Becherer shares lessons from Datadog, weighs the long-term costs of AI-built tools, and explains how founders can actually gain a CISO’s trust.