HsiangNianian/dsh-auto-continue ↗★ 90
dsh-client-auto-continue
网络异常或非人为中断时自动发送继续指令
AI 分析
适合长文本生成任务,在遭遇网络波动中断时自动恢复对话,无需手动干预。
安裝
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:HsiangNianian/dsh-auto-continue說明文件
閱讀完整 README ↗Configuration
Everything is configurable from the GUI — no file or console edits needed. Open Settings → Plugins → Plugin configuration. Auto Continue appears as a collapsed card alongside the other plugins; click the card or its right-hand chevron to expand the full configuration in place. Besides the fields below, the expanded card shows a live stats panel (today's activity with a reset button) and the list of paused sessions (each with a per-session resume button).
The settings card groups controls by handoff, safety, recovery, loop breaking, and live status. Its header also keeps the open-source repository and a Star on GitHub shortcut within reach.
Or skip the GUI and edit the config file directly — the engine reads the plugin's section from ~/.dsh/settings.yaml (one shared file for every plugin's sections), so this works in any install, patched or not. The file is watched and re-read automatically, so changes apply live; restart dsh web if a page that was already open doesn't pick them up. Fields you leave out fall back to the defaults in the table below.
The browser mirrors DSH's active language into the internal locale field. Leave the five localized text fields empty or omit them to follow that language automatically; any non-empty value is treated as your own template and is never rewritten when the language changes:
auto-continue:
locale: 'en' # normally managed by the browser
paused: false
continueText: ''
continueTextMaxTokens: ''
guardTools: true
guardPendingText: ''
guardDoneText: ''
graceMs: 3000
cooldownMs: 20000
maxConsecutive: 3
scanOnBoot: true
scanLimit: 8
freshMs: 900000
verbose: true
classify: true
retryableErrorPatterns: ''
backoffFactor: 2
backoffMaxMs: 300000
notify: false
loopGuard: true
loopShortChars: 40
loopWindowMs: 30000
loopShortCount: 12
loopRepeatText: 4
loopToolRepeat: 5
loopText: ''
How the card works:

- Edits are staged — nothing reaches the disk until you hit Save; an unsaved badge marks the card while drafts are pending, and Discard drops them
- A field you changed shows an Overridden badge with a per-field Reset to default button that restores the built-in value
- Boolean fields are tri-state: Inherit (use the default) / On / Off
- Invalid drafts (non-numbers, values below the minimum) block the save with a hint
- In a read-only deployment the card shows the stored values but disables every control
- Changes apply immediately after Save and persist in
~/.dsh/settings.yaml(uninstalling the plugin leaves the section behind — harmless, delete it by hand if you like)
| Field | Default | Description |
|---|---|---|
| Pause auto-continue | off | Global pause: no live or scan auto-send fires, queued pending sends are cancelled |
| Continue text | Continue | Text automatically sent after an interruption |
| Continue text (max tokens) | Continue | Text sent when the output token ceiling is reached (same placeholders) |
| Idempotency guard | on | Inspect the last tool call before resuming and steer the model (see What It Does) |
| Loop guard | on | Detect a running turn spinning in place and restart it (see What It Does) |
| Short-sentence max (chars) | 40 | A model message shorter than this counts as a short sentence (spinning signal) |
| Short-sentence window (ms) | 30000 | Consecutive short sentences must land inside this window; normal thinking spread over time is not misjudged |
| Short-sentence threshold | 12 | Consecutive short sentences inside the window, with no tool call in between, trip the loop guard |
| Identical message count | 4 | Consecutive identical messages (any length) trip the loop guard — the strongest spinning signal; the same threshold is also used for repeated near-duplicate streamed paragraphs inside one message |
| Same-tool repeat count | 5 | Consecutive calls of the same tool with identical arguments and results trip the loop guard |
| Loop text | (You may be stuck in a loop. Stop repeating the last action and continue with a different approach.) | Text sent after the loop guard restarts a turn; {tool} placeholder |
| Guard text (unconfirmed result) | (The previous tool "{tool}" may not have completed. Check its state before continuing and do not run it again.) | Appended when the last tool may have partially executed; {tool} placeholder |
| Guard text (tool succeeded) | (The previous tool "{tool}" completed successfully. Result: {result}; do not run it again. Continue from there.) | Appended when the last tool is confirmed done; {tool} / {result} placeholders |
| Grace period (ms) | 3000 | Wait after an interruption; cancelled if the host recovers on its own |
| Cooldown (ms) | 20000 | Min interval between auto-continues per session (failed attempts count too) |
| Max consecutive | 3 | Max consecutive auto-continues; stops until a user intervenes or a turn completes |
| Scan on load / reconnect | on | Scan recently interrupted sessions on load / reconnect |
| Scan limit | 8 | Max sessions scanned (running / subagent sessions excluded) |
| Scan window (ms) | 900000 | Scan only considers interruptions inside this window |
| Verbose logs | on | [auto-continue] console logs |
| Classify errors | on | Auto-resume transient failures only; auth / balance / model errors are skipped and notified |
| Custom retryable errors | empty | One case-insensitive literal per line; matching the error code, HTTP status, or message explicitly overrides the built-in classifier |
| Backoff factor | 2 | Cooldown multiplier per consecutive failure (2 = 20s → 40s → 80s…) |
| Max backoff (ms) | 300000 | Cap on the adaptive backoff interval |
| Browser notifications | off | Notify when auto-continue fires, gives up, or hits a permanent error |
For a provider-specific error that is safe to resume (confirm first that manually sending "continue" recovers), add a narrow, stable fragment rather than disabling classification globally:
auto-continue:
retryableErrorPatterns: |-
Upstream rejected the request as invalid
Patterns are literal substrings, not regular expressions. Blank lines are ignored; any matching line wins before the built-in permanent-error rules. Cooldown and consecutive-attempt limits still apply.
continueText (and continueTextMaxTokens) accept the placeholders {code}, {message}, {status}, {tool} (last tool call before the failure), {turn}, {errorCount} (consecutive failures including this one), {sessionTitle} (from the session list) and {elapsed} (time since the failure, e.g. 1m5s) — e.g. Continue ({tool}: {code}) becomes Continue (git push: UPSTREAM). The guard texts accept {tool} and {result} (a truncated excerpt of the last tool output).