Skip to main content

dsh-auto-continue

34Stars3Forks0Issues1Watchers

Automatically resumes requests interrupted by network issues in DSH Web UI. Skips and notifies when permanent errors like authentication failures occur.

Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki
Language
TypeScript
License
MIT
Branch
main
auto-continueautomaticcordisdeepseek-harnessdshdsh-pluginpluginweb-ui

Install

cmdweb profile
$ dsh plugin --profile web add dsh-client-auto-continue

Run the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial

Install via your agent

Install the DeepSeek Harness plugin HsiangNianian/dsh-auto-continue for me: review the repository at https://github.com/HsiangNianian/dsh-auto-continue first, then run the install command and verify the plugin loads successfully.

Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.

One-Line Description

A plugin for DSH Web UI that automatically resumes when requests are interrupted by network issues—sends "continue" as a regular user message, and skips with notification on permanent errors.

Core Features

  • Detects turn completion events and automatically sends "continue" for transient failures (network/timeout/5xx/429) and token limit exceeded
  • Adaptive backoff: cooldown increases multiplicatively on consecutive failures (default 20s → 40s → 80s...), avoiding hammering a failing upstream
  • Idempotent guard: before resuming, checks the previous tool call status; if tool result is unconfirmed or already completed, adds a hint to the model to avoid duplicate execution
  • Loop guard: detects spinning turns in progress (consecutive short sentences, repeated same tool calls, identical messages), automatically cancels and restarts the turn with loop hint text
  • Boot/reconnect scan: if host crashes during browser closure leaving interrupted turns, scans and auto-resumes after recovery
  • Settings card statistics: today's auto-continue count, skipped count, recovered count, failure count, stopped-at-limit count, loop interrupted count; can classify by error code and one-click reset
  • Optional browser notification: popup on auto-continue/abandon/permanent error, can click "Resume Now" or "Pause This Session for 1 Hour"

Technical Implementation

  • Language: TypeScript
  • Key Dependencies: @deepseek-ai/cordis, @deepseek-ai/schemastery, @deepseek-ai/dsh-settings, @deepseek-ai/dsh-client-runtime
  • Architecture: Host-browser dual-half plugin; host-side single-instance engine subscribes to session event stream (session/event), sends via agent.followup, cancels via agent.cancel; browser-side thin shell only provides settings card and SSE state bridge
  • Entry Files: src/index.ts (host-side) / src/client/index.ts (browser-side)

Use Cases

When running long tasks with DSH Web, network fluctuations or server-side transient 5xx errors interrupt the turn, and the common workaround is manual click to resend. This plugin eliminates that action—as long as the network or server issue is transient, it will automatically resume after a few seconds. Also suitable for scenarios where you return after closing the browser and find the task abandoned—restores immediately upon page load.

Prerequisites & Compatibility

DependencyMinimum VersionDescription
DSH≥ 0.1.0-rc.7Below rc.7, settings card fails to load (list slot ... requires options.id), must upgrade DSH
Node.js≥ 18Required only when building from source; installing prebuilt via dsh plugin add does not require
PlatformCross-platformPlugin has no native module dependencies, no platform restrictions
Native ModulesNoneEngine based on in-memory state within host process, no native dependencies like node-pty / sqlite

Installation

dsh plugin --profile web add github:HsiangNianian/dsh-auto-continue

Configuration Options

