dsh-fork-perf
Run the following command in DeepSeek Harness:
dsh plugin install orangeofcarl0-sys/dsh-fork-perf
Paste the following prompt into your AI chat to install this plugin:
Run dsh plugin install orangeofcarl0-sys/dsh-fork-perf in your terminal to install this plugin; the full source is available at https://github.com/orangeofcarl0-sys/dsh-fork-perf
About this plugin
In DSH, forking a conversation that has grown past 15 MB forces the engine to perform multiple full deep-copies of the entire event log on every branch. Under a realistic 18 MB / 20 k-event workload, a single fork generates roughly 500 ms of synchronous blocking—enough to tear through a streaming LLM response, freeze the UI, and trip transport-layer heartbeat retries. This is the problem dsh-fork-perf targets.
The plugin exploits a straightforward observation: the seed events handed to a fork are already deep-frozen, immutable pure JSON trees that passed full JSON-boundary and surface validation at the moment they were ingested. No downstream code can mutate them, so the deep copies originally meant to provide isolation are semantically redundant. dsh-fork-perf re-routes the fork seed through the fromRestore channel to reuse those frozen references in place, and swaps the structuredClone(seed) call inside PersistenceCoordinator.initFor for the same reference-reuse pattern. The child-session header and on-disk layout remain field-for-field identical to the official fork path. Under identical load the fork body drops from 344 ms to about 19 ms (an 18x speedup) and initFor falls from 135 ms to near zero. A three-layer fallback (capability probe, runtime exception guard, config toggle) together with a clean dispose path guarantee the plugin can be removed safely at any time.
If you regularly manage large multi-turn DSH sessions, fork branches frequently for parallel experiments or context comparisons, and are paying a real cost in stream interruptions and UI stutters, this lightweight drop-in patch eliminates the dominant bottleneck on the fork path.
Use Cases
- Frequent forking on large multi-turn sessions over 15 ms without hundreds of milliseconds of synchronous blocking
- Streaming LLM responses interrupted by fork deep-copies, UI freezes, or heartbeat timeout retries in DSH
- Running multiple parallel forks for experiment comparison without cumulative deep-copy latency
Best For
- AI application developers working with long-form DSH conversations
- AI researchers who frequently branch sessions for parallel experiments
- Engineers focused on DSH inference-path performance
Related Plugins
A unified suite combining hot runtime injection, task-aware thinking-mode routing, and a graded session protocol with red-team gates to sustain model diligence across long-horizon inference.
ModLens is a vision plugin for DeepSeek Harness that gives text-only models sight by reading images pasted directly into chat, with zero-config setup and multiple vision engines.
On-demand vision for text-only DeepSeek Harness agents: built-in free keyless vision chain and 14 vision tools, routing image turns as tool calls to vision models with pixel fidelity, no Python needed, one-command install.
Give text-only models in DeepSeek Harness eyes, enabling image Q&A, long-screenshot OCR, UI restoration, and GUI visual tasks.