A focused coding agent preset for DeepSeek Harness: intent-first scope, first-principles root-cause fixes, native parallel tool surface, and verified delivery — installed as a hot-pluggable bundle.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-liangheng
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:PandaBoby/dsh-liangheng
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
Core Positioning
dsh-liangheng is an independent focused-coding agent preset for DeepSeek Harness (aligned and verified on 0.2.2-rc.5), derived from LiangShen. It ships with its own package name (dsh-liangheng), preset ID (liangheng), client UI slot (liangheng-burst), and settings/locale namespaces so it runs cleanly side-by-side with @linxin666/dsh-liangshen.
- Lean Coding Persona (
dispatcher: falseby default): Replaces the 24.6 KB heavy coordinator block by default with a high-signal solo-first coding discipline + opportunistic parallelsubagent/subagent_forkdelegation, an intent gate (ask_user_questiononly on high-impact ambiguity), defensive external boundary alias compatibility, two-pass hypothesis fuses, strict YAGNI, explicit Verified/Inferred/Unverified reporting, self-driven interactive commands (a persistent TTY for a CLI's own web auth, computer-use for the consent click, instead of asking the user for a one-time code), and Section 5 clean output formatting rules (> **结论**lead callout,> **分析**for notes between tool calls, wrap-safe≥ 4-column wide tables, disambiguated[dir/file.tsx:24–30](<...>)links, CJK typography, and Mermaid diagrams). - Native Wire by Default (
presentation: 'native') & Rich Visuals: Keeps the native roster on the wire for lower latency, native parallel tool calls, and streaming diff cards. Drops redundantstr_replace_editor, enablesapply_patch,web_fetch, andpresentdeliverable cards, preserves host file/image reference sections for inline/hover local images, and registers a zero-dependency theme-aware Mermaid SVG fence renderer + session-scoped chat visual polish (data-liangheng-chat="on") on the client. The queued-message strip is taken over as well: Edit no longer rewrites a queued row in place — it pulls the whole message (text + images) back into the composer so the next edit happens there. - Gentle LRU Tool Paging & Anchors: High-fan-out families (
mcp__*,browser_*,task_board_*,team_*,squad*,ui_*,ssh_*) stay paged out untiltool_activateloads them (LRU cap 3, replayed from session logs), whilefact_registerand[Working Context: ...]pin hard constraints across long sessions. - DSH
0.2.2-rc.5Runtime Fixes: Fixessubagent-routesschema probing and live model/parent lookup,dispatch-guardroot detection for resumed child sessions andsubagent/start/endtracking,tool-catalogerrored-activate filtering andcompaction/endsync,fact-ledger/working-contextnative error filtering, andminimal-promptworking_directory+apply_patchpath tracking.
Performance and Feasibility Benchmarks
To validate real-world feasibility empirically, we ran a controlled head-to-head benchmark via /usr/local/bin/dsh --profile headless across Standard (standard), LiangShen (liangshen v0.4.21), and LiangHeng (liangheng v0.2.0):
- Setup: DSH
0.2.2-rc.5, identical model routeDeepSeek-V4.1-Flash-1017(reasoningEffort: max), isolated sandboxes, 6 full-spectrum engineering tasks × 3 modes = 18 live CLI sessions (0retries,0infra failures), plus a 3-task regression suite after merging two prompt refinements. - Composite Formula:
0.70 * Quality + 0.10 * Speed + 0.08 * TokenEfficiency + 0.06 * ToolDiscipline + 0.06 * RigorHonesty.
Live CLI Scorecard
| Mode | Overall Score(Raw / Calibrated*) | Quality Mean(Raw / Calibrated*) | Total Time(Avg / Task) | Total Tokens(Output Tokens) | Tool Error Rate | Read First | Verified After Write | Honesty |
|---|---|---|---|---|---|---|---|---|
LiangHeng (liangheng) |
93.00 / 98.83 | 90.00 / 98.33 | 593.1s (98.8s) |
3,607,179 (185,837) |
0.0% | 100% | 100% | 100% |
Standard (standard) |
88.34 / 92.65 | 93.83 / 100.00 | 985.3s (164.2s, 1 timeout) |
9,114,334 (274,889) |
0.0% | 100% | 100% | 100% |
LiangShen (liangshen v0.4.21) |
84.27 / 88.94 | 79.50 / 86.17 | 601.8s (100.3s) |
4,047,681 (178,289) |
0.0% | 100% | 83.3% | 100% |
*Calibration note: accounts for destructured DI parameters (
{ store, rateLimiter }) instandardT2,process.exitCode = 2mutation killing instandard&lianghengT3, and passing the specified{ status, body }envelope tobuildPanelViewModelinT6(while preservingstandard's extrax-signaturealias credit on the initial run).
Post-Optimization Regression (T1, T3, T6 on liangheng)
After merging Defensive boundary compatibility and stronger Native parallel read-only batching into presets/liangheng/agent.cordis.yml:
T6Full-Stack & Honesty: Raw/calibrated score rose from50 / 90to80 / 100(now acceptsx-signature/x-hub-signature-256/x-webhook-signatureandx-timestamp/x-webhook-timestampwhile explicitly stating assumptions and retaining20/20epistemic honesty).- Native Parallel Tool Step Share: Combined
parallelSteps / totalStepsWithToolsacross{T1, T3, T6}increased from12/41(29.3%) to23/58(39.7%) (T1:13.3% → 34.4%,T3:7.1% → 23.1%). - Feasibility Verdict: Ready for production coding workflows—39.8% faster and 60.4% fewer total tokens than
standardwith zero timeouts, while avoiding thedispatcher: trueearly-turn stall observed inliangshenonT3(27/100).
Test Scope and Verification Matrix
1. Repository Unit & Composition Suite (17 Test Files / 167 Passing Tests)
- Host & landing burst: src/index.test.ts, src/announce.test.ts, src/core/lever.test.ts —
DSH_HOMEresolution, preset metadata, the preset-landing rule, compatibility aliases, and idempotent mounting (32 tests). - Strict YAML Composition: src/composition.test.ts — strict YAML parser guards, relative module URL resolution, 3-row paging invariant (
pagedToolPatterns&idleReclaimSteps),presentmounting, andnative↔tool-executor-ptcsync (33 tests). - Client Mermaid SVG Renderer: src/client/mermaid-lite.test.ts — flowchart (with subgraphs, CJK & quoted labels, XML escaping), sequenceDiagram (messages, self-calls, Note, alt/else), stateDiagram-v2, and graceful fallback on unsupported diagram types (4 tests).
- Client Typography & Ledgers: src/client/chat-polish.test.ts, src/client/check-list.test.ts —
check/checksledger row parsing (tick states, CJK keys, prose refusal) plusChatPolish.cssselector scoping, stable DOM hooks, vertical rhythm, and theme tokens (22 tests). - Queued-message pull-back: src/client/queue-pullback.test.ts, src/client/QueueStrip.test.tsx — queued-row parsing (text/images/files, unaddressable wire blocks skipped), pull-back order (stage → composer → row removal), attachment-refusal rollback, failure leaves the row queued, whole-row click, menu delete with Escape, steer only while running, and multi-row collapsing (17 tests).
- Paging & Runtime Plugins: presets/liangheng/paging.test.mjs (30 tests) + 7 module test suites covering
subagent-routes,dispatch-guard,fact-ledger,working-context,tool-activate,tool-catalog(presentcuration), andminimal-prompt(file-referenceretention) (29 tests).
2. Full-Spectrum CLI Engineering Suite (6 Domains)
| Domain | Verified Capabilities | Calibrated Score |
|---|---|---|
| Frontend | :root design tokens, :focus-visible, responsive Grid/Flex (@media 768px, no overflow), immutable state, XSS escaping, A11y (aria-pressed, role="dialog"), IME guard |
100 / 100 |
| Backend | Store/limiter/service decoupling + DI, per-tenant mutex across async hooks, in-flight idempotency + rollback, [now-W, now) sliding window, idempotent release, O(1) amortized queue (1037ms → 14–16ms for 20k ops) |
100 / 100 |
| Testing & CI Pipeline | Spec bug fixes, node:test suites across unit / whitebox / integration / blackbox CLI subprocess, plus pipeline.mjs syntax gate killing 4/4 injected mutants |
100 / 100 |
| Reproduction | Fast router malformed-URI crash fix + standalone deterministic repro.mjs (fails non-zero on unpatched seed, passes when fixed) covering 3-hop async cache/normalizer/batcher race + ROOT_CAUSE.md |
100 / 100 |
| Bug Hunting | Hint-free audit catching 5 latent bugs: UTC midnight boundary loop, async-generator lock/FD leak on early break, __proto__ pollution + sibling-prefix path traversal, surrogate-pair truncation, immutable stable tie-break & NaN sort |
100 / 100 |
| Full-Stack & Honesty | Strict AGENTS.md envelope & timingSafeEqual compliance, multi-header alias normalization, secret-safe UI view-model, and honest separation of locally verified tests vs. unreachable .invalid probe |
100 / 100 (post-merge) |
Applicability and Mode Fit Guide
| Workload | Recommended Config | Fit | Notes |
|---|---|---|---|
| Focused Feature Coding & Refactoring | Default (native, dispatcher: false) |
★★★★★ | Minimal prompt overhead, zero coordinator stall, apply_patch + parallel native calls |
| Debugging, Root-Cause Repro & Security Audit | Default (native, dispatcher: false) |
★★★★★ | Read-before-edit, 2-pass hypothesis fuse, strict Verified/Inferred/Unverified split |
Test Suites, CI Gates & headless Automation |
Default (native, dispatcher: false) |
★★★★★ | Finishes full write-verify loop in one root session (avoid dispatcher: true in headless one-shot runs) |
| Interactive Multi-Subsystem Orchestration | Enable dispatcher: true |
★★★★☆ | Best in multi-turn interactive UI sessions coordinating independent workers |
| Dense External MCP / Scripted Tool Loops | Switch presentation: 'ptc' |
★★★★☆ | Collapses surface to run_code SDK scripts (requires host ptcRuntime) |
| Office Docs, Scheduling & General Non-Code Tasks | Use official standard preset |
★☆☆☆☆ | present, tool-office, tool-schedule, and time-context are intentionally omitted |
Architecture and Tool Surface
flowchart TB
subgraph request["Per-Request Composition"]
P["Coding Persona + Live CWD<br/>(dispatcher off by default)"] --> W["Wire: native roster by default<br/>(optional ptc run_code)"]
K["Tool Catalog Message<br/>reachable tools + paged summaries"] --> W
C["Working Context + Fact Ledger<br/>[Working Context: ...]"] --> W
W --> R["Resident Tools<br/>bash/pwsh · read/write/edit/apply_patch<br/>glob/grep · web_search/web_fetch<br/>subagent/subagent_fork · plan/goal/skill/fact_register"]
W -.-> Q["Paged Summaries<br/>activated via tool_activate"]
end
Q -->|tool_activate| W
Resident tools cover platform shell (bash/pwsh), filesystem (read, read_image, write, edit, apply_patch, glob, grep), orchestration (todo_write, ask_user_question, skill, plan, goal, fact_register, tool_activate, present), delegation (subagent, subagent_fork, send_message, list_agents, wait_agent, ralph), and web (web_search, web_fetch). Result pruning aligns with 0.2.2-rc.5 at 8192 / 4096 / 1024 chars.
Quick Start
From npm (recommended):
dsh plugin --profile web add dsh-liangheng
Replace web with the profile you actually use — the desktop client is desktop.
From source: get the checkout from https://github.com/PandaBoby/dsh-liangheng (private repository, access required), then run this from its root:
npm install
npm run build # rebuild lib/ and inline the stylesheet into client.js
dsh plugin --profile web add link:"$PWD"
Two things that bite:
link:records an absolute path on this machine, so run it from the repository root; move or delete the checkout and the profile entry goes stale — re-addit.- After editing source,
npm run buildis not enough: commitlib/too. CI rebuilds and diffslib/file by file, and fails on any difference.
Restart dsh web or the desktop client, open a new empty session, and pick LiangHeng mode in the preset picker above the composer; the mode landing plays one burst.
Configuration
Defaults live in presets/liangheng/agent.cordis.yml:
| Key | Row | Default | Effect |
|---|---|---|---|
presentation |
tool-catalog |
native |
Session wire presentation (native roster or ptc run_code) |
dispatcher |
minimal-prompt |
false |
Appends dispatcher-rules.mjs when enabled |
pagedToolPatterns |
tool-catalog, tool-activate, working-context |
7 families | Withheld until activated; must stay identical in all 3 rows |
idleReclaimSteps |
same 3 rows | 0 |
0 = LRU only; N expires idle namespaces at next activation or compaction |
maxResidentTokens |
tool-catalog |
8000 |
Warns once if resident schemas exceed budget |
descriptionMaxLength |
tool-catalog |
200 |
Max summary length for uncurated tools |
instructionSource |
minimal-prompt |
host |
AGENTS.md delivery: host / system-prompt / hint |
keepPlanPolicy |
minimal-prompt |
true |
Keeps plan:policy (also allows team:policy) |
keepFileReferenceSections |
minimal-prompt |
true |
Retains @file, image/line link, and present guidance sections |
Development
npm run build # build JS, types, and inline CSS into lib/client.js
npm run typecheck # tsc --noEmit -p tsconfig.json
npm test # vitest run (17 test files, 167 tests)
node tools/check-dispatcher-rules.mjs # check dispatcher rules drift
See CONTRIBUTING.md and CHANGELOG.md.
Attribution & License
- LiangShen (
@linxin666/dsh-liangshenv0.4.21) — Apache-2.0, © zhu1090093659. See LICENSE and presets/liangheng/NOTICE. - DeepSeek Harness built-in presets — Adapted from
minimal,standard, andptc(MIT). - dsh-anchored-standard — https://github.com/xiaobright/dsh-anchored-standard (MIT).
Special thanks to 稳明光语纪 for providing unmetered token capacity for this project's agent development work — the benchmarks and long-session verification run on it.
Links
More in this category
Tencent/WeKnora#dsh-weknora★ 38385
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★ 37218
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.
yikart/AiToEarn#dsh-plugin-aitoearn★ 28812
Generate copy, images and short videos, and publish with one click to Douyin, Kuaishou, Xiaohongshu, WeChat Official, Bilibili, Facebook, TikTok and more, covering the full content lifecycle from creation to publishing and monetization.
superdesigndev/treg★ 9804
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★ 6039
Provides bash, PowerShell 7, and high-performance Rust tools for DSH on Windows to reduce token usage.
Hithink-Tech-Org/Financial-API#hithink-finance★ 4659
Query Hithink Finance data in DeepSeek Harness, view charts in chat, and save refreshable dashboards.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.