DSH HUB
首页插件商店插件包社区排行榜资源发布指南
插件源码
返回插件目录

r-ayin /

r-ayin/dsh-stream-index-guard

已验证

Patches the LLM assistant-stream accumulator at runtime to clamp invalid chunk indices, downgrading hard stream failures to dropped or merged chunks; ships a stats tool.

★ 0 Stars0 Forks0 IssuesN/A 社区评分0 已确认安装
查看 GitHub项目主页
README来源: main@188458cc

dsh-stream-index-guard

Runtime guard for the DSH LLM assistant stream.

Some upstream LLM relays occasionally emit text-delta / reasoning-delta / tool-call-delta chunks with an invalid index. Left alone, one bad chunk hard-fails the whole turn (stuck session, truncated output).

This plugin patches AssistantStreamAccumulator.push at runtime and clamps an illegal index to the last valid index (or 0), downgrading the hard failure into dropping/merging the bad chunk. It ships a stats tool and on-disk state.

How it works

  • On apply it discovers the host's @deepseek-ai/dsh-llm module files (derived from the host entry script path, so it patches the exact loaded instances), and is idempotent via Symbol.for('dsh-stream-index-guard').
  • Override discovery with DSH_STREAM_GUARD_TARGETS — comma-separated file:// URLs of the dsh-llm modules to patch.
  • Registers the stream_index_guard_stats tool (patch targets, clamped-chunk count, samples).
  • Writes stats to /tmp/dsh-stream-index-guard/stats.json.

Build

bash scripts/build.sh   # or: npm run build (tsc)

Install

Install it from the DSH Plugin Market (Settings → Plugin Market), or add it to your profile bundle stack manually — see cordis.patch.yml.

License

MIT

—/ 5

暂无评分

已验证 DSH bundle

Commit 188458cc59c5

社区评论

还没有评论,来写第一条。

DSH HUB

社区维护的 DSH 插件索引。不是 GitHub 或 DeepSeek AI 的官方产品。

社区资源API关于