DSH HUB
HomePlugin StorePlugin PacksCommunityRankingsResourcesPublish Guide
Plugin source
Back to catalog

hzh5021 /

hzh5021/dsh-progress

Verified

Reminds the agent to speak up when it runs several model steps without emitting any text, so long tool runs stop going silent.

★ 0 Stars0 Forks0 IssuesN/A Community rating0 Confirmed installs
View on GitHubProject homepage
READMESource: main@b2b9745e

dsh-progress

当 agent 连着几步模型输出里一个文字都没吐时,往会话里塞一条提醒,让长任务不要再闷头干。

它做什么

多数 agent 的使用约定里都写着「动手前说一句要干什么、每过一个阶段丢一句、出岔子当场说」。这条规矩靠自觉,而自觉在长任务里最先失效:连着十几分钟只调工具、一个字不说,用户在那一头看到的和「卡死了」没有区别。

这个插件把「憋住了」交给机器判。它只数一件事——模型输出里有没有真的出现文字。连着 silentSteps(默认 2)步没有文字,就往当前会话里注入一条提醒,让 agent 在下一个被接纳的 step 里看见:报进度、报判断、报卡在哪都行,一两行就够。

同一轮最多提醒 maxPerTurn(默认 1)次,不刷屏。它不评价内容好坏,只管「说没说」。

装

dsh plugin add hzh5021/dsh-progress

手工四步:

  1. 把包放进 ~/.dsh/plugins/dsh-progress/。
  2. profile 的 package.json 里 dependencies 加一条(本机口径:"dsh-progress": "file:../../plugins/dsh-progress"),并在 profile 的 node_modules/ 下留一个同名联接。
  3. 同一份 package.json 的 dsh.profile.bundles 里加上 "dsh-progress"。
  4. 重启 DSH。

插件行由本包自己的 cordis.patch.yml 插进 profile 花名册;profile 的 cordis.yml 是生成物,不要手改。

配置

键 默认 说明
enabled true false 时整个插件不挂任何监听
silentSteps 2 连着几步没有 text 就提醒(1–50,越界取边界)
maxPerTurn 1 每轮最多提醒几次(0–20;0 = 只盯着不出声)
probeFile "" 调试用:非空就往这个文件追加诊断行,最多 400 行;默认关,不写盘

在 profile 的插件行 config: 下覆盖:

- id: progress
  name: dsh-progress
  config:
    silentSteps: 3
    maxPerTurn: 2

怎么工作

只增量消费 session/event,不轮询、不重扫事件日志;另挂 agent/created、agent/session-start、agent/disposed 认人。

事件 动作
assistant/message 里有非空 text 沉默计数归零、工具计数归零
assistant/message 里没有 text 沉默计数 +1
tool/call 工具计数 +1
turn/start / turn/end 两个计数与本轮提醒额度一起归零

判据只认 text block。reasoning(心里的盘算)和 tool-call 都不算说话——这正是要治的毛病:模型可以在推理里转几十圈,对用户一个字符不说。结构认不出(字段变了)时当作说过话:宁可漏报,不可误报。

提醒通过 agent.inject() 注入,消息的 source 是 { kind: "plugin:dsh-progress", form: "instructions" },别的插件和日志认得出这条是谁塞的。同一个 session 用 WeakMap 记账,session 一没记录就跟着掉。

两处踩过的坑,留给改这块的人:

  • session/event 由 session 自己的 emitCtx 派发,挂在 agent.ctx 上收不到。第一版那么挂,一个事件都没进来;现在挂在插件自己的 ctx 上,按 session 过滤。
  • 第一版装上去「什么都没发生」,而日志又找不到落在哪,于是留了 probeFile 这个可选探针:一眼看出插件跑没跑、数到第几步。

subagent 会话不管(那是临时会话)。任何异常都吞掉并记日志:提醒失败绝不能打断正在跑的轮次。

边界

  • 只管「不说话」,不管「一个工具跑了十分钟没结果」。
  • 判不出「说了话,但通篇是交作业」。
  • 只认 text block;宿主若改了内容块结构,它会退化成「当说过话」——不报错,也不再提醒。
  • 不引入任何外部依赖,只用 Node 内置模块(node:fs)。

冒烟测试

node test/smoke.mjs

不启动 DSH,用假的 ctx / agent 跑整条链路:判据(text / reasoning / tool-call / 结构不明)、计数(阈值、归零、一轮上限、坏配置兜底)、链路(挂得上、注得进、source.kind 认得出、resume 接得住)、边界(subagent 不管、enabled:false 什么都不挂、探针按需写)、纪律(源码零外部依赖、manifest 里的 exports 都指得到实处)。

English

What it does — Injects one short reminder into the session when the agent goes several consecutive model steps (default 2) without emitting any text block, so long tool runs stop going silent. At most maxPerTurn (default 1) reminders per turn; subagent sessions are ignored. Only text content blocks count as speaking — reasoning and tool-call do not.

Install — dsh plugin add hzh5021/dsh-progress, or drop the package into ~/.dsh/plugins/dsh-progress/, register it in the profile package.json (dependencies + dsh.profile.bundles) and restart DSH.

Config — enabled (true), silentSteps (2), maxPerTurn (1), probeFile ("").

Requirements — DSH; Node 18+; no external dependencies.

License — MIT.

MIT 许可。

—/ 5

No ratings yet

Verified DSH bundle

Commit b2b9745e35a8

Community comments

No comments yet. Be the first to write one.

DSH HUB

A community index for DSH plugins. Not an official GitHub or DeepSeek AI product.

CommunityResourcesAPIAbout