Introduction

The default retry plugin for DeepSeek Harness (DSH), dsh-llm-retry, typically retries only error codes on the whitelist (such as empty responses, rate limiting, and server errors). For errors not on the whitelist (such as authentication failures, insufficient quota, or invalid requests), the default behavior is to terminate the current run immediately.

dsh-better-retry is a DSH Cordis plugin designed to address the above limitations. Instead of relying on a whitelist, it attempts to retry any failed model request. By using an exponential backoff policy and a configurable retry budget, it displays retry status in the UI and allows parameters to be adjusted in real time through sliders.

Core Features

  • Full Retry: Retries any error code (authentication, quota, invalid requests, etc.), not limited to a whitelist.
  • Exponential Backoff: Retry delay starts at 500 ms, increases exponentially, with a maximum delay of 10 seconds.
  • UI Slider Configuration: Provides sliders in Settings → General to adjust the “Failed Retry Count” (0–64) and “429 Wait Time” (5–120 s).
  • Status Display: The UI displays “Retrying model request…”, ensuring session replay safety.
  • Smart Exclusion: Automatically excludes ABORTED (user cancellation) and CONTEXT_WINDOW_EXCEEDED (handled by the compaction plugin) errors.
  • Coexistence: Works alongside the default dsh-llm-retry plugin, with downstream decisions taking higher priority.

Installation

Global static installation is recommended, as configuration changes are persisted and the plugin survives DSH restarts.

cd "$DSH_HOME/profiles/web"
pnpm add https://github.com/Yaing-Yan/dsh-better-retry/archive/refs/tags/v1.0.0.tar.gz

After installation, add "dsh-better-retry" to the dsh.profile.bundles array in $DSH_HOME/profiles/web/package.json, then restart DSH.

A dynamic approach (cordis_define) can also be used to inject code into a single session, but in dynamic mode the retry count is fixed at 8 and changes are not persisted.

Configuration and Usage

After installation, the plugin automatically registers in the Settings → General page.

  1. Adjust Retry Count: Drag the “Failed Retry Count” slider. The default is 8, with a range of 0–64. Setting it to 0 completely disables this plugin.
  2. Adjust 429 Wait Time: Drag the “429 Wait” slider. The default is 15 seconds, with a range of 5–120 seconds. This determines the wait duration when a rate-limit error occurs.
  3. View Status: When a request fails, the UI displays “Retrying model request…”.
  4. Persistence: All configuration changes are saved immediately to ~/.dsh/settings.yaml and take effect on the next startup.

The plugin preferentially uses the Retry-After header returned by the Provider as the wait time, but that value is clamped within the user-defined 429 wait range.

Notes

  • Authentication and Quota: Retrying AUTH or QUOTA errors is useful only for transient failures. If the API key is permanently invalid or the balance is depleted, multiple retries will still fail.
  • Context Window: Context window overflow (CONTEXT_WINDOW_EXCEEDED) is handled by the dsh-compaction-basic plugin, and this plugin does not repeatedly retry this error.
  • Session Safety: The llm/retry events emitted by the plugin conform to the standard DSH specification, ensuring session replayability.

Summary

dsh-better-retry removes the retry whitelist restriction, allowing DSH to attempt recovery when encountering non-standard errors. In scenarios involving complex API responses or occasionally unstable models, this plugin can improve request success rates.