ConfigTypeDescriptionDefault
pausedBooleanGlobal pause: both real-time and scan stop auto-sending, queued items also cancelledOff
continueTextTextMessage auto-sent after interruption, supports placeholders like {code} {tool} {message}继续
continueTextMaxTokensTextText sent when output token limit is reached, supports same placeholders继续
guardToolsBooleanCheck previous tool call before resume and add guard hint to avoid duplicate executionOn
guardPendingTextTextHint text appended when tool result is unconfirmed, supports {tool} placeholder(上一步工具「{tool}」可能未完成, 先确认状态再继续, 不要重复执行)
guardDoneTextTextHint text appended when tool succeeded, supports {tool} {result} placeholders(上一步工具「{tool}」已完成, 结果: {result}; 不要重复执行, 直接继续)
graceMsNumberGrace period waiting for host self-recovery after interruption; if recovered, cancel auto-send (ms)3000
cooldownMsNumberMinimum interval between two auto-"continue" in same session, failed attempts also count (ms)20000
maxConsecutiveNumberUpper limit of consecutive auto-"continue" in same session; after exceeded, stops and waits for user intervention or successful turn3
scanOnBootBooleanScan and auto-resume recently interrupted sessions on page startup or reconnection (e.g., host crashed during browser closure)On
scanLimitNumberAt boot scan, max number of most recently updated sessions to check (excluding running and sub-agent sessions)8
freshMsNumberScan only processes interruptions within this time window (ms)900000 (15 minutes)
classifyBooleanError classification: only auto-recover transient errors; permanent errors like auth/balance/model not found are skipped and notifiedOn
backoffFactorNumberMultiplier for cooldown interval on consecutive failures2
backoffMaxMsNumberUpper limit for adaptive backoff, prevents waiting too long (ms)300000 (5 minutes)
notifyBooleanBrowser notification on auto-continue/abandon/permanent error (will request permission on first use)Off
loopGuardBooleanDetect spinning turns in progress and auto-cancel restartOn
loopShortCharsNumberModel messages shorter than this are considered short sentences (spinning signal)40
loopWindowMsNumberConsecutive short sentences must fall within this time window to count as spinning (ms)30000
loopShortCountNumberHow many consecutive short sentences without tool calls in time window triggers spinning loop12
loopRepeatTextNumberHow many identical messages (any length, strongest signal) triggers spinning loop4
loopToolRepeatNumberHow many consecutive calls with same tool + same params + same result triggers infinite loop5
loopTextTextText sent when loop guard breaks and restarts turn, supports {tool} placeholder(检测到你可能陷入循环, 请停止重复刚才的动作, 换一种方式继续)
verboseBooleanOutput [auto-continue] logs in browser consoleOn

FAQ

Q: Which interruptions trigger auto-resume, which don't?

A: Transient failures (network/timeout/5xx/429) trigger; reaching output token limit also triggers. User-initiated stops (aborted), policy rejections (blocked), and permanent errors (401/403 status codes, or matching auth/credential/balance/quota/model not found/context length exceeded keywords) never resume—they skip and notify.

Q: Will multiple browser tabs send duplicates?

A: No. Since 0.8.0, the engine runs in the host process (src/host/engine.ts), globally single-instance, so multiple tabs won't send duplicates; engine stays on guard duty even when all browser tabs are closed.

Q: Need to restart dsh web to take effect?

A: First enable after install requires restart dsh web. After that, all changes save instantly via settings card (written to ~/.dsh/settings.yaml), taking effect immediately, pages also refresh; if any fields don't take effect, just restart dsh web.

Q: How to manually disable auto-continue?

A: Open "Settings → Plugins", find "Auto Continue" card, turn on global "Pause Auto Continue" switch to cancel all auto-sending in real-time. To pause just one session, click "Pause This Session for 1 Hour" in browser notification, or individually unpause in the "Paused Sessions" list at card bottom.

Q: Do leftover sections in ~/.dsh/settings.yaml need cleanup after uninstall?

A: No cleanup needed. The section remains in config file harmlessly on uninstall; if you want thorough cleanup, manually delete the auto-continue section.

Q: Will loop guard misjudge? Will it restart my manually stopped turns?

A: Won't misjudge your manual stops. Cancellations initiated by loop guard carry internal source marker; engine only auto-restarts on guard cancellations, manual stops trigger no action. Thresholds, time windows, and hint text are all adjustable; if misjudged, loosen loopShortCount / loopWindowMs.

Q: How to write placeholders in hint text?

A: continueText and continueTextMaxTokens support {code} {message} {status} {tool} {turn} {errorCount} {sessionTitle} {elapsed}. Guard text (guardPendingText / guardDoneText / loopText) support {tool} and {result} (result summary). For example, 继续 ({tool}: {code}) renders as 继续 (git push: UPSTREAM).

Difficulty Level

Beginner — One-line install command, works with default config, adjust via settings card with explanations when needed, no coding required.

Known Issues & Limitations

  • reconnectScanDelayMs (reconnect scan delay, default 5000ms) and reconnectBackoffMs (reconnect backoff, default 3000ms) are legacy fields: no longer used after engine moved to host in 0.8.0, retained only for legacy config compatibility; changing these values has no effect.
  • Installing on DSH < 0.1.0-rc.7 fails to load due to settings.plugin.item slot not supporting keyed registration; need to upgrade DSH first.
  • isTransientFailure matches error keywords via regex (auth, credential, api_key, balance, quota, context length, etc.); if upstream error message uses uncommon wording and doesn't hit 401/403, may be misclassified as transient error triggering pointless retries—can close classify to switch to full resume.
  • Browser notifications depend on browser Notification API and user authorization; if denied, won't request again.

Read the usage guide →

Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.

Listing badge

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/HsiangNianian/dsh-auto-continue)

Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.

← Back to plugin directory