Preface¶
DeepSeek Harness (dsh) is an agent development framework. Some OpenAI-compatible gateways (such as OpenCode Zen) pass transient upstream connection failures back to the client (for example, stream termination finish_reason, echoed error payloads, etc.) instead of returning HTTP/transport-layer errors. In dsh 0.1.5-rc.2 (and the 0.1.7 Messages line), these messages are still misclassified as non-retryable by the native policy (for example, PI_AI_ERROR), causing the entire turn to hard-fail. The dsh-llm-net-retry plugin provides a bounded retry mechanism for these transient network failures and fixes the native policy’s blind spots.
Core Features¶
- Bounded Retry: Retries transient gateway network failures.
- Blind-Spot Error Capture: Captures errors classified as non-retryable by the native policy, such as
network_error,unexpected EOF, andstream_read_error. - Environment Requirement: Supports dsh >= 0.1.7-rc.1.
- Non-invasive: Does not occupy the settings namespace and does not modify core dsh logic.
- Observability: Records retry events to
llm/retry, compatible with the native policy event format.
Installation¶
This plugin is a standalone dsh plugin. It takes effect when installed into any dsh profile (TUI / Web / custom launcher).
dsh plugin --profile <profile> add @aiwayds/dsh-llm-net-retry
Uninstallation¶
Uninstalling automatically cleans up the corresponding entries in the profile bundles. This plugin has no on-disk state and leaves no residue after removal.
dsh plugin --profile <profile> remove @aiwayds/dsh-llm-net-retry
Configuration¶
This plugin does not occupy the settings namespace. Configuration is set through the composition tree entry config in cordis.patch.yml. All parameters are optional, and defaults align with the native llm-retry policy.
- insert:
- id: dsh-llm-net-retry
name: '@aiwayds/dsh-llm-net-retry'
config:
mode: on # 'off' 完全摘除 listener
maxRetries: 5
backoff:
initialDelayMs: 500
maxDelayMs: 10000
jitterRatio: 0.1
How It Works¶
The plugin attaches to the end of the agent/request-error waterfall.
- Priority Decision: It first calls
next()to run the native policy (dsh-llm-retry). If either side decides to retry, the decision is passed through unchanged. - Blind-Spot Capture: It schedules the plugin’s bounded retry only when all listeners defer and the failure falls within an official classification blind spot.
- Message Matching: Covers
network_error,unexpected EOF,stream_read_error, and wording for premature stream closure. - Code Guard: If the native policy already claims the error code (for example,
TRANSPORT,SERVER), this plugin yields and avoids double retry.
- Message Matching: Covers
- Persistence: Retry events are recorded to
llm/retry. Counters use the plugin’s own policy key and do not pollute native llm-retry counters.
Compatibility¶
- Requirement: dsh >= 0.1.7-rc.1. The plugin follows only the dsh RC/stable line and no longer supports the alpha line.
- Non-invasive: No monkey-patching, no service replacement, and clean removal on dispose.
License¶
MIT
Ecosystem Information¶
- GitHub: https://github.com/fan56/dsh-llm-net-retry
- Directory: https://www.skillhub.cn/plugins/fan56/dsh-llm-net-retry