Preface¶
When running agents in DeepSeek Harness (DSH), privileged operations triggered by tools such as Shell, Edit, and Write will pop up an approval window (Approval). In newer versions, the buttons and titles are usually already in Chinese, but the authorization reason (reason) inside the window usually remains in English—it is free text passed in by callers such as bash, edit, and write. The official panel has no built-in dictionary, so sentences like Tool bash requests privileged execution. keep showing. For people who use a Chinese interface daily, having to switch back and forth between the English reason and the actual command is both slow and error-prone.
The approval-zh introduced below (repository KNGLOKIKO/dsh-plugin-approval-zh) is a community-maintained DSH plugin classified as a client plugin (it contains both host and client halves). It takes over the approval cards on conversation.composer and redraws them in Chinese, prioritizing a local vocabulary table to translate common reasons and UI text; when no match is found, the host-side model-router serves as a fallback. It does not translate audit records, nor does it change the approval semantics of “Allow once / Deny”.
What is this¶
- Positioning: A Chinese localization plugin for the DSH approval window (approval panel).
- Maintainer: KNGLOKIKO (GitHub repository dsh-plugin-approval-zh, community catalog page SkillHub entry).
- Bundle name:
@local/approval-zh(see the repository’spackage.json, current version 1.0.0, license MIT). - Runtime: Cordis host + client; Node ≥ 18; the repository comes with 75 passing offline self-checks.
Before and after installing the plugin, the difference in the same approval scenario on the interface can be summarized as: the authorization reason changes from English to Chinese, the command detail lines still show the original commands (e.g., rm -rf build/), and the buttons remain “Deny” / “Allow once” and other existing Chinese text.
Core features¶
Client side: local vocabulary, zero network latency¶
client.js takes over the conversation.composer chain slot with priority: 0 (the official panel is priority: 1; lower numbers match first), and draws the entire approval card by itself. UI text comes from a built-in Chinese-English dictionary; common English reasons are matched by the PHRASES regex table; tool display names come from TOOL_LABELS (e.g., bash → “Shell command”). No network requests are made; common sentences can be localized before the popup opens.
When the vocabulary doesn’t match: the panel still shows the English reason, along with a “not yet included in the local vocabulary” hint, so no information is lost.
Host side: model-router fallback¶
index.js mounts an approval/request waterfall listener on agent.ctx at agent/created: if req.reason contains no CJK characters, it calls model-router to translate and writes back to req.reason; the result is cached on both host and client, and the same reason shows in Chinese instantly next time.
Three hard constraints ensure approval is neither slowed down nor broken:
| Constraint | Behavior |
|---|---|
| Hard time budget | By default, passes through on a 2500ms timeout, with the reason remaining in English |
| Always pass through | The listener always return next(); it does not consume or veto approval |
| Frozen objects | When Object.isFrozen(req), the host side skips rewriting and relies only on the client vocabulary |
Any step failure (missing library, timeout, model error, empty response) only triggers a console.warn; the interface keeps working as usual.
Boundaries explicitly not crossed¶
- Audit records still contain the original English
reason; Chinese applies only to the interface. - No automatic allow or deny; decisions are still made by user clicks or Enter / Esc.
- Command details depend on the slot kit’s
useChat; if the current DSH does not inject it intoconversation.composer, the detail area may not show, while the rest of the panel works normally. - In case of rendering errors, a React error boundary degrades to a minimal Chinese panel, avoiding a blank screen.
Installation and enabling¶
Installation executes plugin code in both the host and browser processes, requiring Full access or per-run approval. Please read the source code and the MIT license on GitHub first, and confirm before installing. Do not manually modify ~/.dsh/profiles/desktop/cordis.patch.yml under the profile; use plugin_manager instead.
Method 1: Install locally after cloning¶
git clone https://github.com/KNGLOKIKO/dsh-plugin-approval-zh.git
plugin_manager action=install_bundle
target=<克隆下来的绝对路径>
Method 2: Install directly from the git repository¶
The repository’s package.json already contains dsh.bundle.patch; no extra build is needed:
plugin_manager action=install_bundle
target=git+https://github.com/KNGLOKIKO/dsh-plugin-approval-zh.git
After installation, use (approval-free) cordis_inspect_query to confirm the plugin row has been inserted:
cordis_inspect_query platform=host provider=Config method=listConfigs
input={"name":"@local/approval-zh"}
A status: "absent" response is normal—it means this plugin does not export a Config schema, not that it is not installed.
Refresh the page or restart DSH to let client.js enter the browser module table.
Uninstall¶
plugin_manager action=remove_bundle target=@local/approval-zh
Optional configuration¶
Adjust in the config of cordis.patch.yml (reinstall the bundle or restart DSH after changes):
- insert:
- id: approval-zh
name: '@local/approval-zh'
config:
libraryPath: '.../model-router/index.js' # 可选
translateBudgetMs: 2500 # 翻译硬预算
useModelRouter: true # false = 仅本地词表
libraryPath may be left empty; it is resolved automatically in order:
- Environment variable
APPROVAL_ZH_MODEL_ROUTER ../model-router/index.jsat the same level as this bundle
If neither can be resolved, only the client-side local vocabulary is used, and the plugin still works normally.
Typical usage and extending the vocabulary¶
No extra operations are needed in daily use: when a tool requests privileged execution, the approval window shows the reason and buttons in Chinese; the interaction logic is the same as the official panel.
If you need to cover new English reason sentence patterns or tool names, modify client.js in the repository, then reinstall the bundle and refresh the page:
- Full-sentence templates: append entries to the
PHRASESarray (order is priority), e.g.:
{ re: /^Tool\s+(.+?)\s+requests privileged execution\.?$/i,
build: (m) => '工具 ' + toolZh(m[1]) + ' 请求越权执行' },
- Tool names: add mappings to
TOOL_LABELS, e.g.bash: 'Shell command'. - UI text: modify the
zh/endictionary at the top ofclient.js.
Offline verification (no network, no DSH startup):
node selftest.mjs
Expected output: BUNDLE SELFTEST PASSED (75 checks).
Applicable scenarios and notes¶
Suitable for: users who long-term develop or operate agents in the DSH desktop/Web client, want approval popup reasons and tool descriptions unified in Chinese, while needing to keep the original command details and approval semantics.
Notes:
- The plugin runs with the current DSH process privileges; please review the GitHub source yourself before installation.
- When model-router is disabled (
useModelRouter: falseor no library configured), only the local vocabulary and client rendering are relied on, and unmatched reasons remain in English. - Community catalogs such as SkillHub have no official affiliation with DeepSeek / Hithink RoyalFlush; the DSH ecosystem emphasizes “everything is a plugin”, and this plugin is a community contribution, not a built-in capability of the official panel.
Conclusion¶
approval-zh uses “client vocabulary + host model-router fallback” to complete the localization of the hardest-to-translate reason in DSH approval, without touching audit semantics or user decisions. Catalog and source: