DeepSeek Harness Plugin: Automatically Injects “Continue” on Model Request Failure and Switches to a Fallback Model

In DeepSeek Harness (DSH) development scenarios, a model request failure interrupts the current run and requires manual intervention to continue. The dsh-auto-continue plugin listens for request errors, automatically injects a “continue” instruction after a failure, and switches models along the fallback chain, eliminating the need for manual intervention.

Core Features

This plugin primarily solves the automatic recovery problem when model inference fails:

  1. Monitoring & Recording: Listens for agent/request-error to record failures. Failed models are persisted to ~/.dsh/auto-continue/model-fails. and survive a DSH restart.
  2. Cooldown Mechanism: Default cooldown period is 5 hours. Within the cooldown window, every switch skips that model until the cooldown expires.
  3. Cyclic Switching: Failed models are skipped on every switch during the cooldown; the plugin cycles through models along the fallback chain until a working model is found.
  4. Per-Session Limit: Default cap of 100 continues per session; the counter resets automatically after a normal completion.
  5. Rate Limit Handling: 429 rate limiting also follows the retry → switch loop.
  6. Truncation Behavior: max-tokens truncation only injects “continue” without switching the model.
  7. Restart Behavior: After a restart, historical leftover failed rounds are not resumed.
  8. Manual Control: Supports manual pause/resume.

Installation

Install via the plugin manager:

github:cglyvip/dsh-auto-continue

Before installing, confirm that the plugin manager declares dsh.bundle.patch; otherwise, the manager will report an error.

Configuration & Usage

Session Commands

The following commands can be used within a session:

  • /autocont — view status
  • /autocont on|off — temporary toggle (effective for the current run only)
  • /autocont reset — clear cooldowns and counters

File Configuration

The settings file is located at ~/.dsh/auto-continue/settings. (takes priority over the profile). To fully revert to the profile configuration, you can delete this file.

In the profile’s cordis.patch.yml, you can override the following fields:

  • retriesPerModel: Number of retries for the same model after a failure (default: 3).
  • continueMax: Maximum number of continues per session (default: 100).
  • fallbacks: Fallback chain (list of provider+model).

Logs & File Paths

  • Log file: ~/.dsh/auto-continue/activity.log (auto-rotated to .old when exceeding 512KB).
  • Persistent records: ~/.dsh/auto-continue/model-fails.

After installation and restarting DSH, it is recommended to first check activity.log to confirm the plugin has been loaded.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye