DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-retry

i

dsh-retry

Manifest valid

A retry executor plugin for DeepSeek Harness model requests: fixed-schedule retries, tuned for relay endpoints and unstable upstreams.

hasBundlePatch

dsh-retry

A retry executor plugin for DeepSeek Harness model requests: fixed-schedule retries, tuned for relay endpoints and unstable upstreams.

Quick start

dsh plugin --profile web add github:imrcpan/dsh-retry

DeepSeek Harness retries failed model requests at the agent step boundary. The bundled executor (@deepseek-ai/dsh-llm-retry) takes its wait from a provider retryPolicy that only exposes exponential backoff (initialDelayMs, maxDelayMs, jitterRatio). This plugin replaces that curve with an explicit schedule:

retry123456 and later
wait2s5s5s5s10s20s, unlimited

A retried step is re-run inside the same open turn against the same durable history, so no partial answer is duplicated and the model never sees the retry.

Built for relay and pooled upstreams

A relay endpoint is a third-party API proxy that fans one key out across a pool of upstream accounts. It fails per account, not per request: a 401, an exhausted quota or a 404 on one backend says nothing about the next attempt, and a public gateway in front of the pool adds 5xx pages of its own. This executor is tuned for that deployment and for unstable networks:

  • Per-account failures are retried. AUTH, QUOTA, ACCOUNT_QUOTA, ACCOUNT_TOKEN_INVALID and INVALID_CREDENTIAL are retried, and the HTTP_* prefix covers every unclassified 4xx, so HTTP_404 is repeated instead of ending the turn.
  • Gateway noise is retried. Cloudflare and proxy 5xx answers classify as SERVER, including HTML error pages that never parse as JSON.
  • Corrupt streams are retried. A broken SSE frame classifies as MALFORMED_RESPONSE.
  • Waits stay short and predictable. 2s, 5s, 5s, 5s, 10s, then every 20s without limit, so a short wobble costs seconds instead of an exponential climb toward a ceiling.
  • No duplicated output. Recovery re-runs the step against the durable history, so a retried request never repeats a half-finished answer.

The executor does not rotate accounts by itself: a retry only re-issues the request, so the relay has to select a different upstream for the next attempt.

Why a separate executor

  • Fixed delays: 2s, 5s, 5s, 5s, 10s, then a steady 20s tail instead of exponential growth.
  • One unlimited tail, for upstreams that eventually recover.
  • Prefix matching for failure-code families, so HTTP_* covers unclassified 4xx statuses such as HTTP_404.
  • Standard llm/retry events, so the Chat retry status row and the Trajectory panel keep working.

Requirements

  • DeepSeek Harness 0.2.1-rc.5 (other releases may differ).
  • Node.js >=20.3, which provides AbortSignal.any.

Install

The package is a DSH bundle: package.json declares dsh.bundle.patch, so the standard install also mounts the executor and retires the bundled one. No hand-written patch is required.

dsh plugin --profile web add github:imrcpan/dsh-retry

Restart the profile afterwards; the composition is read at boot. The row then appears under Plugins, where its config is editable.

The shipped layer (cordis.patch.yml) inserts the executor and disables llm-retry:

- insert:
    - id: dsh-retry
      name: "dsh-retry"
      config:
        schedule: [2000, 5000, 5000, 5000, 10000]
        tailDelayMs: 20000
        retryableCodes: [ ... ]   # full list in cordis.patch.yml
- id: llm-retry
  disabled: true

Disabling llm-retry matters: two mounted executors would compete for the same failure and both write retry chain state. Keep the row disabled if the profile overrides it.

Install from a checkout

Install the checkout as a bundle so its manifest applies:

dsh plugin --profile web add /absolute/path/to/dsh-retry

A plain file: dependency is also accepted, but then no bundle layer is applied and the block above has to be copied into the profile's cordis.patch.yml by hand:

{
  "dependencies": {
    "dsh-retry": "file:./plugins/dsh-retry"
  }
}

Configuration

keydefaultmeaning
schedule[2000, 5000, 5000, 5000, 10000]wait in milliseconds before retries 1..n; the array length is the bounded head
tailDelayMs20000wait for every retry after the schedule is exhausted
retryableCodessee belowfailure codes that are worth repeating

A retryableCodes entry ending in * is a prefix rule. HTTP_* matches HTTP_404, HTTP_409, HTTP_422 and any other unclassified status. A bare * is rejected because it would match every failure.

