dsh-zh-thinking: Enabling the DSH model to think and respond in Simplified Chinese via a persistent system prompt

Preface

In DeepSeek Harness (DSH), a common practice to ensure the model uses Simplified Chinese for internal reasoning (thinking / reasoning) and user replies throughout the process is to write “Please think in Chinese” in AGENTS.md. This path tends to fail as the conversation lengthens: AGENTS.md is injected via agent-instructions in the user role and is only refreshed when the file is read/written/edited; the injected content enters the conversation history and can be obscured by compaction; furthermore, the model’s reasoning language is easily pulled back to English by the most recent English tool output. Real-world data in the README shows: after injection, the Chinese character ratio in the first two reasoning blocks is about 64.8% / 64.5%, but it reverts completely to English by the 89th block in the same session, with the overall long-session ratio dropping to just 5%–25%.

The following introduces the community plugin dsh-zh-thinking (Maintainer: programerror233, Category: Model Reasoning). By registering a persistent section to the system prompt, it ensures the rules remain visible to the model during every step’s assemble() + renderPrompt(). It does not enter history, is not discarded by compaction, and applies to all sessions, workspaces, and sub-agents.

What is this

dsh-zh-thinking is a package published on npm (current version 0.1.0, MIT License) aimed at DSH users: it forces the model in the Harness to write internal reasoning and final user-facing replies in Simplified Chinese. Once installed, it takes effect immediately via hot-loading; running sessions do not need a restart.

Plugin Page: SkillHub Directory
Source Code & Documentation: GitHub programerror233/dsh-zh-thinking

The DSH ecosystem emphasizes “Everything is a plugin”; community directories like SkillHub are independent sites and have no official affiliation with DeepSeek / High-Flyer.

Brief Principles

DSH’s dsh-agent-loop reassembles and renders the prompt at every step; SystemPromptProjection.project can achieve zero commits if the text is unchanged. Rules written into the system prompt therefore:

  1. Are effective at every step, rather than “reminded once then decaying”;
  2. Do not enter conversation history;
  3. Are not affected by compaction (compaction only processes nodes after surface node 0).

The plugin uses an independent section name zh:reasoning-language to avoid being obscured by existing persona-related sections in various agent presets, thereby taking effect for all agents globally (including sub-agents). order: 1 places it immediately after the persona prefix (order: 0) and before tool descriptions, classifying it as an identity-level instruction.

Installation & Activation

The official recommendation is to install via DSH’s plugin command (commands from README, please replace with your profile name):

dsh plugin --profile <your profile name> add dsh-zh-thinking

For example, if the profile name is desktop:

dsh plugin --profile desktop add dsh-zh-thinking

After installation, dsh will list it in the profile’s dsh.profile.bundles, and the bundle patch layer will automatically mount it.

Note: The plugin runs with the current dsh process permissions; it is recommended to review the source code and LICENSE (MIT) on GitHub before installation to ensure compliance with your security and compliance requirements.

Manual Installation (Bypassing npm)

The README explains that the repository can be placed locally, and the following can be appended to the end of the profile’s cordis.patch.yml (paths must be changed to your absolute path; Windows users should use the file:/// format, as bare drive letter paths will report ERR_UNSUPPORTED_ESM_URL_SCHEME):

- insert:
    - id: zh-thinking
      name: file:///absolute/path/to/dsh-zh-thinking/lib/index.js

npm installation and the manual insert above cannot coexist (the same section name will trigger prompt section "zh:reasoning-language" is already registered). When migrating, you must first delete the manual entry, then execute dsh plugin ... add dsh-zh-thinking.

Configuration (Optional)

Plugin items can be overridden in the profile’s cordis.patch.yml:

- id: zh-thinking
  name: dsh-zh-thinking
  config:
    sectionName: zh:reasoning-language   # Section name, changing it is practically unnecessary
    order: 1                             # Lower is earlier; 0 is persona-prefix
    text: |-                             # Fully custom prompt body
      Your language requirement text.
Field Type Default Description
sectionName string "zh:reasoning-language" Must be a new name to avoid being overwritten by a preset section of the same name.
order number 1 0 is deployment:persona-prefix, 10200 is deployment:persona-suffix.
text string See README Do not include {{, otherwise it will be treated as a prompt variable reference and throw an error; the plugin will fall back to the built-in text and print a warning.

Key points of the default text: Use Simplified Chinese for both internal reasoning and final replies, prioritizing this over example languages and English task descriptions/tool outputs; code identifiers, paths, API names, etc., may remain in ASCII but must be surrounded by Chinese explanations; if English thinking is detected, rewrite it in Chinese before continuing.

Typical Usage & Verification

After installation, it takes effect globally without additional operations. To confirm the section has been injected, you can view the system/message event in the logs after starting any session (using dsh’s inspect capability or reading the session JSONL directly). The body should contain # Language Requirements (Highest Priority) or your custom text.

Measured data recorded in the README (original version on Windows): The length of this session’s system/message changed from 8016 (without language requirements) to 8297, with the language requirement located at character 116; after injection, the average Chinese character ratio in 12 consecutive reasoning blocks was 46.2%, compared to an average of 3.6% across 239 blocks in the same session before injection. The system/message of newly spawned sub-agents also contains this rule; examples of sub-agent reasoning block ratios were 28.8% / 50.9% / 56.5% / 81.8%, with final replies in pure Chinese.

Cost & Compatibility

The persistent rule is approximately 300 tokens and hits the prompt cache at every step. The README estimates based on roughly 0.7 tokens/character for Chinese: a 235-step session involves about 70,000 cacheRead tokens, accounting for 0.62% of the total cacheRead for that session. Compared to appending a 60-character reminder message every step—which accumulates to about 9,870 tokens and gets discarded by compaction—this approach is cheaper and more reliable.

  • Zero import, no dependency on profile node_modules resolution matrix;
  • Relies only on the public API ctx.systemPrompt.section() (dsh-system-prompt);
  • Requires Node >= 20 (see package.json).

Use Cases & Known Boundaries

Suitable for: Teams or individuals who develop long-term in DSH, wish for thinking and user replies to stably use Simplified Chinese, and do not want to rely on decaying AGENTS.md prompts.

Boundaries (From README):

  • The same section name can only be registered once; if conflicting with other plugins registering zh:reasoning-language, you must change config.sectionName or keep only one.
  • Only affects reasoning generated afterward; historical English reasoning will not be rewritten.
  • Cannot enforce a 100% Chinese character ratio (paths, commands, API names, etc., remain in ASCII by design).
  • The model may still occasionally intersperse English phrases; the rule is a probabilistic constraint, not hardcoding.

Uninstallation

dsh plugin --profile <your profile name> remove dsh-zh-thinking

Conclusion

dsh-zh-thinking transforms “think and answer in Simplified Chinese” from easily decaying historical messages into a system prompt section present at every step, covering the main session and sub-agents, and supports optional custom text. For installation commands, manual patches, and configuration fields, refer to the GitHub README; for directory indexing, see SkillHub.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye