yingjian666/dsh-zh-thinking

DeepSeek Harness (dsh) 插件:注入系统提示词,强制 Agent 的思维链 / 规划 / 工具推理全程使用简体中文,防止中文思考漂移为英文。零外部依赖,任意本地目录 link 即装。

Project Overview项目介绍

dsh-zh-thinking is a host plugin built specifically for DeepSeek Harness (DSH), and its sole target is the DSH runtime — it has no other agent integrations, no Claude Code, Cursor, or Codex support, and exists only to influence DSH's prompt assembly. Its core capability is registering a "think in Simplified Chinese" rule into the system prompt via ctx.systemPrompt.section({ name: 'language:zh-thinking', order: 20, text }), which is evaluated on every assemble() call and placed after the persona section; the plugin depends only on cordis-injected services (ctx.systemPrompt, ctx.logger, ctx.effect) and tears the section down on dispose. Installation on DSH Desktop 4.1+ goes through Settings → Plugins → Install from other sources with the spec github:yingjian666/dsh-zh-thinking plus the "advanced external source" checkbox, or via a downloaded .tgz; other profiles use dsh plugin --profile <name> add github:yingjian666/dsh-zh-thinking, and a full restart is required because host plugins mount at startup.

Typical workflow: a user running DeepSeek's reasoning models through DSH for multi-step tasks such as web scraping, code debugging, or document analysis finds that English tool output causes language drift in the chain-of-thought, and installs this plugin to keep internal reasoning in Simplified Chinese while letting the model decide the final answer's language on its own (so English identifiers, error messages, and code snippets can still appear verbatim). It is also aimed at developers who want a minimal, audit-friendly plugin with no third-party imports and no need to publish to npm. Verification is done by opening a standard-mode session and checking that thought blocks remain in Chinese; under two-stage anchoring presets like "Liangshen Mode", the first anchoring round filters the section out, but it reappears after promotion — that is preset behavior, not a plugin bug.

Dependencies and limits: the plugin has zero third-party imports to dodge the fatal plugin-tree load failure that hits when a locally linked plugin cannot resolve packages like schemastery, and peerDependencies for @deepseek-ai/cordis and @deepseek-ai/dsh-system-prompt are marked optional because DSH Desktop 4.1's compatibility diagnostic resolves them against the application's own module anchors; compatibility evidence is instead supplied by dsh.compatibility.runtime: ">=0.1.1-rc.1 <0.2.0", tested on 0.1.6-alpha.1. Behavior is fixed and zero-config — enabled and forceOutputZh switches exist in code but have no schema or GUI panel. The repo ships node test/kernel-smoke.mjs which loads real cordis + system-prompt from a DSH node_modules path and asserts the section appears in assemble(). License is MIT; the author flags the project as a personal learning attempt with no commitment to ongoing maintenance, and encourages forking lib/index.js if future DSH kernel changes break the section contract.

dsh-zh-thinking 是一个面向 DeepSeek Harness(DSH)的宿主插件(host plugin),核心能力是向系统提示词注入「必须用简体中文思考」的规则,强制 Agent 的思维链、规划、工具调用前后推理与自我审查始终使用简体中文,从而抑制英文工具回包导致的语言漂移。它通过 ctx.systemPrompt.section({ name, order, text }) 注册段,注入位置固定在 persona 段之后,并通过 cordis 生命周期在卸载时自动清理。该插件以 DSH 为唯一目标平台,安装方式为 Desktop 4.1+ 的「从其他来源安装」通道填 github:yingjian666/dsh-zh-thinking 并勾选高级来源选项,或下载 .tgz 离线安装,其他 profile 可用 dsh plugin ... add CLI。

典型使用场景是调用 DeepSeek 推理模型进行多步任务、网页抓取或代码调试的用户:当工具回包含英文时希望思考过程保持中文,便于审阅、调试与团队知识沉淀;同时适合不想发布 npm、也不希望引入额外依赖的极简主义者。安装完成后需重启 DSH,并以普通「标准模式」会话验证思考块是否全程简体中文;在「梁神模式」等两阶段锚定 preset 下,首轮锚定阶段会过滤掉该段,晋升后自动恢复。

