syncended/deepseek-harness-retry0

@syncended/dsh-retry

Configurable automatic retries and interrupted-session recovery for DeepSeek Harness

包名
@syncended/dsh-retry
版本
0.2.2
许可证
MIT
最近更新
2026年8月29日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:syncended/deepseek-harness-retry

Configuration

The defaults apply immediately after installation. To customize them, edit the existing model-error-retry row in $DSH_HOME/profiles/ /cordis.patch.yml; do not add a duplicate row with the same id.

- id: model-error-retry
  config:
    maxRetries: 3
    overloadMaxRetries: 5
    retryableCodes:
      - PI_AI_ERROR
      - UNKNOWN
      - STREAM_CLOSED
      - EMPTY_RESPONSE
      - RATE_LIMIT
      - SERVER
      - TIMEOUT
      - TRANSPORT
    initialDelayMs: 750
    overloadInitialDelayMs: 2000
    maxDelayMs: 15000
    jitterRatio: 0.15
    respectRetryAfter: true
    resumeInterrupted: true
    resumeDisposed: false
    resumeMaxAgeMs: 86400000
    resumePrompt: >-
      DeepSeek Harness stopped before the previous task produced a complete final
      assistant response, or before a scheduled retry started. Continue the unfinished
      work from the durable session history. Re-check the current workspace and
      external state before acting. Do not blindly repeat tool calls that may have side
      effects; verify their outcome first.
    providers:
      - openai
      - openrouter
    excludeProviders: []

Restart the Host after changing this file.

OptionDefaultDescription
maxRetries2Retries after an ordinary original failure. 0 disables request-error retries but not resumeInterrupted.
overloadMaxRetries5Retries for PI_AI_ERROR with an explicit overload message.
retryableCodessee belowExact provider-neutral codes. * matches any request error.
initialDelayMs500Initial ordinary exponential-backoff delay.
overloadInitialDelayMs2000Initial explicit-overload delay.
maxDelayMs10000Maximum local delay. A larger Retry-After leaves the failure terminal.
jitterRatio0.1Symmetric jitter ratio from 0 to 1.
providers[]Exact provider-route allowlist; empty allows all routes.
excludeProviders[]Exact provider-route denylist; takes precedence over the allowlist.
respectRetryAftertrueHonor provider Retry-After when it does not exceed maxDelayMs.
resumeInterruptedtrueOn cold resume, continue an unmatched plugin retry, a model step with no assistant message, or a durably closed tool boundary before its next model step.
resumeDisposedfalseAlso accept aborted/disposed as an unfinished retry. Disabled because HMR and intentional teardown can produce this reason.
resumeMaxAgeMs86400000Oldest pending retry eligible for automatic continuation; 24 hours by default.
resumePromptbuilt inModel-visible safety instruction for a confirmed interrupted continuation.

Default fallback retry codes:

STREAM_CLOSED, MALFORMED_RESPONSE, PI_AI_ERROR, API_ERROR, MODEL_ERROR,
INTERNAL_ERROR, PROVIDER_ERROR, UNKNOWN

Permanent failures such as AUTH, INVALID_REQUEST, MISSING_CREDENTIAL, UNKNOWN_MODEL, and context overflow are not retried by default. Add an exact code or * only after considering cost and repeated side effects.

Validation rules

  • Retry counts must be non-negative safe integers.
  • initialDelayMs and overloadInitialDelayMs must not exceed maxDelayMs.
  • jitterRatio must be between 0 and 1.
  • retryableCodes cannot be empty while request-error retries are enabled.
  • resumePrompt cannot be empty when interrupted-session recovery is enabled.
  • Provider filters compare exact route strings; they are not regular expressions or prefixes.