npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-loop-recover

v0.3.6

Published

Dead-loop rescue for DeepSeek Harness: detects model repetition mid-stream, prunes the loop from the committed message, and resumes the task automatically.

Readme


做什么

本地小模型(Ornith,部分版本 qwen 等)容易陷入两类死循环:字面刷屏(ssssss...)和语义复读(反复论证同一段话)。普通循环守卫只会"切断+终止",任务直接死掉。

dsh-loop-recover 是完整的救援链:

  • 检测 —— 五层检测器:周期扫描 / n-gram / 锚段 / 单字符刷屏 / 短句池 + 意图级工具查询跟踪
  • 剪枝 —— 流内切掉重复后缀,留一行标记让模型知道这里删过东西
  • 压缩 —— 被污染的上下文换成检查点摘要(v4 compaction/* 事务),模型没法再回放同样的推理
  • 续跑 —— 自动 followup 原任务,换采样参数——不开新会话,不重启

全在同一个 agent 循环里完成,救援后模型继续干活。

安装

GUI(推荐)

打开 插件 → 添加插件,搜 dsh-loop-recover,点安装。

命令行

dsh plugin --profile desktop add dsh-loop-recover
# 然后重启 app

配置

32 个配置项全部在插件页可视化编辑——不用手写 YAML。分组:基本 / 救援 / 续跑参数 / 意图检测 / 检测阈值 / 检测器(高级折叠)。

| 分组 | 关键字段 | |---|---| | 基本 | mode(rescue/cut/observe)、watch、language、keepLanguage、marker、debugLog | | 救援 | maxConsecutiveRescues(连续救援上限)、compactOnRescue(续跑前压缩)、stallCalls(空转提示) | | 续跑 | retryTemperature、retryReasoningEffort、retryRequests | | 意图 | intentEnabled、intentNoveltyThreshold、intentConfirmCount |

模式:rescue(剪+压+续,默认)、cut(只剪不续)、observe(只记日志零干预——先用它评估阈值再上救援)。

冲突说明

不同插件解决不同问题——不要叠装:

| 插件 | 做什么 | 冲突原因 | |---|---|---| | dsh-agent-loop-guard | 检测循环即切断 | 同包装 llm/stream → 双重截断、状态错乱 | | dsh-client-auto-continue | 中断后自动续跑 | 重复唤醒 → 两条冲突的续跑指令 | | dsh-session-shift | 上下文压力压缩→新会话 | 职责重叠 → 一边压缩一边开新会话 |

用本插件时请禁用它们。

工作原理

llm/stream(仅 agent 调用)
  ↓ StreamLoopDetector 监控 reasoning & text 块
命中循环 → 剪除重复后缀 → 重写 block-end → finish: stop
  ↓ commitLoopCompaction——v4 事务,旧上下文换检查点
  ↓ followup()——续跑原任务,换采样参数

非 agent 请求(标题/摘要生成)原样透传不干预。

开发

npm test        # 66 个单元+集成测试
npm run check   # 插件加载冒烟

协议

MIT · NOTICE 上游署名(改自 dsh-compaction 辅助代码)。