dsh-harness-zh: Splice DSH into the English prompt in the request and translate into Simplified Chinese

Introduction

The DSH interface itself already supports Chinese. locale preference can switch the interface, and locale/zh.json bundled with individual plugins can also override some copy. What is truly lacking in Chinese and invisible to the interface is the original English text embedded in the request:

The various paragraphs of system prompts, runtime context (working directory / sandbox policy / approval policy), the description and parameter explanations for each tool, and the Cordis API directory.

The target audience for this text is the model, not humans. Even though you see a Chinese interface on the screen, the request sent might still be in English, and the reasoning generated by the model based on this naturally follows the English path. dsh-harness-zh is designed to fill this gap: it replaces these strings with Simplified Chinese before the request leaves Harness, without affecting the interface language. The plugin is maintained by Giauzihau, version 0.2.7, adapted for DSH 0.2.1-rc.5, and released under MIT.

What is this

One-sentence positioning: A DSH plugin that translates model-facing English prompts into Simplified Chinese.

It translates fixed copy using dictionary lookup; it does not call any machine translation. Therefore, the same text always yields the same translation, and it won’t pollute a conversation due to occasional errors. The plugin only imports Node built-in modules (node:fs / node:path / node:os / node:url), because @deepseek-ai/* cannot be resolved in the configuration file’s node_modules.

Core Features

The coverage scope is divided into four layers, all dictionary-driven:

  1. System Prompt Paragraphs (sections) — Various system prompt segments assembled by DSH.
  2. Runtime Context (contexts) — Working directory, sandbox policy, approval policy, etc.
  3. Tool Descriptions (tools) — Descriptions for each tool name.
  4. Tool Parameter Descriptions (parameters) — The one with the largest volume of text.

In addition, there are messages (runtime context snapshot headers, skill catalog reminders), cordis-api.json (Cordis API directory, 813 entries), mcp.json (MCP resource server section), and runtime.json (sandbox policy wording, approval disable instructions, etc.).

The dictionary is located in dict/, containing 8 files, 988 entries + 11 templates. The lookup order is: exact match → whitespace-normalized match → template match ({{name}} capturing variable). If not matched, it remains unchanged; never guess, never machine translate.

A key behavioral boundary: The session layer only translates messages where message.source.kind belongs to the four types owned by the harness itself (runtime-context, skill-catalog, user-approval, working-directory). User or assistant body text is preserved as-is, no matter how large the dictionary is; it cannot change text typed by the user.

Installation and Activation

Install directly from GitHub, no build steps required (lib/ is pure ESM, dict/ is JSON):

dsh plugin --profile web add github:Giauzihau/dsh-harness-zh

Replace web with the actual profile you are using (web for browser GUI, desktop for Electron desktop). dsh is the CLI bundled with the app; on Windows if it’s not added to PATH, the full path is & "E:\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd".

When a reproducible version is needed, install to a specific tag or commit:

dsh plugin --profile web add github:Giauzihau/dsh-harness-zh#v0.2.7

For local development, you can also point directly to the repository directory:

dsh plugin --profile web add file:E:\path\to\dsh-harness-zh

After installation, restart Harness (refreshing the Web GUI page is not enough; the host process needs to restart). The plugin will be activated automatically via dsh.profile.bundles. Update to the latest version of the default branch, or uninstall:

dsh plugin --profile web add github:Giauzihau/dsh-harness-zh
dsh plugin --profile web remove dsh-harness-zh

Two notes:

  • The package contains runnable JavaScript, no build steps or prepare script, so pnpm won’t ask you to approve a build.
  • The first installation requires pulling the repository tarball; it may take a minute or two on slow networks.

For development verification, use the built-in tests; the plugin comes with 26 tests:

node --test

Configuration

Configuration is written in the profile’s cordis.patch.yml, overriding by plugin id:

- id: harness-zh
  config:
    sections: true         # System prompt paragraphs
    contexts: true         # Runtime context (working directory, sandbox, approval policy)
    tools: true            # Tool descriptions
    parameters: true       # Tool parameter descriptions (text-heavy)
    messages: true         # Runtime context snapshot headers, skill catalog reminders
    thinking: false        # Require the model to reason in Chinese (true / zh / en / custom sentence)
    extraDictionaries: []  # Extra dictionary directories, override/supplement built-in dictionaries
    dumpMisses: false      # Write untranslated original text to ~/.dsh/harness-zh-misses.json
    verbose: false         # Print hit statistics for each assembly on stderr

enabled: false can turn it off globally without uninstalling.

By default, only thinking is disabled because it is a behavioral constraint rather than text replacement and may slightly affect reasoning quality. verbose: true is suitable for troubleshooting which text failed to match during assembly; dumpMisses: true can save untranslated original text to a file for you to supplement the dictionary.

thinking: Chain of Thought Language

The content in the “Thinking” panel on the interface is reasoning tokens generated by the model itself, not fixed copy that the plugin can look up. No matter how complete the dictionary is, it cannot translate arbitrary natural language; the only feasible method is to require it in the system prompt:

- id: harness-zh
  config:
    thinking: zh   # Equivalent to true; 'en' means require English; other strings are injected as-is

After enabling, the plugin registers the same sentence twice: one as a system prompt segment (immediately before the persona prefix, before the tool policy), and one as a runtime context (order: 900, rendered at the end of every step snapshot). The latter is re-rendered every step and located at the end; testing shows it is easier to take effect than just writing the system prompt. Since version 0.2.7, the body also includes a Chinese positive example and a negative example, providing the model with a sentence structure to mimic.

There is a boundary that must be known in advance: Switching models is more effective than strengthening phrasing. Test results (0.2.7, 2026-10-31) show it is provider-specific:

  • DeepSeek Account (Official deepseek-account provider, e.g., deepseek-flash): All features work normally; the “Thinking” panel turns Chinese after enabling thinking: zh.
  • Other Proxy/Aggregation Providers (Channels forwarding models to third-party gateways, e.g., autodl): Prompt translation works as usual, but the reasoning process may remain untranslated, and the reasoning in the “Thinking” panel is still in English.

The reason is that thinking text is generated by the model or the proxy channel itself; the plugin can only request it to switch to Chinese via prompts, it cannot change already generated reasoning tokens; some proxy channels are not sensitive to language requirements in system prompts. The command also does not guarantee 100% effectiveness—it can change model behavior, but cannot rewrite an already generated Chain of Thought.

Furthermore, it only affects the “Thinking” panel and does not change the response language; the response language is still determined by your phrasing and the model’s own judgment.

Adding Your Own Dictionary

Text from third-party plugins (acp_*, hindsight_*, mcp_connector_*, modlens_*, etc.) is out of scope; they change with their own plugin versions, and hardcoding them into this plugin would rot with their upgrades. Use extraDictionaries to provide them separately when needed:

{
  "my-plugin:tool:foo": { "kind": "tool", "en": "Original English text.", "zh": "中文译文。" }
}

The directory pointed to by extraDictionaries contains *.json, with the same format as the built-in dictionary. Nested syntax ({ "<package name>": { "<key>": { "en": …, "zh": … } } }) is also readable, making it convenient to directly reuse community dictionaries.

How It Works: Three Steps, Because the Same Text is Rendered Multiple Times

  1. system-prompt/assemble (waterfall) — Translates sections, contexts, tools[].description, and description in parameter schemas before the assembled result is handed to the model.
  2. SystemPrompt#refreshContext (prototype patch) — Before agent-loop.step() sends a request, it re-parses every context from the registered providers, which restores the English translated in Step 1. The patch is applied to the prototype, not the instance.
  3. Session#append (prototype patch) — Runtime context snapshots and skill catalogs are appended by the session itself after assembly, while the actual request sent to the adapter is deeply frozen (attempting to rewrite in place will throw Cannot assign to read only property 'text'). Therefore, translation happens at the session layer: the message object is frozen, and the plugin appends a translated copy, keeping id and source unchanged.

All three steps are wrapped in try/catch; if any step fails in translation, it falls back to the original text, ensuring a conversation doesn’t fail.

Use Cases and Notes

Suitable for the following situations:

  • Your DSH interface is already in Chinese, but you want the system prompts, tool descriptions, and parameter explanations received by the model to also be in Chinese.
  • You are using a DeepSeek official account (deepseek-account provider) and want to make the model reason in Chinese as a side effect.
  • You need to troubleshoot English text from third-party plugins or MCP servers and need dumpMisses to help locate it.

Points to know in advance:

  • The plugin runs with the permissions of the current dsh process. Please check the source code and license (MIT; see NOTICE in the repo for attribution of derived translations) before installing.
  • Under third-party proxy/aggregation providers, the reasoning process may still be in English; this is a behavior difference of the model channel itself, not that the translation failed.
  • The description of each skill in the skill catalog comes from the corresponding skill pack and is still in English; this plugin only translates the framework sentence of that reminder.
  • Third-party MCP tool text directly presented to the model on the page is not in the dictionary.
  • If Harness later changes the shape of refreshContext / Session#append / system-prompt/assemble, the plugin will silently degrade to only translating the assembly stage (the interface will still work), and verbose: true can show the degradation point.

Conclusion

dsh-harness-zh does a very narrow thing: replacing the fixed English text in DSH that is embedded in requests but invisible to the interface with Simplified Chinese. It doesn’t touch text typed by users, doesn’t do machine translation, and falls back to the original text if translation fails. For DSH users who care about language consistency in model-side prompts, this is a small, well-defined supplement.

Directory page: https://www.skillhub.cn/plugins/Giauzihau/dsh-harness-zh
GitHub: https://github.com/Giauzihau/dsh-harness-zh

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

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

Xiaoye