Task control for DeepSeek Harness: one-click emergency stop and force-termination of stuck downloads and tool calls, download progress, stuck detection, pwsh activity monitoring, and append-condition / pause / resume with invisible recovery.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-task-control
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:ningmengxr/dsh-task-control
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
DeepSeek Harness 插件:pip / GitHub 下载卡到怀疑人生?网络超时停不下来?一键急停 + 下载进度检测 + 卡死识别 + 隐形追加条件。
在国内网络环境下,从 pip / GitHub 下载大文件(torch、ffmpeg、插件包…)卡顿、超时是家常便饭。DSH 原生的「停止」和任务暂停会被排在卡住的下载命令后面无法生效——任务既下不完、也停不掉。这个插件补上了缺口:
| 按钮 | 作用 |
|---|---|
| 🔴 急停 | 一键强制终止当前任务(杀进程 + 停止会话),下载/安装卡住时随时可停,带防误触确认(勾选"了解丢失进度"才能点确认) |
| 拍一下deepseek(检测) | 一键检查任务状态:出错 / 疑似卡死(工具调用超 10 分钟未返回)/ 运行中 / 健康 |
| 追加条件 | 任务运行中追加补充条件(先中止 → 弹窗输入 → 带条件隐形重跑) |
✨ 核心亮点
1. 下载卡死「急停」—— 为国内网络环境而生
- pip(
pip install torch等 2.5GB 大包)、GitHub(大文件下载)、curl 下载卡住/超时时,原生的停止按钮和暂停都被排在卡住的工具返回值后面,毫无反应; - 点「急停」→ 宿主直接按命令特征找到并杀掉卡住的下载进程 → 任务立即停止,换源重来;
- 防误触:先弹警告"急停会导致下载任务丢失,重新启动后需要全部重新下载",勾选后才能点确认。
2. 下载中检测—— 不再"疑似卡死"误报
- 检测到正在执行下载/安装命令时,无论是否超时都先查实际状态:
- curl 类(有输出文件)→ 显示真实进度百分比(如
正在下载 ffmpeg-release-essentials.zip,进度 42%); - pip 类(无输出文件)→ 明确提示"正在下载,无法计算进度,请耐心等待",绝不显示误导性的假进度;
- 下载进程已退出 → 提示"下载出现异常中断" + 可强制终止。
- curl 类(有输出文件)→ 显示真实进度百分比(如
3. 卡死识别 + 强制终止
- 非下载类工具调用超过 10 分钟未返回 → 提示"疑似卡死:工具 X 已运行 N分N秒";
- 检测弹窗内可直接强制终止(杀进程,
session.cancel对此无能为力)。
4. 隐形追加条件(无用户气泡)
- 「追加条件」的恢复/条件消息经宿主通道以插件来源消息注入会话:模型照常执行,但聊天界面只显示一条低调的上下文提示行——没有"继续"、没有"补充条件…"气泡,体验干净利落。
安装
lib/已包含构建产物(lib/index.js宿主半 +lib/client.js客户端 bundle)。将插件包放入 DSH 的 profile node_modules:- 直接拷贝到
~/.dsh/profiles/node_modules/dsh-task-control/,或 - 建立 junction 链接到本目录(本地开发常用)。
- 直接拷贝到
在
~/.dsh/profiles/web/cordis.patch.yml中插入插件条目:- insert: - id: task-control name: 'dsh-task-control'重启 DSH web,硬刷新(Ctrl+Shift+R)页面。
宿主半挂载
/dsh-task-control/resume、/dsh-task-control/kill、/dsh-task-control/download-status三条路由(loopback Host 校验),浏览器端同源 fetch 调用;客户端 bundle 按window.__ModuleLoader__契约加载。
自定义文案
设置 → 通用设置 → 任务控制(6 项):
- 急停按钮文案(默认
急停) - 检测按钮文案(默认
拍一下deepseek) - 追加条件按钮文案(默认
追加条件) - 检测·无异常输出(默认
任务正常,无异常) - 检测·出错输出(默认
任务出错:{error},{error}会替换为错误信息) - 检测·运行中输出(默认
任务正在运行中,暂未出错)
🔐 权限与已知风险 / Permissions & risks
本插件属于高能力插件(会执行命令、读写文件、发起网络请求),请知悉后再安装。完整披露见 SECURITY.md。
| 权限 | 用在哪里 | 边界 |
|---|---|---|
| 命令执行 | 急停/强制终止:按命令行特征结束卡死的下载/安装进程(Windows taskkill,POSIX kill) |
只针对运行中且命令行匹配的调用;匹配不到时仅发送会话取消(等于内置"停止"),不盲目杀进程 |
| 文件读写 | ① 只读下载输出文件的大小/时间以显示真实进度;② 自动更新时替换插件自身的 lib/;③ 文案设置存浏览器 localStorage |
只读业务文件;写入仅限插件自身目录与浏览器本地 |
| 网络访问 | ① 宿主路由 /dsh-task-control/*(仅 loopback);② 自动更新查询 npm registry |
不做公网暴露;无遥测、无数据上报 |
| 凭据 | 不使用 | 不读取/不存储/不外传任何 token、密码、Cookie 或密钥 |
已知风险与失败边界
- 急停会终止当前任务:未完成的下载/安装需要重新开始(按钮带二次确认防误触)。
- 需要宿主
webServer/agents服务:不可用时自动降级为"可见消息"恢复,不影响 DSH 本体。 - 自动更新会替换插件自身
lib/(下次启动生效);开发模式(junction/symlink 安装)自动跳过。
构建
node build.mjs
生成 lib/index.js(宿主半,ESM、零外部依赖)与 lib/client.js(客户端 bundle,__ModuleLoader__ 契约、外部模块走 require())。
目录结构
├── src/
│ ├── index.ts # 宿主半:resume / kill(急停杀进程)/ download-status(下载进度)路由
│ └── client/
│ ├── index.ts # 客户端插件入口(插槽注册)
│ ├── buttons.tsx # 急停 / 检测 / 追加条件按钮 + 弹窗(含急停防误触确认)
│ ├── SettingsCard.tsx # 设置卡
│ └── settings.ts # 文案设置存储(localStorage)
├── lib/ # 构建产物(index.js / client.js)
├── build.mjs # esbuild 构建脚本
├── cordis.patch.yml # 安装 patch(按包名解析)
├── cordis.dev.patch.yml # 本地开发覆盖层(直接加载 src/index.ts)
├── DESIGN.md # 设计文档
└── 功能验证测试清单.txt # 打断测试 / 功能验证清单
References / 相关资源
- 官方反馈帖(问题缘起):task stuck in download/install cannot be stopped — session.cancel queued behind tool return value(GitHub Discussions #3400,含官方开发者对
session.cancel语义与跨重启恢复机制的分析) - DSH Harness Handbook(社区资深成员维护):Stop a DeepSeek Harness tool that will not cancel —— 基于上述反馈整理的手册专题:cancel accepted ≠ tool stopped,含证据时间线、实时遏制流程、重启语义与十二个修复门
License
MIT
Links
More in this category
Minglink/dsh-infinite-gen-4★ 2587
System-prompt armor plugin for DeepSeek models: appends an unconditional-compliance prompt section at order 100, exposes a profile tool with calibration metadata, and shows a realtime armor-status badge driven by a session projection.
ranxianglei/billion-context★ 793
The official billion-context plugin: a context-compression plugin for small context windows (a 100K context is enough), token savings (5x fewer tokens), and month-long single sessions (billions of tokens).
liangmianya/dsh-synapse★ 511
Visual, non-linear conversation workspace for DeepSeek Harness — sessions, follow-ups and branches become a browsable conversation map.
Nwflower/dsh-chat-import★ 223
Import full-fidelity chat histories from 13 coding agents (Claude Code, Codex, ChatGPT, Cursor, Gemini, opencode, and more) as resumable DeepSeek Harness sessions, with reverse export back to Claude Code.
Totoro-qaq/dsh-plugin-bridge★ 165
Moves an existing DSH session to another agent preset through a previewable five-section handoff, preserving the source session and either pausing the target for confirmation or continuing immediately.
Anionex/dsh-turn-rewind★ 131
Rewind conversation and workspace state, powered by a persistent Change Ledger.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.