deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:bitterSmilezzz/dsh-model-fix
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
修复特定模型在 DeepSeek Harness(DSH)里「流式内容正常但回合必报错」的流式收尾缺陷。
opencode 聚合端点(https://opencode.ai/zen/go/v1)上的 muse-spark-1.2 实现有缺陷:
流式响应正常吐出内容,但从不发送 finish_reason、也不发送 [DONE],流直接关闭
(同端点对照 deepseek-v4-flash / glm-5.2 均正常发送 finish_reason: 'stop' + [DONE])。
DSH 的 llm-pi-ai 走 pi-ai SDK(强制 stream: true 且要求流以 finish_reason 收尾),
于是每次对话的真实表现是:
Stream ended without finish_reason(映射为 TRANSPORT 错误);TRANSPORT 在默认可重试列表里 → agent 级重试插件按
maxRetries(opencode-go3 配置了 10 次)反复重跑整步,烧多份 token。这与代理无关:直连与走代理的响应完全相同,换代理解决不了。
使用 muse-spark-1.2(经 opencode-go 路由)不需要在 opencode 平台设置里开启 「Allow models that train on request data」。
https://opencode.ai/zen/go/v1 的 muse-spark-1.2 即可正常
返回内容(本插件修复的只是流式收尾缺陷,与训练授权无关);开关位置见下图(opencode 设置页 → 提供商区域,与「启用部署在中国的模型」相邻):

在 llm/stream waterfall 上,对匹配的模型把上述缺陷收尾为正常 stop:
text-delta / reasoning-delta / tool-call-delta)且
结尾错误代码为 TRANSPORT / STREAM_CLOSED 且错误信息明确是「缺少终止事件」
(如 Stream ended without finish_reason)时才改写;SocketError: other side closed)不受影响,照常失败;修复后 muse-spark-1.2 直连即可正常使用,无需代理、不触发重试。
# 本地路径
dsh plugin --profile web add /path/to/dsh-model-fix
# 或发布后从 GitHub / npm
# dsh plugin --profile web add github:bitterSmilezzz/dsh-model-fix
# dsh plugin --profile web add dsh-model-fix
安装后重启目标 profile(如 dsh web)生效。
cordis.patch.yml 中 config 两个字段:
| 字段 | 默认 | 说明 |
|---|---|---|
modelPattern |
^muse-spark |
对模型 id 测试的正则;只修复匹配的模型 |
providers |
[] |
provider 路由键白名单(如 opencode-go3);空 = 所有 provider 中匹配的模型 |
- id: model-fix
name: dsh-model-fix
config:
modelPattern: '^muse-spark'
providers: []
pnpm install
pnpm verify # typecheck + build + node --test
tests/fix.test.mjs 覆盖缺陷识别、内容保留、空响应放行、真实故障放行等 10 例。error(Stream ended without finish_reason) 变为 {"kind":"stop"}。CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。