sulfide2085/dsh-llm-wechat
DeepSeek Harness 微信网关适配插件:复用 DeepSeekAdapter + 流式 think 标签转译
Project Overview项目介绍
This is a native plugin built exclusively for DeepSeek Harness (DSH) that enables DSH to use the Deepseek-v4-flash model provided by WeChat Mini Program Coding Plan via the chatapi.weixin.qq.com gateway as an official DeepSeek model. It reuses the core DeepSeekAdapter from the official dsh-llm-deepseek package, only adding a streaming translation layer on the response side to handle WeChat's non-standard response formatting quirks. It does not require any modifications to the core DSH or pi-ai source code to work correctly on your local instance.
Installation can be done via the official DSH plugin command, which automatically adds the package to your DSH profile and applies the required cordis patch without any manual file edits. After installation, you need to add your WeChat API token to your DSH credentials file, then configure optional settings like default reasoning effort and max tokens in your DSH settings YAML file. Once configured, the WeChat DeepSeek V4 Flash model will appear in DSH's model selector with a pre-configured dropdown for reasoning effort levels, ready to use immediately after a DSH restart.
There are several important known limitations that users should be aware of before installing and using this plugin. WeChat's gateway has inherent constraints that the plugin cannot resolve, including a 60-second hard request timeout, a quota of roughly 1200 requests every 5 hours, and a maximum concurrency limit of only 6 concurrent requests. The plugin itself also requires note that it copies private code from the official adapter, so major DSH version upgrades may break compatibility until the plugin code is manually re-aligned with upstream changes.
这是一个专为DeepSeek Harness(DSH)开发的原生适配插件,功能是让DSH可以将微信小程序「Coding Plan」提供的Deepseek-v4-flash模型(通过chatapi.weixin.qq.com网关)当作官方DeepSeek模型使用。它复用了官方dsh-llm-deepseek的核心适配器,仅在响应侧增加流式转译层处理微信网关的返回格式差异,无需修改任何DSH或pi-ai的原生源码。
适合需要使用微信提供的免费DeepSeek V4 Flash API的DSH用户。安装完成后,用户需要在DSH的凭证配置文件中存入微信API令牌,之后就能在DSH的模型选择器中看到「WeChat → Deepseek-V4-Flash」选项,还可以自由选择推理等级(off/high/max三档)。如果用户之前手动配置过微信通道,必须删除旧配置才能避免适配器冲突。
插件存在一些已知限制,包括微信网关本身有60秒请求超时、每5小时约1200次请求配额、并发上限为6,这些都是微信侧固有问题插件无法解决。插件自身也需要注意,DSH大版本升级后可能需要重新对齐官方适配器代码,当前暂未发布到npm,可通过本地链接方式完成安装。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-llm-wechat(sulfide2085/dsh-llm-wechat)
仓库:https://github.com/sulfide2085/dsh-llm-wechat
本站详情页:https://www.yhbd.top/plugins/sulfide2085-dsh-llm-wechat/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证未声明 · ⭐ 5 · 最近提交 2026-08-16 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
- Only 5 stars - very few users, little community feedback星标只有 5,几乎没人在用,遇到问题缺少社区反馈
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 @deepseek-ai/dsh-llm-wechat
把 sulfide2085/dsh-llm-wechat 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
@deepseek-ai/dsh-llm-wechat
中文 | English
独立公开仓库:本插件从项目内独立维护,源码位于
dsh-llm-wechat仓库。
DeepSeek Harness 的微信网关适配插件:让 DSH 把微信小程序「Coding Plan」的 Deepseek-v4-flash(chatapi.weixin.qq.com)当作官方 DeepSeek 使用——思考进思考块、工具调用正常、正文无标签。
复用官方 dsh-llm-deepseek 的 DeepSeekAdapter(请求序列化、错误映射、模型解析、重试策略全部继承),只在响应侧加了一层流式转译。不修改任何 DSH / pi-ai 源码。
为什么需要这个插件
微信网关的返回有三个官方 DeepSeek 没有的怪癖,DSH 原生解析器无法处理:
| 微信的怪癖 | 插件处理 |
|---|---|
思考内容不放 reasoning_content,而是连同 </think> 标签整个塞进 content |
流式拦截器把 </think> 之前的文本剥离并重排进 reasoning_content,正文只留纯净答案 |
工具调用流式 delta 的后续片段显式发 id: null / name: null,覆盖首个 delta 的正确值 |
只接受非空字符串更新 id/name |
DSH 的工具结果以 tool-result 块存放,序列化时需展开为 role: tool 消息 |
对齐官方完整版(含 (no output) 兜底) |
工作原理
微信流: "We need answer... final. </think>141.3717" (思考+标签全在 content)
│
▼ WechatAdapter.request(拦截器:parseSse 与 translate 之间)
DSH 流: reasoning_content: "We need answer... final."
content: "141.3717" (标准格式,DSH 上层无感)
- 请求侧:微信端点协议与官方 DeepSeek 完全一致(OpenAI 兼容),原样透传,仅映射思考档位
off/high/max→thinking: {type}+reasoning_effort。 - 响应侧:
translate前插入ThinkTagSplitter状态机(处理标签跨 chunk 被切开、思考含尖括号、思考未闭合兜底等边界)。 - system 增强:微信模型对"工具只能通过 run_code 调用"的遵循较弱,插件在 system 末尾追加一段强约束(仅 wechat 通道生效)。
安装
方式一:dsh plugin(推荐,官方规范)
# 在包含 dsh-llm-wechat 目录的位置执行
dsh plugin --profile web add ./dsh-llm-wechat
dsh plugin add 会把包以 link: 方式装进 profile,并把 dsh.bundle 声明的 patch 层(cordis.patch.yml)追加到 dsh.profile.bundles——无需手动改任何文件。
发布到 npm 后(待发布):
dsh plugin --profile web add @deepseek-ai/dsh-llm-wechat
方式二:手动
- 把包复制到 DSH 安装树的
node_modules/@deepseek-ai/dsh-llm-wechat; - 在
$DSH_HOME/profiles/web/package.json的dependencies加"@deepseek-ai/dsh-llm-wechat": "link:<绝对路径>",跑pnpm install(生成 lock); - 在
$DSH_HOME/profiles/web/cordis.patch.yml加:
- insert:
- id: llm-wechat
name: '@deepseek-ai/dsh-llm-wechat'
配置 credentials
在 $DSH_HOME/.credentials.yaml 存微信 Token(也可以在启动环境导出 WECHAT_API_KEY):
WECHAT_API_KEY: <微信 Coding Plan 的 API Token>
配置(settings.yaml)
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
xmanrui/dsh-im
tencent-connect/dsh-qqbot
flymysql/dsh-remote
whiteguo233/dsh-openbiliclaw
omdsh-dev/dsh-lark
hanshanyike/dsh-yolo
THEWOLFWALKER/dsh-notifier