Introduction

In DSH workflows, agent sessions are often interrupted by network instability, output truncation, or process crashes. Manual retries not only break the rhythm but also struggle to cover all exception scenarios. We need a mechanism that automatically intervenes when a failure is detected, routes retry strategies by failure type, and attempts to recover the session.

Plugin Overview

weibaohui/dsh-continue is an automatic continuation plugin. When an agent session is interrupted, it automatically resumes it for you, so you don’t have to manually type “continue.” It maintains an ordered rule table, routes retry strategies by failure type, and supports automatic model switching, visual management, and activity log recording.

Core Features

  • Automatic continuation: Detects failure types such as transmission errors, crash orphans, and output truncation, automatically resends continuation instructions to the same session, with cooldown and exponential backoff.
  • Ordered rule table: Routes strategies by failure type (top to bottom, first matched rule is used first). Supports rate limiting, quota exhaustion, authentication failures, context limit exceeded, crash orphans, output truncation (max-tokens), and other errors.
  • Automatic model switching: If the same failure remains unresolved for N consecutive attempts, subsequent continuations automatically switch to a fallback model.
  • Visual management: Rules, parameters, and model selection are visually edited in the settings page.
  • Activity log: Records continuation events, model switches, and stop reasons.
  • Automatic session context compaction: If the host layer has no compaction backend, it degrades to a one-line stop-loss notice.

Installation and Activation

Install the plugin via the command line. After installation, you must restart dsh web for the changes to take effect.

dsh plugin --profile web add @weibaohui/dsh-continue -w

Usage

  1. Open the Web UI → Settings → Automatic Continuation.
  2. Default rules are ready to use out of the box, with no configuration required.
  3. To customize: edit the rule table (matching conditions + actions), adjust continuation limits/backoff parameters, and select a fallback model.
  4. When a failure occurs, the plugin automatically intervenes.

Notes

  • Configuration conflicts: This plugin’s bundle patch does not modify compaction-basic. Forcing compaction-basic to disabled: false may cause conflicts.
  • Compaction backend: If the host layer does not have a compaction backend attached, the plugin degrades to a one-line stop-loss notice.
  • Effective timing: After installation, you must restart dsh web for the changes to take effect.

Conclusion

By using automatic retries and strategy routing, this plugin solves the maintenance cost problem caused by interrupted agent sessions.