DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

Finish Reason Patch — DeepSeek Harness 插件(DSH Plugin)
DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录
← Plugins
F

dsh-finish-reason-patch

Finish Reason Patch

容忍以无终止 finish_reason 结束的 OpenAI 兼容模型流,使 DSH 回合完成而不是中止。

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add github:Canson666/dsh-finish-reason-patch#c544c90c64b969e5ebdcad2e23d0e792e6542578
README兼容性版本

兼容性与来源证明

Finish Reason Patch 以 dsh-finish-reason-patch 发布,当前版本为 1.1.0。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
any
发布来源
github
Registry 更新时间
2026/8/20

版本

1.1.0stable
2026/8/20

相关插件

正在加载相关插件…

最新版
1.1.0
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
未提供
文件数
未提供
Surface
any
许可证
MIT
发布源
github
GitHub
★ 1
周下载
0
最近提交
2026/8/20
查看源码 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题

相关插件

继续浏览 models-usage 分类下经过校验的插件。

Usage@linxin666/dsh-usage用于 dsh Web GUI 的使用统计插件:检测各提供商的余额和编码计划配额,并提供实时令牌使用记录,同时在侧边栏条目中显示当前会话提供商今日的使用量Whale Widgetdsh-whale-widgetDSH Web 界面右下角的 DeepSeek 余额小鲸鱼挂件:余额/今日已用/峰谷定价、自定义泡泡点击序列(文本/余额/今日/峰谷/图片/随机语句与并列加权选择)、逐行样式与字体、悬浮快捷编辑、音效与每轮消耗、自定义角色/动图/音效、吸附与翻转自定义Usage Stats@ychris12138/dsh-usage-statsdsh Web GUI 的令牌使用热力图、提供商余额和订阅配额Codex Connectdsh-codex-connect用于 DeepSeek Harness 的 ChatGPT OAuth 和 Codex 模型。

README

dsh-finish-reason-patch

DSH plugin: stop agent turns from being aborted when an OpenAI-compatible provider (GPT-family models, gateways, proxies) ends a streaming response with full output but without a terminal finish_reason.

The bug it fixes

DSH routes OpenAI-compatible providers through @earendil-works/pi-ai. When the wire stream ends without ever seeing choices[].finish_reason, pi-ai raises Stream ended without finish_reason (openai-completions.js:438). By that point every content block is already closed and delivered — the response is complete, only the terminal marker is missing. pi-ai surfaces that as an error event, the dsh-llm-pi-ai adapter maps it to a terminal finish {kind:'error', code:'TRANSPORT'} chunk, and the agent loop (dsh-agent-loop) throws — aborting a perfectly good model turn. Other agents (e.g. Codex) tolerate the same wire behavior by treating end-of-stream as the end of the response.

The fix

The plugin hooks the llm/stream waterfall — every model call (agent turns, session-title requests, prepared calls, subagents) flows through it via LlmRuntime.streamWithRegistration. When the terminal finish is exactly that error, it is rewritten to a normal stop finish (or tool-calls if tool-call deltas were delivered), so the turn completes instead of aborting. This holds whether or not content was delivered: some OpenAI-compatible gateways stream only usage — or nothing — before ending without a finish_reason (reporting outputTokens: 0), and they are accepted as complete empty responses instead of retry-looping (Codex-style tolerance). All other error finishes (transport resets, rate limits, HTTP errors, ...) pass through untouched, so the existing retry policy still applies to genuinely broken responses.

When it fires you'll see: [finish-reason-patch] provider finished without finish_reason -> mapped to "stop"

Installation

The plugin is a plain Cordis host plugin (exports name / apply, no external dependencies beyond the ctx Cordis passes in).

1. As a persistent profile bundle (recommended, survives restarts)

Ship this folder as a package named dsh-finish-reason-patch:

  1. Place the package where your DSH profile can resolve it, e.g. a junction or symlink inside <profile root>/node_modules/dsh-finish-reason-patch pointing at this folder (same pattern as other local DSH plugins).
  2. In the profile root package.json, add the package to dsh.profile.bundles and to dependencies (e.g. "dsh-finish-reason-patch": "link:<absolute path to this folder>").
  3. Restart DSH — bundle patches compose at boot. The package's own cordis.patch.yml inserts the plugin row automatically.

2. As a dynamic Cordis plugin (current process only)

Define/run the plugin host body (plugin.mjs) through the Cordis dynamic plugin tools. It stays active until the process exits; re-run after a restart. Effects are identical and idempotent if both routes are active.

Verifying

  • Logic self-test (no network): node selftest.mjs — all 5 cases pass.
  • Live: run a normal conversation with a GPT-class model. Turns that used to abort now complete, and the log line above appears.

Removal

Remove the bundle entry + dependency from the profile package.json, delete the node_modules junction, restart DSH. No changes are made to any shipped DSH file.

Files

  • plugin.mjs — the plugin (llm/stream waterfall hook + rewrite logic)
  • cordis.patch.yml — bundle patch layer (the profile-tree insert row)
  • package.json — npm metadata (dsh.runtime: host, dsh.bundle.patch)
  • selftest.mjs — local logic self-test
  • LICENSE — MIT