Introduction¶
The core architecture of DeepSeek Harness (DSH) is “everything is a plugin.” When third-party plugins are introduced into the ecosystem, issues such as long-session runtime, UI rendering, background requests, tool tasks, and listener/timer pressure become harder to pinpoint. Simply observing symptoms is not enough to determine which component is causing the load, and manual comparisons often lack statistical significance.
qinshige/dsh-performance-guard is a plugin for DeepSeek Harness Host + Web Client used to diagnose the performance bottlenecks described above. It provides reversible profile isolation and quantifiable before/after validation. The plugin belongs to the admin-security category and is maintained by developer qinshige.
Core Features¶
The plugin provides a complete performance monitoring and experimentation framework:
- 60-second browser check: captures per-second FPS, long tasks, event timing, layout shifts, resource timing, DOM size, and session readiness after the session snapshot is opened and after two repaints.
- Host process monitoring: captures CPU, RSS, heap memory, event-loop lag, and Node.js active resource counts (listeners, timers, child processes).
- Native DSH tool observation: observes
tools/execute,llm/stream, andsession/eventduring checks, recording tool duration/failures, model duration/time-to-first-chunk/cache markers, and broad session-event classifications. - Session structure tracing: records long-session structure in a content-agnostic way, including events, turns, messages, tool calls/results, assistant blocks, and compaction counts.
- Explicit measurement coverage: tallies foreground/background time, generated/uploaded/accepted/invalid/rejected/evicted events, Host/FPS coverage, and sampling overhead.
- Unified timeline: aligns browser, Host, tool, model, and session activity per second.
- A/B validity gate: sets validity checks based on session, duration, size, coverage, browser capabilities, viewport, environment versions, and workload fingerprints.
- Reversible plugin isolation: supports stable half-set suggestions and precise isolation-set reports for third-party plugins, along with historical baseline selection.
- Persistent multi-run experiments: supports multi-run experiments with at least 3 valid index pairs, using paired-difference Student 95% confidence intervals and bias-corrected paired Hedges’ g. Results are labeled
improved,regressed,no-effect, orinconclusive. - Cross-restart bisection: provides cross-restart plugin bisection guidance to test the improved half-set or the no-effect complement.
- Recovery Center: manages incomplete, unverified, and rollback-incomplete profile transactions.
- Local reports: generates benchmark and aggregate experiment reports with sanitized JSON and static HTML.
Installation and Activation¶
After installing and building with pnpm, link it using the DSH plugin command.
pnpm install
pnpm run build
dsh plugin --profile web add link:$(pwd)
After installation, restart DSH Web and go to Settings → Performance Guard to use it.
If it is published via npm, you can also use it directly:
dsh plugin --profile web add dsh-performance-guard
Usage Workflow¶
- Establish a baseline: open the target session and start a 60-second baseline check.
- Reproduce the issue: perform operations that cause lag, such as session switching, scrolling, expanding tool cards, and running tools.
- Inspect the analysis: view findings, timeline, Host activity, and measurement coverage.
- Configure the experiment: in Repeated experiments, select a valid baseline, plugin pool, primary metric, and run count (3/5/7), then complete the remaining baseline runs.
- Isolate and collect: create an isolated profile, restart using the generated command, and collect candidate runs.
- Iterate and optimize: follow the persisted next action: recurse into the improved half-set or test the no-effect complement. Return to the source profile before creating each new isolation profile.
- Export and repair: export the aggregate experiment JSON/HTML, and check the Recovery Center if necessary.
Security and Privacy¶
- Safe mode: creates a
$DSH_HOME/profiles/<profile>-perf-safe-<id>directory containing metadata,node_modules, and a Loader overlay. Writes a preparation log before operations, marks ownership immediately after creation, and writes a completion marker at the end. - Direct disable: writes a persistent backup and preparation log before replacing
cordis.patch.yml. - Rollback mechanism: rollback operations validate the post-change SHA-256, stop only when user edits have not been overwritten, and clean only exactly matched directories.
- Client limits: the client event ring is limited to 5,000 events and 8 MiB.
- Privacy protection:
- Not collected: prompts, responses, DOM text, raw session IDs, tool arguments/results, request path/body/headers, cookies, credentials, and environment variable values.
- Only necessary information is reported: plugin/tool names, model
provider/model/purpose. - Fingerprinting: the run fingerprint includes only software/browser version, platform/architecture, CPU count, total memory, viewport, and DPR. Resource domains and session IDs are hashed before persistence.
- Storage location: reports are stored in
$DSH_HOME/performance-guardand are never uploaded automatically.
Use Cases and Notes¶
- Use cases: long-session performance diagnosis, third-party plugin group stress testing, tool and timer stress analysis, and development workflows that require quantitative validation of fixes.
- Notes:
- The plugin runs with the current DSH process privileges; inspect the source code and license before installation.
- DSH does not expose a Shell restart API; the plugin returns the exact start command.
- Manual experiments provide only medium confidence (Correlated) and cannot be upgraded to Confirmed.
Conclusion¶
DSH Performance Guard is designed to help developers precisely locate performance bottlenecks through reproducible experiment workflows and isolation mechanisms. It provides a complete closed loop from data collection and isolation experiments to report export.
- Plugin Directory: https://www.skillhub.cn/plugins/qinshige/dsh-performance-guard
- GitHub Repository: https://github.com/qinshige/dsh-performance-guard