A Settings page with one 5–100 slider that hard-caps the whole DSH process tree through a Windows Job Object, so ffmpeg, whisper and python children stop using every core. Windows only; without koffi the slider only stores its value.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:playfox2025/dsh-perf-control
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
简体中文 | English
A CPU throttle slider for DeepSeek Harness (DSH): open Settings → Perf Control, drag between 5 and 100, and the whole DSH process tree is hard-capped at that share of total machine CPU. 100 means no limit.
The cap is kernel-level, not advisory: the host process is put into a Windows Job Object with a CpuRate hard cap, and every child it spawns — ffmpeg, whisper, python, renderers — inherits it.
Install
dsh plugin --profile desktop add dsh-perf-control
Or straight from GitHub source (no build step):
dsh plugin --profile desktop add github:playfox2025/dsh-perf-control
Reload the plugin once (or restart DSH); Settings then has a "Perf Control" section (「性能控制」 in a Chinese UI).
Usage
Drag the slider and release to apply. Two buttons:
- Apply: push the current value into the Job Object.
- Reset to unlimited: same as 100, drops the cap immediately.
- The page also reports backend state: whether
koffiis installed, whether the job exists, and which rate was applied last time.
The value is stored in ~/.dsh/perf-control/state.json and re-applied when the host boots; the most recent apply result is in last-apply.json, which is the first thing to check when debugging.
How it works
Three layers, top to bottom:
- Settings page: registers a
settings.sectionwith a 5–100 slider. - Local route:
/api/dsh-perf-control?action=status|apply|reset, behind the harness's ownconnectiongate (loopback same-origin only), not a bare HTTP endpoint. - Job Object:
lib/job.mjsuses koffi to call kernel32'sCreateJobObjectW/AssignProcessToJobObject/SetInformationJobObjectwithJobObjectCpuRateControlInformation(CpuRate1–10000,ENABLE | HARD_CAP). No compilation, no native build step.
Why the detour: DSH's main process idles most of the time; the cores are eaten by the children it spawns. Plugins like bili-watch call import { spawn } from 'node:child_process' directly and bypass the official subprocess service, so instead of intercepting every spawn we put the host into a Job and let children inherit the cap.
The floor is 5%: below that the whole tree (UI included) stops moving. The slider, the host's parseLimit, and the state-file readback all clamp to 5, so writing 1 still ends up as 5.
Measured
scripts/probe-throttle.mjs: on a 12-core box the same busy loop burns 2.02 s of CPU in 2 s of wall time without a cap; with a 3% cap it burns only 0.86 s (3.6% of the machine). The cap really bites.
scripts/smoke-client.mjs: client bundle smoke test across three environments — no locale, English, Chinese — checking slot registration, the label value, and that the page renders.
Limits and pitfalls
- Does not affect processes already running. The job only covers children created after it is set up; an ffmpeg that is already running has to exit first.
- The cap covers the whole tree, UI renderer included; dragging to 25% makes the UI slow too.
- Hard rate limiting is Windows-only. Other platforms return
unsupported-platformand the slider only stores its value. Cross-platform would need cgroup / nice instead. - Without koffi the backend shows "not ready". It's an optionalDependency and
npm installbrings it in; if you installed by hand (a local link, say) runnpm i koffiyourself. The loader looks in the plugin's ownnode_modules/koffifirst, then in the profile's. - External browsers are out of reach: watching Bilibili in your system browser puts that player outside the DSH process tree.
Compatibility
- Windows (the hard cap itself is a Windows API).
- DSH ≥ 0.2.1-rc.1 (
engines.dsh). - Node ≥ 22.
- The UI follows the DSH language: "Perf Control" in English, 「性能控制」 in Chinese. Page strings live in the
zh/endictionaries inclient.js; card text lives inlocale/zh.jsonandlocale/en.json.
Development
node scripts/smoke-client.mjs # client bundle smoke test
node scripts/probe-throttle.mjs # measure the cap (--cap compares against 3%)
The plugin is plain JS with no build step; edit and reload the plugin to see changes.
License
MIT
Links
More in this category
Tencent/WeKnora#dsh-weknora★ 38236
Four read-only tools over a WeKnora knowledge base: list knowledge bases, hybrid passage search, reassemble one document's chunks in order, and WeKnora's own cited RAG or ReAct-agent answer with a resumable session id.
DayuanJiang/next-ai-draw-io#dsh-plugin★ 37190
Draws draw.io diagrams in DeepSeek Harness through the next-ai-drawio MCP server: the link in the reply opens a live preview in the right sidebar, you can edit the diagram by hand, and each AI change is a version you can restore. Node.js 18+; npx downloads the MCP server on first use.
superdesigndev/treg★ 9111
Tool catalog for agents: search ~2,600 external endpoints (SEO and SERP, backlinks, social, people and company enrichment, ad libraries, scraping) by the task you want done, read each one's parameters and per-call price, then call it with the credential injected server-side. Ships the skill plus an MCP row that stays disabled until TREG_TOKEN is set.
T-Auto/dsh-ops★ 6016
Provides bash, PowerShell 7, and high-performance Rust tools for DSH on Windows to reduce token usage.
helloHub1212/dsh-windows-mcp★ 2563
Bridges the CursorTouch/Windows-MCP desktop automation server into DSH through the official MCP client bridge, registering its screenshot, UI tree snapshot, mouse and keyboard input, clipboard, process and registry tools as mcp__windows__* tools for the model, and adds a windows_mcp_doctor diagnostic tool. Computer Use is off by default and is switched on from the plugin panel.
sixtysevenlf/dsh-blender-plugin★ 2280
Lets a DSH agent drive a local Blender over a direct TCP channel with 15 tools: viewport frames, custom-angle renders, Python execution, headless and job offload, transaction rollback, and a planning layer of 228 ops across 34 families.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.