lamost423/dsh-todo-freshness-guard ↗★ 1
dsh-todo-freshness-guard
Remind and block stale tool work until todo_write is reconciled in DeepSeek Harness
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:lamost423/dsh-todo-freshness-guard说明文档
阅读完整 README ↗DSH Todo Freshness Guard|DSH 待办新鲜度守卫
English | 简体中文
**解决的问题:**Agent 在长任务中可能持续调用工具,却不更新未完成的 todo_write 列表,导致用户看到的计划与真实执行状态脱节。
**最痛的问题:**Agent 明明还在运行,用户看到的却是过期状态——已完成事项仍显示未完成,新阻塞没有记录,下一步也无法判断。任务越长,进度越不可信。
**如何解决:**这是一个仓库外的 DeepSeek Harness Guard。它先提醒模型重新同步完整 Todo 列表;列表继续过期时,再阻止普通工具调用。todo_write 与外层 run_code 恢复通道始终可用。
Problem it solves: During long agent turns, the model may keep calling tools without updating its unfinished todo_write list. The visible plan then stops matching the work actually being done.
Most painful failure: The agent is still active, but the user is looking at stale status—completed work still appears pending, new blockers are missing, and the next step is unclear. This removes progress visibility exactly when a long task needs it most.
行为
一次成功的 todo_write 包含未完成事项后,Guard 会按 Session 统计非记账类工具调用:
- 达到
reminderAfterCalls时,向模型注入一次提醒,要求重新同步完整 Todo 列表。 - 超过
blockAfterCalls后,拒绝普通工具,直到新的完整todo_write替换旧列表。 - 原生调用与 Code Mode SDK 子调用共用计数器。
todo_write始终可用。- 外层
run_code始终可用,保证 Code Mode 能调用todo_write。 - Todo 列表为空或全部完成时,约束自动关闭。
本插件修复的是 todo_write 状态长期不更新的问题,不会替换或修改文件系统 Write 工具。
兼容范围
- DeepSeek Harness:
0.1.0-rc.6 - Node.js:
^22.19.0 || >=24.0.0 - 当前状态:社区预览版
安装
先安装兼容版本的 DSH CLI,再把 Release 压缩包添加到需要启用 Guard 的 Profile:
npm install --global @deepseek-ai/dsh@0.1.0-rc.6
dsh plugin --profile web add https://github.com/lamost423/dsh-todo-freshness-guard/releases/download/v0.1.1/dsh-todo-freshness-guard-0.1.1.tgz
dsh web
也可以从工作副本安装:
git clone https://github.com/lamost423/dsh-todo-freshness-guard.git
cd dsh-todo-freshness-guard
corepack enable
pnpm install --frozen-lockfile
pnpm build
dsh plugin --profile web add .
dsh web
插件默认贡献以下 Patch:
- insert:
- id: todo-freshness-guard
name: dsh-todo-freshness-guard
config:
reminderAfterCalls: 5
blockAfterCalls: 8