- Início
- Plugins
- Melhorias de UI
- dsh-auto-continue-429
H
dsh-auto-continue-429
haochi72/dsh-auto-continue-429
Auto-continue on 429 rate limit errors for DeepSeek Harness Web UI. Host-side RATE_LIMIT recovery plus a floating toggle button in the browser.
Instalar
dsh plugin --profile web add github:haochi72/dsh-auto-continue-429README
dsh-auto-continue-429
DeepSeek Harness(DSH)插件:遇到 429 限流自动 continue 恢复对话,20 次连续失败才停,成功一次即清零。
✨ 功能特色
| 能力 | 说明 |
|---|---|
| 🔄 自动 Continue | dsh-llm-retry 的 step 级重试耗尽后,自动发送 continue 开启新 turn |
| 👆 右侧悬浮按钮 | 绿色圆形 429 按钮,点击切换开/关,右上角 × 可隐藏 |
| ⚙ 设置页开关 | 隐藏后可在设置页「429 自动 Continue」卡片重新打开 |
| 🧮 连续失败计数 | 连续失败 20 次才停止,任何一次 turn 正常结束即清零 |
| ⏱️ 固定 2 秒退避 | 每次 429 后等待 2 秒发送 continue(API Retry-After 更短则优先) |
| 📱 计数徽章 | 按钮下方显示 5/20 样式,橙色=已发生重试,深色=干净 |
| 💾 设置持久化 | 开关状态/隐藏状态保存在 ~/.dsh/auto-continue-429.json |
UI 交互示例:
┌─────────────────────────────────────────┐
│ │
│ 对话内容 │🟢429│ ← 绿色=已开启 │
│ │ 0/20 │ ← 连续失败计数 │
│ │ │ ← 右上角 ×=隐藏 │
│ │
│ 隐藏后:出现蓝色「+」按钮,点击显示 │
└─────────────────────────────────────────┘
📦 安装
方式 1:已发布到 npm(发布后)
cd ~/.dsh/profiles/web
pnpm add dsh-auto-continue-429
方式 2:从 GitHub 安装
dsh plugin --profile web add github:haochi72/dsh-auto-continue-429
方式 3:本地开发链接
cd ~/.dsh/profiles/web
pnpm link /path/to/dsh-auto-continue-429
然后在 ~/.dsh/profiles/web/package.json 的 dsh.profile.bundles 数组末尾加上:
"dsh-auto-continue-429"
重启 DSH Desktop 生效。
🚀 使用
1. 确认加载成功
重启 DSH 后在界面右侧垂直居中位置,应该出现一个绿色圆形 「429」 按钮。
2. 控制开关
| 操作 | 效果 |
|---|---|
| 点击绿色按钮 | 切换开启/关闭(按钮变灰=已关闭) |
| 点击按钮右上角红色 × | 隐藏悬浮按钮,右侧出现蓝色「+」 |
| 点击蓝色「+」 | 恢复显示悬浮按钮 |
| 设置页 → 429 自动 Continue 卡片 | 开启/关闭 + 显示/隐藏按钮 |
3. 遇到 429 时的行为
LLM 返回 429
↓
dsh-llm-retry 在当前 step 内重试 2 次(内置)
↓
重试耗尽 → turn 以 error(RATE_LIMIT) 结束
↓
★ 本插件介入
↓
等 2 秒 → 发送 "continue" → 新 turn 启动 ✅
↓
(如果又 429)
↓
等 2 秒 → 发送 "continue" → …(重复到第 20 次)
↓
如果某次 turn 正常结束(reason.kind ≠ error)→ 计数归零 🎉
↓
连续 20 次全失败 → 停止,等待手动介入
⚙️ 配置(可选)
插件提供以下 Schema 配置项(在 cordis.patch.yml 或 profile 配置中声明):
- id: auto-continue-429
name: dsh-auto-continue-429
config:
maxRetries: 20 # 连续失败最大次数(默认20)
initialDelayMs: 2000 # 每次失败后的等待时间(毫秒,默认2000=2秒)
maxDelayMs: 60000 # API Retry-After 上限(毫秒)
jitterRatio: 0.15 # 抖动比例(保留用于将来扩展,当前未使用)
continueMessage: "continue" # 发送的 continue 消息文本
🧩 架构
本插件是 DSH 标准的双端插件(Cordis 驱动):
dsh-auto-continue-429/
├── package.json # dsh.bundle.patch 声明 + dsh.client 声明
├── cordis.patch.yml # bundle 层补丁:插入插件行
├── lib/
│ ├── index.js # 宿主端:429 拦截 + 退避 + continue + HTTP 路由
│ └── client.js # 客户端:悬浮按钮 + 设置页卡片
├── LICENSE # MIT
└── README.md
宿主端接入点
| 接入点 | 说明 |
|---|---|
ctx.inject(["webServer"]) | 注册 3 个 HTTP 路由供客户端轮询与控制 |
ctx.on("session/event", …) | 监听 turn/end,检测 RATE_LIMIT 错误码后调度 continue |
ctx.agents.get(sessionId).followup(…) | 发送 continue 用户消息 |
客户端接入点
纯 DOM 注入(不依赖 React),通过 HTTP fetch 与宿主端通信:
- 启动时创建悬浮按钮 DOM
- 每 2 秒
GET /api/auto-continue-429/state同步状态 POST /toggle切换开关、POST /hide-button切换显示MutationObserver监听设置页 DOM,自动注入设置卡片
🔒 权限
- 不访问文件系统:仅
~/.dsh/auto-continue-429.json保存开关状态(<1KB) - 不读取 API Key:完全复用 DSH 内置的 agent/followup 通道
- 不外发任何网络请求:所有 HTTP 路由走 DSH 内置 webServer(localhost 回环)
🐛 调试
宿主端日志(DSH stdout):
[auto-continue-429] 会话 sess_xxx 连续失败第 3/20 次,2000ms 后自动 continue
[auto-continue-429] 已发送 continue 到会话 sess_xxx
[auto-continue-429] 已达连续失败上限 20 次,停止自动 continue
设置文件路径:
~/.dsh/auto-continue-429.json
→ {"enabled": true, "buttonHidden": false}
📜 开源协议
MIT © 2026