Default retryable codes

codetypical cause
EMPTY_RESPONSEa completed response with no content blocks
RATE_LIMITHTTP 429 or a provider rate-limit error
SERVERHTTP 5xx, including gateway and Cloudflare 5xx responses
TIMEOUTa request or stream deadline
TRANSPORTconnection reset, socket error, truncated stream
PI_AI_ERRORan upstream error the pi-ai adapter could not classify
AUTHHTTP 401 or 403; with a pooled account upstream another account may succeed
QUOTA, ACCOUNT_QUOTAexhausted balance or account quota
ACCOUNT_TOKEN_INVALIDa stored account token rejected with 401
INVALID_CREDENTIALa malformed credential entry in the pool
MALFORMED_RESPONSEa corrupt SSE frame or a mismatched event type
HTTP_*unclassified 4xx statuses such as HTTP_404, HTTP_409, HTTP_422

Not retried

codewhy
CONTEXT_WINDOW_EXCEEDEDcompaction owns the recovery; retrying would loop
INVALID_REQUESTthe request itself is wrong, so another account cannot help
NO_ADAPTER, UNSUPPORTED_REASONING_EFFORTconfiguration errors
MISSING_CREDENTIALno credential is configured for the route
ACCOUNT_SIGN_IN_REQUIREDa human has to sign in
ABORTEDcancellation must stay terminal
UNKNOWNthe fallback code for foreign errors, unsafe to repeat without limit

Add any of them to retryableCodes if your deployment disagrees.

What you see

Each planned retry appends a durable llm/retry event, then llm/retry-started once the wait ends. The Chat transcript renders a row such as Retrying model request (2/5) . 4s with an expandable failure reason and delay, and the Trajectory panel lists the attempt, error code and delay. Retries 6 and later render with an unlimited maximum.

No toast is raised, no partial output from a failed attempt is kept, and the model sees nothing: it only receives the rebuilt request for the step that is being retried. Every attempt is a separately billed provider request.

Limitations

  • The retry chain counter lives in memory per session. A host restart ends the turn, so nothing is lost that a durable counter would have preserved.
  • Only agent-loop requests are retried. Direct ctx.llm.stream() callers stay single-attempt.
  • The tail is genuinely unlimited. When the upstream never recovers, the turn stays in the retrying state until it is stopped.
  • Retrying pooled credential and quota failures assumes the pool rotates on the next attempt. A permanently exhausted pool loops every 20 seconds.

License

MIT.

Comments

Loading…

Similar plugins

dsh-steering

by ManoloRemiddi

Responsive steering during model output in DeepSeek Harness; preserves queued follow-ups and running tools.

Development & InfrastructureManifest valid

★ 1

MIT

JavaScript

Sep 14, 2026

dsh plugin --profile web add dsh-steering

by xalor888

Unbounded model-request retry for the DeepSeek Harness agent loop, with a live Settings panel.

Development & InfrastructureModels & ProvidersManifest valid

★ 4

↓ 484/wk

MIT

JavaScript

Nov 15, 2026

dsh plugin --profile web add dsh-unlimited-retry

by dboycht

Patient auto-retry for DeepSeek Harness — reads the retry delay out of an upstream 429 capacity-cooldown message and waits it out, instead of giving up after two fast retries.

Tools & CapabilitiesManifest valid

★ 0

MIT

JavaScript

Sep 25, 2026

dsh plugin --profile web add dsh-cooldown-retry

by Frog755

DSH client plugin: auto-sends 「继续」 when a turn is interrupted/errored/overlong. No model/provider switching. Ships with a settings card.

Development & InfrastructureTerminal & ClientsSessions & MessagesManifest valid

★ 4

↓ 232/wk

MIT

JavaScript

Sep 10, 2026

dsh plugin --profile web add @frog755/dsh-client-auto-retry

by sjh9714

Observe identical tool failures and optionally pause the next model step in DeepSeek Harness.

Tools & CapabilitiesDevelopment & InfrastructureManifest valid

★ 0

MIT

JavaScript

Oct 4, 2026

dsh plugin --profile web add dsh-retry-guard

by 502399493zjw-lgtm

DeepSeek Harness plugin for configuring the global model-request retry budget

Manifest valid

★ 0

MIT

TypeScript

Aug 20, 2026

dsh plugin --profile web add @zhongjingwei/dsh-model-retry