Introduction¶
In the DSH plugin ecosystem, controlling the language of the model’s thinking process is a common requirement. The upstream plugin dsh-think-zh-expand intercepts the assistant-step renderer of conversation.chat.node to localize thinking blocks to Chinese and enforce Chinese output. However, this causes conflicts with any collapsing plugin (such as dsh-auto-collapse or dsh-turn-fold): the thinking blocks rendered by upstream do not produce the DOM anchors required by collapsing plugins, causing them to fail silently.
This plugin is an EAC custom version. It retains the upstream forced-Chinese logic (server-side System Prompt injection) and UI localization (client-side DOM text replacement), but completely removes the renderer takeover functionality. Thinking block rendering is delegated to the host, resolving coexistence issues with collapsing plugins.
Core Features¶
1. Server-side Forced Chinese Thinking¶
The plugin injects a fixed rule via system-prompt.section (order: -90) to require the model’s thinking process and responses to use Simplified Chinese. Terms such as code, commands, and file paths remain in the original text and are not translated.
2. Client-side UI Localization¶
For hardcoded English strings in the UI (such as “Thinking” and “Tool Call”), the plugin performs precise text replacement at the DOM level. It uses MutationObserver to remain effective across React re-renders, covering tool names, descriptions, and card titles.
3. Compatibility Optimization¶
The plugin removes assistant-step renderer registration and the custom-rendered thinking block feature. The Section name has been changed to dsh-think-zh-eac to avoid conflicts with upstream Sections of the same name, ensuring coexistence with collapsing plugins.
Installation and Activation¶
Install via Command Line¶
Run in DSH Terminal for the current profile:
dsh plugin --profile web add github:jing-hy/dsh-think-zh-expand-eac
After installation, use the following command to verify the configuration:
dsh --profile web --dump-config
The configuration output should include id: think-zh-expand-eac and name: dsh-think-zh-expand-eac. Restart DSH after verification.
Install from Source¶
git clone https://github.com/jing-hy/dsh-think-zh-expand-eac.git
dsh plugin --profile web-desktop add link:<仓库路径>
Typical Usage¶
The design goal of this plugin is to coexist with collapsing plugins. A recommended combination is:
dsh plugin --profile web-desktop add dsh-auto-collapse # 或 dsh-turn-fold
dsh plugin --profile web-desktop add github:jing-hy/dsh-think-zh-expand-eac
Note: It is not recommended to enable both dsh-auto-collapse and dsh-turn-fold simultaneously, because their mechanisms disable each other.
Notes¶
- Environment Requirements: Node.js version must be >= 22.
- Dependencies:
cordis (^4.0.0-rc.8)and@deepseek-ai/dsh-system-promptare required aspeerDependencies. - Build Output: The build artifact
lib/client.jsmust be committed; it is not built automatically during installation. - License: MIT License, retaining upstream copyright.