dsh-idle-compactor
Run the following command in DeepSeek Harness:
dsh plugin install QuanhuZeYu/dsh-idle-compactor
Paste the following prompt into your AI chat to install this plugin:
Run dsh plugin install QuanhuZeYu/dsh-idle-compactor in your DeepSeek Harness terminal to install the plugin; the full source is at https://github.com/QuanhuZeYu/dsh-idle-compactor. Restart the profile after installation to activate the patch layer.
About this plugin
The built-in auto-compaction in DeepSeek Harness recognises exactly two triggers: request pressure and a provider-confirmed context overflow. It never asks how long a session has sat quiet. So you let an agent grind through a long task, the session balloons past a hundred thousand tokens, you step away, and when you come back every single request is still paying for that stale tail while the built-in system remains completely oblivious to the idle bloat.
dsh-idle-compactor fills that missing axis. On a fixed sweep interval (30 s by default) it walks every live agent in the process and acts only when a session clears every guard simultaneously: idle past a configurable quiet window, both totalTokens and surfaceTokens above a token floor, no outstanding background jobs, no live descendant still in flight, cooldown elapsed, and not archived. Requiring both pressure and surface matters because a freshly compacted session still reads high on the pressure anchor while its actual compactable area is tiny; re-summarising it would burn detail to reclaim almost nothing, so the plugin simply skips it. The entire artefact is a single self-contained ESM patch file with zero runtime dependencies; mount it on a profile and it is live, no build script required.
You will benefit most if you run long-running agent workflows where sessions routinely go quiet for hours, or if you are on the minimal preset, which ships no compaction backend at all. Beyond adding idle compaction, the plugin re-enables a host-plane backend so sessions that previously had no way to be compacted are now covered, giving even the leanest configurations a working safety net.
Use Cases
- A session sits quiet for hours after a long task and every request still pays for the stale tail
- Running the minimal preset with no compaction backend, so context bloat goes unchecked
- A parent session gets compacted mid-wait while a background child is still settling its result
Best For
- DeepSeek Harness users running long-running agent workflows
- Profile operators on the minimal preset with no compaction backend
- Ops leads who want automatic token reclamation on idle sessions without touching active ones
Related Plugins
Memory layer for coding agents that indexes local session history and auto-recalls relevant context before edits, commands, and failures, with no manual search needed.
Traceable, searchable cross-session memory for AI agents that turns conversation knowledge into a typed knowledge graph and recalls relevant subgraphs instead of replaying full history, natively integrated with DeepSeek Harness.
Gives DSH AI cross-session long-term memory, to-do and skill management, plus multi-session orchestration, external AI delegation, and an infinite canvas that grows with you.
dsh-mnemon is a three-tier, pluggable, Agent-driven memory system for DeepSeek Harness, combining Runtime memory, Project Documents, and replaceable Memory Spaces with nine long-term providers.