DSH Plugins
返回列表
🤖

dsh-model-fix

模型推理 更新于 2026.09.05

在终端中运行以下命令:

dsh plugin install Retr67/dsh-model-fix

将以下提示词粘贴到 DeepSeek Harness 对话框中:

在 DeepSeek Harness 中运行 dsh plugin install Retr67/dsh-model-fix 即可安装该插件,源码位于 https://github.com/Retr67/dsh-model-fix。

插件介绍

The opencode aggregate endpoints for muse-spark-1.2 and gpt-5.6-luna carry a subtle stream-termination defect: content flows through perfectly, yet neither finish_reason nor the [DONE] sentinel is ever emitted before the stream closes. Because DSH's pi-ai SDK mandates a finish_reason at stream end, every turn surfaces a Stream ended without finish_reason error (mapped to TRANSPORT). That error sits in the default retry list, so the agent-level retry loop re-executes the entire step up to maxRetries times, burning extra tokens on every single turn. No proxy swap or reconnection tweak helps — the root cause is on the model endpoint side, and direct vs. proxied responses are identical.

dsh-model-fix inserts a precise stream-termination patch into DSH's llm/stream waterfall. It fires only when the stream has already produced content (text-delta, reasoning-delta, or tool-call-delta), the closing error code is TRANSPORT or STREAM_CLOSED, and the message explicitly points to a missing terminal event — in that case the defective ending is rewritten to a clean stop. Real transport failures (e.g., SocketError: other side closed) are left untouched and still fail as expected; empty zero-content responses are not swallowed either. Two configuration knobs in cordis.patch.yml — a modelPattern regex and an optional providers whitelist — let you scope the fix to exact model IDs and routing keys so no other models are affected.

This plugin is aimed at developers who route muse-spark or gpt-5.6-luna through opencode-go in DSH and hit the recurring content-fine-but-turn-fails symptom. After installing, just restart the target profile and the spurious TRANSPORT errors and wasted retries go away. No data-training opt-in on the opencode platform is required, and no proxy is needed.

使用场景

  • 在 DSH 中调用 muse-spark 或 gpt-5.6-luna 时反复遇到 Stream ended without finish_reason 报错
  • 内容正常显示但回合被判失败,触发 TRANSPORT 重试循环浪费 token
  • 需要直连 opencode-go 路由使用特定模型且不希望开启数据训练授权

适合人员

  • 通过 opencode-go 在 DSH 中调用 muse-spark 或 gpt-5.6-luna 的开发者
  • 遇到 TRANSPORT 误报导致 agent 级重试循环的 DeepSeek Harness 用户
  • 希望不依赖代理、不修改上游端点即可修复流式收尾问题的技术栈使用者