DeepSeek Harness plugin

dsh-auto-retry

Bounded fallback recovery for DSH rate limits, empty responses, and truncated model output

Jump to install

Source facts

Repository
Windsland52/dsh-auto-retry
Latest update
Aug 18, 2026
Category
Models & Providers
GitHub stars
0
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/Windsland52/dsh-auto-retry
Plugin: dsh-auto-retry
Author: Windsland52

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

dsh-auto-retry

DSH 的有界后备恢复插件。它不会替换官方 @deepseek-ai/dsh-llm-retry,而是在官方提供方策略不再重试后接手。

它解决的是一类容易混淆的问题:中转方把可恢复的瞬时 429 标成 QUOTA,或者模型请求“正常结束”但没有可见输出。插件只在有明确证据时接手,并把重试次数、总等待时间和自动续行次数全部限制在配置预算内。

安装

从 GitHub 安装到 Web profile:

dsh plugin --profile web add "github:Windsland52/dsh-auto-retry#main"

安装器会把包含 dsh.bundle.patch 的依赖加入 profile bundle。GitHub 安装会通过包的 prepare 脚本构建 lib/;如果 pnpm 提示阻止构建脚本,按提示把该包加入 profile 的 pnpm-workspace.yaml allowBuilds 后重新执行安装。

安装后重启 DSH。配置写在 profile 自己的 cordis.patch.yml,不要直接修改 node_modules 里的 bundle 文件。

默认行为

  • 额外重试 RATE_LIMIT、HTTP 429、EMPTY_RESPONSESTREAM_CLOSED
  • 中转方把瞬时 429 误标成 QUOTA 时,只在错误详情包含 rate_limit_exceededrate limitallocated quota exceeded 等特征时重试;真正的余额/credits 耗尽不会重试。
  • 最多额外重试 8 次,总等待时间不超过 15 分钟。
  • 优先使用提供方的 Retry-After,否则使用带抖动的指数退避(1.5 秒至 60 秒)。
  • 正常结束但没有可见文本/工具调用时,自动续行。
  • max-tokens 截断时自动续行。
  • 每个 turn 最多自动续行 2 次,避免空响应死循环。
  • AUTHQUOTA、上下文超限、无效请求和用户取消不会被默认重试。

配置

- id: dsh-auto-retry
  name: '@dsh-external/dsh-auto-retry'
  config:
    # 空数组表示所有 provider;也可以只写 [scnet]
    providers: []
    retryCodes:
      - RATE_LIMIT
      - EMPTY_RESPONSE
      - STREAM_CLOSED
    retryQuota: true
    quotaRetryPatterns:
      - rate_limit_exceeded
      - rate limit
      - too many requests
      - allocated quota exceeded
      - temporarily unavailable
    maxRetries: 8
    maxElapsedMs: 900000
    initialDelayMs: 1500
    maxDelayMs: 60000
    jitterRatio: 0.2
    maxAutoContinuations: 2
    continueOnMaxTokens: true

每次后备重试都会复用 DSH 已有的 llm/retryllm/retry-started 持久事件,因此会话重放和现有重试状态 UI 仍能理解它。内部自动续行使用 plugin 来源的 user message,不会伪装成人类输入。

和其他插件的边界

插件主要职责是否覆盖本插件的核心场景
官方 @deepseek-ai/dsh-llm-retryprovider 自己声明的请求错误重试策略它先处理;本插件只在它放弃后接手
dsh-llm-bounded-retry对结构化 LLM 请求错误统一做有界重试不处理静默成功响应、max-tokens 续行或 relay QUOTA 识别;不要和本插件同时接管同一 profile 的请求重试
dsh-retry-override覆盖指定 provider 的 retry policy不处理输出续行;适合需要按 provider 改策略的用户
dsh-client-auto-retryWeb 客户端监听 turn/end 后发送“继续”和本插件的 max-tokens/错误续行有重叠,不建议同时启用
dsh-autofix工具调用错误的单次恢复动作不处理模型请求或模型输出

本插件的定位是 Host 侧、provider-aware 的后备恢复:保留官方重试优先级,专门补齐中转方瞬时限流误报、空可见输出和输出截断这三个缺口,而不是再提供一个无限重试器。

兼容性

  • 已针对 DSH 0.1.0-rc.7 的 Web profile 验证。
  • 插件不切换模型或 provider,不修改请求内容,也不把自动续行伪装成人类消息。
  • 同一个 profile 只应有一个插件负责 agent/request-error 的全局重试预算;需要使用其他重试策略时,应按 provider 划分责任范围。

GitHub 发布

发布仓库后建议添加 dsh GitHub topic,方便社区目录发现。当前 package 保留了 private: true,表示只支持 GitHub 源码安装;如果以后要发布到 npm,需要删除该字段并改用正式的 npm 发布流程。

开发

npm install
npm test
npm pack --dry-run