HsiangNianian/dsh-auto-continue90

dsh-client-auto-continue

DSH Web UI plugin: automatically sends a localized continue prompt when a request is interrupted by network errors or other non-human causes

AI 분석

适合长文本生成任务,在遭遇网络波动中断时自动恢复对话,无需手动干预。

패키지
dsh-client-auto-continue
버전
0.11.6
라이선스
MIT
최근 업데이트
2026. 9. 12.

설치

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:HsiangNianian/dsh-auto-continue

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:

The collapsed Auto Continue card in the plugin configuration list

  • 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)
FieldDefaultDescription
Pause auto-continueoffGlobal pause: no live or scan auto-send fires, queued pending sends are cancelled
Continue textContinueText automatically sent after an interruption
Continue text (max tokens)ContinueText sent when the output token ceiling is reached (same placeholders)
Idempotency guardonInspect the last tool call before resuming and steer the model (see What It Does)
Loop guardonDetect a running turn spinning in place and restart it (see What It Does)
Short-sentence max (chars)40A model message shorter than this counts as a short sentence (spinning signal)
Short-sentence window (ms)30000Consecutive short sentences must land inside this window; normal thinking spread over time is not misjudged
Short-sentence threshold12Consecutive short sentences inside the window, with no tool call in between, trip the loop guard
Identical message count4Consecutive 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 count5Consecutive 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)3000Wait after an interruption; cancelled if the host recovers on its own
Cooldown (ms)20000Min interval between auto-continues per session (failed attempts count too)
Max consecutive3Max consecutive auto-continues; stops until a user intervenes or a turn completes
Scan on load / reconnectonScan recently interrupted sessions on load / reconnect
Scan limit8Max sessions scanned (running / subagent sessions excluded)
Scan window (ms)900000Scan only considers interruptions inside this window
Verbose logson[auto-continue] console logs
Classify errorsonAuto-resume transient failures only; auth / balance / model errors are skipped and notified
Custom retryable errorsemptyOne case-insensitive literal per line; matching the error code, HTTP status, or message explicitly overrides the built-in classifier
Backoff factor2Cooldown multiplier per consecutive failure (2 = 20s → 40s → 80s…)
Max backoff (ms)300000Cap on the adaptive backoff interval
Browser notificationsoffNotify 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).