依赖方面,插件自身零第三方依赖,仅依赖 cordis 运行时注入的 ctx,规避了本地目录挂载时 schemastery 等包无法解析导致的整棵插件树加载失败;peerDependencies 中的 cordis 与 system-prompt 标为 optional,由 dsh.compatibility.runtime (>=0.1.1-rc.1 <0.2.0) 提供兼容性证据,已在 DSH Desktop 4.1(0.1.6-alpha.1)实测通过。当前为固定行为、零配置,不支持 GUI 修改;仓库自带 node test/kernel-smoke.mjs 冒烟测试,可指向真实 DSH node_modules 验证 language:zh-thinking 段是否进入 assemble()。许可证为 MIT,作者声明为个人学习性质尝试、不承诺持续维护,DSH 升级后建议自行 fork 修改 lib/index.js。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 6 stars - very few users, little community feedback星标只有 6,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:yingjian666/dsh-zh-thinking

把 yingjian666/dsh-zh-thinking 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-zh-thinking

⭐ 如果这个插件帮到了你,欢迎点个 Star 支持一下 —— 一个星标就是对作者最直接的鼓励。

项目状态:这是一次个人学习性质的尝试,作者不承诺持续维护。 如果将来 DSH 内核升级导致它失效,欢迎自行 fork 修改—— 逻辑只有一个文件 lib/index.js,做的事就是往系统提示词里注册一段「用简体中文思考」的要求。

📝 历次「内核升级导致失效」的原因与修法都记在 CHANGELOG.md, 包括 0.2.0 那次被静默禁用的完整分析 —— 如果你的插件也遇到同样症状,可以直接对照。

让 DeepSeek Harness 里 Agent 的内部思考过程——思维链(chain-of-thought)、逐步规划、工具调用前后的推理、自我审查——始终使用简体中文的宿主插件(host plugin)。

声明:本项目参考 / 灵感来自 wodongx123/dsh-language-control(其 npm 包为 @deepseek-ai/dsh-language-control),在其「让 Agent 用中文思考」的思路基础上独立重写,并解决了本地目录挂载时的依赖加载问题。两者的关系与差异见下文「与原插件的关系」。


快速安装(DSH Desktop 4.1+)

设置 → 插件 → 从其他来源安装:

字段 填什么
插件来源 github:yingjian666/dsh-zh-thinking
高级选项 ✅ 勾选「这是来自本地、Git 或其他外部来源的高级插件」

确认该来源为全权访问 → 安装 → 重启 DSH。

不需要 npm 账号,也不需要手工建目录链接。

连不上 GitHub?直接下载打包好的 .tgz 再填文件路径即可(同样要勾选那个复选框)。细节见安装。

为什么会有这个插件

DeepSeek 这类推理模型,其「思考」由同一份系统提示词(system prompt)驱动。当工具返回英文内容(例如网页抓取、文档、报错信息)时,Agent 的思维链容易发生语言漂移(language drift)——思考逐步切到英文,导致后续推理与最终回答的语言不稳定。

本插件在启动时向系统提示词注册一段「必须用简体中文思考」的规则,让模型的内部思考保持中文,而最终回答是否默认中文则交给模型自身判断(可保留英文专有名词、代码标识符等)。

与原插件的关系

维度 原插件 @deepseek-ai/dsh-language-control 本插件 dsh-zh-thinking
注入机制 systemPrompt.section(),order -200(最顶部) systemPrompt.section(),order 20(persona 之后)
外部依赖 有 peer 依赖(@deepseek-ai/cordis、@deepseek-ai/dsh-host-webserver) 零外部依赖,只依赖 cordis 运行时注入的 ctx
设置面板 有(HTTP 路由 + 客户端注入可视化面板) 无(极简,见配置)
安装方式 必须经 npm(dsh plugin add @deepseek-ai/dsh-language-control) GitHub / 本地目录 / .tgz 均可,无需发布 npm

相对原插件主要优化 / 解决的问题:

  1. 零外部依赖,规避「本地目录挂载崩溃」。当插件通过 link: 从 profile / app 的 node_modules 树之外的目录挂载时,Node 无法解析插件自身 import 的 npm 包(如 schemastery),会导致整棵插件树加载失败(fatal plugin-tree load failure)。本插件不 import 任何第三方包,只使用宿主运行时提供的服务,因此从任意路径挂载都能正常加载。
  2. 不依赖 npm 发布。原插件必须先从 npm 安装(且易因包名带不带 @deepseek-ai/ scope 而装错);本插件 git clone 后即可本地挂载,或直接从 GitHub 安装。
  3. 极简、易读易审。单文件、几十行代码,无 HTTP 路由、无客户端面板,行为一目了然。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-lark-bridge 下一个 Next dsh-compressor →