dsh-client-auto-continue 0.18.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/README.md +230 -310
- package/README.ru.md +382 -0
- package/README.zh.md +229 -308
- package/docs/auto-continue-workflow.archify.json +3 -3
- package/docs/auto-continue-workflow.en.archify.json +3 -3
- package/docs/auto-continue-workflow.en.html +1 -1
- package/docs/auto-continue-workflow.html +1 -1
- package/docs/auto-continue-workflow.ru.svg +530 -0
- package/docs/banner-ru-dark.svg +38 -0
- package/docs/banner-ru.svg +38 -0
- package/docs/demo-ru-static.svg +115 -0
- package/docs/demo-ru.svg +147 -0
- package/docs/releases/v0.19.0.md +62 -0
- package/docs/releases/v0.20.0.md +46 -0
- package/docs/social-preview.png +0 -0
- package/docs/social-preview.svg +30 -1
- package/lib/client.js +297 -99
- package/lib/client.js.map +3 -3
- package/lib/index.js +496 -43
- package/lib/types/client/auto-continue-icon.d.ts +7 -0
- package/lib/types/client/bridge.d.ts +2 -0
- package/lib/types/client/composer-toggle.d.ts +2 -0
- package/lib/types/client/locales.d.ts +5 -0
- package/lib/types/client/settings-card.d.ts +1 -0
- package/lib/types/host/engine.d.ts +88 -4
- package/lib/types/index.d.ts +8 -0
- package/lib/types/shared/core.d.ts +21 -1
- package/locale/ru.json +6 -0
- package/package.json +5 -3
- package/scripts/build-docs-assets.mjs +126 -0
- package/src/client/auto-continue-icon.tsx +6 -27
- package/src/client/bridge.ts +26 -6
- package/src/client/composer-toggle.tsx +22 -11
- package/src/client/index.ts +5 -1
- package/src/client/locales.ts +215 -40
- package/src/client/settings-card.tsx +8 -2
- package/src/client/settings-notifications.ts +3 -2
- package/src/client/styles.ts +17 -19
- package/src/host/engine.ts +571 -41
- package/src/host/settings-migration.ts +1 -1
- package/src/index.ts +23 -1
- package/src/shared/core.ts +32 -2
package/README.md
CHANGED
|
@@ -5,384 +5,298 @@
|
|
|
5
5
|
</picture>
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
|
-
<h1 align="center">dsh-auto-continue</h1>
|
|
9
|
-
|
|
10
8
|
<p align="center">
|
|
11
|
-
<
|
|
9
|
+
A <a href="https://github.com/deepseek-ai/deepseek-harness">DeepSeek Harness</a> plugin that resumes interrupted sessions for you, with an optional autonomous loop.
|
|
12
10
|
</p>
|
|
13
11
|
|
|
14
12
|
<p align="center">
|
|
15
13
|
<a href="https://www.npmjs.com/package/dsh-client-auto-continue"><img src="https://img.shields.io/npm/v/dsh-client-auto-continue?logo=npm&label=npm" alt="npm version"></a>
|
|
16
14
|
<a href="https://www.npmjs.com/package/dsh-client-auto-continue"><img src="https://img.shields.io/npm/dm/dsh-client-auto-continue?label=downloads" alt="npm downloads"></a>
|
|
17
15
|
<a href="https://github.com/HsiangNianian/dsh-auto-continue/stargazers"><img src="https://img.shields.io/github/stars/HsiangNianian/dsh-auto-continue?logo=github&label=Stars" alt="GitHub stars"></a>
|
|
18
|
-
<a href="
|
|
19
|
-
<br>
|
|
16
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-65a30d" alt="MIT license"></a>
|
|
20
17
|
<a href="https://awesome-dsh-plugin.com"><img src="https://awesome-dsh-plugin.com/badge.svg" alt="awesome · DSH plugin"></a>
|
|
21
18
|
<a href="https://www.dsh.so/artifact/dsh-auto-continue/"><img src="https://www.dsh.so/badge/install/dsh-auto-continue.svg" alt="dsh.so install"></a>
|
|
22
|
-
<br>
|
|
23
|
-
<img src="https://img.shields.io/badge/TypeScript-3178C6?style=flat&logo=typescript&logoColor=fff" alt="TypeScript">
|
|
24
|
-
<img src="https://img.shields.io/badge/esbuild-FFCF00?style=flat&logo=esbuild&logoColor=000" alt="esbuild">
|
|
25
|
-
<img src="https://img.shields.io/badge/GUI--configurable-0ea5e9?style=flat" alt="GUI configurable">
|
|
26
19
|
</p>
|
|
27
20
|
|
|
28
21
|
<p align="center">
|
|
29
|
-
<b>English</b> · <a href="README.zh.md">中文</a> · <a href="CHANGELOG.md">Changelog</a>
|
|
22
|
+
<b>English</b> · <a href="README.zh.md">中文</a> · <a href="README.ru.md">Русский</a> · <a href="CHANGELOG.md">Changelog</a>
|
|
30
23
|
</p>
|
|
31
24
|
|
|
32
|
-
|
|
25
|
+
## Contents
|
|
26
|
+
|
|
27
|
+
- [What it does](#what-it-does)
|
|
28
|
+
- [Install](#install)
|
|
29
|
+
- [Usage](#usage)
|
|
30
|
+
- [Configuration](#configuration)
|
|
31
|
+
- [How it works](#how-it-works)
|
|
32
|
+
- [Troubleshooting](#troubleshooting)
|
|
33
|
+
- [Privacy and permissions](#privacy-and-permissions)
|
|
34
|
+
- [Development](#development)
|
|
35
|
+
- [Links](#links)
|
|
36
|
+
- [License](#license)
|
|
33
37
|
|
|
34
|
-
## What
|
|
38
|
+
## What it does
|
|
35
39
|
|
|
36
|
-
|
|
40
|
+
When a turn fails with a recoverable error, hits the output limit, ends without visible output, or is cut off by a host restart, the plugin waits a few seconds and sends a continue message for you. It runs inside the DSH host, so it keeps working after you close the browser tab, and all tabs share one engine.
|
|
37
41
|
|
|
38
42
|
<p align="center">
|
|
39
43
|
<picture>
|
|
40
44
|
<source media="(prefers-reduced-motion: reduce)" srcset="docs/demo-static.svg">
|
|
41
|
-
<img src="docs/demo.svg" alt="Recovery demo: a network
|
|
45
|
+
<img src="docs/demo.svg" alt="Recovery demo: a network error interrupts the assistant, the plugin waits 3 seconds, sends Continue, and the assistant resumes." width="720">
|
|
42
46
|
</picture>
|
|
43
47
|
</p>
|
|
44
48
|
|
|
45
|
-
**
|
|
46
|
-
|
|
47
|
-
- **
|
|
48
|
-
- **
|
|
49
|
-
- **
|
|
50
|
-
- **
|
|
51
|
-
- **
|
|
52
|
-
- **Templated continue text** — `continueText` supports `{code}` `{message}` `{status}` `{tool}` `{turn}` `{errorCount}` `{elapsed}` placeholders, so the resume message can carry the failure context ("Continue ({tool} failed: {code})"); a **separate template** fires on `max-tokens` (e.g. "Continue the output without repeating anything already generated")
|
|
53
|
-
- **Idempotency guard** — before resuming, the plugin inspects the last tool call: if its result is unconfirmed (the turn died mid-tool, e.g. a `git push` that may have gone through), the resume message tells the model to check state first and not to rerun; if the tool is confirmed done, it says so and asks not to repeat it; a failed tool gets no guard (retrying it is the point). Both guard texts are configurable (`{tool}` / `{result}` placeholders)
|
|
54
|
-
- **Silent turn resume** — recover an observed model step or reasoning-only response that completes without visible output. A no-op turn with no model activity is left alone. Text, tool calls, images and extension blocks count as visible, including streamed output. Unobserved turns are not guessed to be silent. Explicit `no-visible-output` markers also recover after restart. Disabling **Resume silent turns** cancels queued silent sends; silent turns never reset the retry cap, even while the option is off.
|
|
55
|
-
- **Autonomous loop** — off by default (`resumeCompletedTurns`). When enabled, normally completed turns continue after the grace period, without the recovery cooldown or attempt cap. Reasoning-only turns and explicit `no-visible-output` endings still consume the recovery budget and obey backoff. Global pause, a session pause, manual Stop or changing that session to Recovery only / Off stops the loop. The profile default only affects sessions using Follow default. Its prompt is separate from the loop guard’s prompt (`continueTextLoop`, default `Continue`). `loopMaxIterations` caps the rounds per session (0 = unlimited, the default): once reached, the loop stops and reports it once (log line, plus a notification when notifications are on). Sending a message yourself or turning the loop back on starts the count over
|
|
56
|
-
- **Pause** — turning off **Enable auto-continue globally** in **General** and saving stops automatic sends from live events and startup scanning; per-session pauses (e.g. via a notification button) suspend only one session until they expire. **Resume now** requests one send even when both pauses are active. It leaves the pauses in place, so later automatic recovery and autonomous-loop sends remain paused
|
|
57
|
-
- **Notification buttons** — notifications carry **Resume now** (send immediately, ignoring cooldown, the consecutive cap and any pause) and **Pause this session 1h** actions
|
|
58
|
-
- **Child-session hand-off** — opt-in (`resumeInterruptedChildren`, off by default): when the startup scan finds subagent or team-member sessions that a restart interrupted, the plugin sends each **root session** one message listing those children, once per batch. The child itself is still never resumed — the root decides whether to continue each task or wrap it up. A wake only goes to a parent whose own last turn ended cleanly or was closed by that same restart; a parent still mid-turn is left to the normal recovery path, and one you stopped yourself is never woken
|
|
59
|
-
- **Goal re-arm** — opt-in (`resumeGoals`, off by default): after any auto-continue send (or a child-session wake-up), re-arm an `active` goal that the host disarmed on restart, so its continuation rounds can run again. **Resume paused goals** (`resumePausedGoals`) additionally resumes goals you paused by hand, and only takes effect when `resumeGoals` is on as well
|
|
60
|
-
- **Loop guard** — watches **running** turns too. Four signals trip the guard, which cancels the turn and restarts it with a configurable loop text ("stop repeating, try another way"): the model repeating the **exact same message** several times (any length — e.g. "Let me test variants of the regex…" ×7), repeated near-duplicate paragraphs **inside one streamed assistant message**, many short messages inside a short time window with no tool call in between (the "Let me read…" spin), or the same tool called repeatedly with the **same arguments and the same results** (a changed argument or result counts as progress). The cancel carries an internal marker so it is never confused with a user stop — the restart only happens for guard-initiated cancels. Thresholds, the time window and the loop text are configurable
|
|
61
|
-
- **Stats panel** — the settings card shows today's auto-continue count, recoveries, failures, permanent skips, give-ups and loop breaks, broken down by error code, with a one-click reset
|
|
62
|
-
- **Browser notifications** — optional alerts for auto-continue events and successful settings saves. Saving a change to the notification switch confirms its new state, including one final confirmation when turning it off. The browser may ask for permission when you enable it; a denial is explained in the settings page and does not prevent saving.
|
|
63
|
-
|
|
64
|
-
It watches the live event streams and reacts to:
|
|
65
|
-
|
|
66
|
-
| Event | Meaning |
|
|
67
|
-
| --- | --- |
|
|
68
|
-
| `turn/end` → `error` | Turn failed (model / network / timeout, …) |
|
|
69
|
-
| `turn/end` → `interrupted` | Crash-orphaned turn left behind by a host restart (recovered by the startup scan) |
|
|
70
|
-
| `turn/end` → `max-tokens` | Output token ceiling reached |
|
|
71
|
-
| `turn/end` → `completed` / `no-visible-output` with no visible output | Observed model activity without visible output, or an explicit silent-ending marker |
|
|
72
|
-
| `turn/end` → `completed` | Continue a normal completion only when autonomous loop is enabled |
|
|
73
|
-
|
|
74
|
-
What each kind of turn gets, and which switch gates it:
|
|
75
|
-
|
|
76
|
-
| Scenario | Auto-continues? | Trigger path | Gated by |
|
|
77
|
-
| --- | --- | --- | --- |
|
|
78
|
-
| This session's turn failed, hit the output ceiling, or was closed by a host restart | Yes — one followup message in the same session | Live event, or the startup scan after a restart | **Enable auto-continue globally**, the session mode, **Scan on host startup** (`scanOnBoot`) |
|
|
79
|
-
| This session's turn ended with no visible output | Yes | Live event, or the startup scan | **Resume silent turns** (`resumeSilentTurns`) |
|
|
80
|
-
| This session's turn completed normally | Only in **Autonomous loop** | `turn/end` → `completed` | `resumeCompletedTurns` / the session mode |
|
|
81
|
-
| A subagent or team-member session was interrupted by a restart | **No** — the child session is never resumed directly | Startup scan collects the list, then sends **one wake-up message to its root session** | `resumeInterruptedChildren` (off by default) |
|
|
82
|
-
| The session carries an `active` goal that the restart disarmed | Not by itself: the resumed turn needs the goal armed again | After any auto-continue send for that session | `resumeGoals` (off by default) |
|
|
83
|
-
| The session carries a goal you paused by hand | Only if you opt in | Same path | `resumeGoals` **and** `resumePausedGoals` (both off by default) |
|
|
84
|
-
|
|
85
|
-
**Recovery stops for:** manual Stop, policy rejection (`blocked`), paused sessions, subagent sessions and the consecutive-attempt cap. A new turn or manual user message cancels a queued continuation. Live `interrupted` markers are left to the startup recovery scan. Recoverable failures during cooldown are **deferred**, not discarded. If an interrupted session already has queued turns, the continuation runs first and the existing turns retain their order behind it. The loop guard can separately cancel and restart a running turn that is repeating itself.
|
|
86
|
-
|
|
87
|
-
Subagent sessions stay under their parent agent's control. The plugin skips them during live recovery and startup scanning, ignores **Resume now** for them, and leaves them out of loop-guard cancellation. Any queued recovery is cancelled when a session is identified as a subagent. The optional **Wake child sessions after restart** (`resumeInterruptedChildren`, off by default) does not change that: the plugin still never resumes a child, it only tells the child's root session which children a restart interrupted, so the root can continue them or wrap them up.
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
## How It Works
|
|
92
|
-
|
|
93
|
-
The host-side engine subscribes to the session event firehose inside the dsh host process — one engine shared by every browser tab. On an interruption it waits a **grace period** (default 3 s) — if the host starts a new turn by itself (`turn/start`), the auto-continue is cancelled — then sends the configured text through the agent registry (`agent.followup`, the same queue the Send button uses). When that queue already contains turns, the engine promotes only its newly inserted continuation before the host wakes the agent; it does not remove or reorder the queued user turns.
|
|
94
|
-
|
|
95
|
-
On host boot it also scans the live sessions: a session whose last turn ended with a non-human reason **within the scan window** (default 15 minutes), with no later `turn/start` or user message, gets resumed automatically too (e.g. the host crashed while the browser was closed — the agent-loop resumes the session and the engine picks it up). Persisted sessions the host never reloaded are enumerated from session storage and materialized into the registry first; a journal that stopped mid-turn is completed with an interrupted marker on read, so restart-orphaned turns are recovered the same way.
|
|
96
|
-
|
|
97
|
-
Storage scanning runs separately from live-session recovery. Each storage read has a five-second timeout, and the scan yields every 16 observations without waiting for the next polling interval. This lets recently interrupted sessions deep in the storage listing be reached within the startup window. Recovery restores the session's preset and recorded model; stopping the plugin cancels pending storage work.
|
|
98
|
-
|
|
99
|
-
Startup recovery isolates failures per session. If history cannot be read or contains invalid events, that session is skipped for the current startup scan and an error is logged; other sessions can still recover, without losing a recovery slot. Invalid entries are not silently removed, since they could hide a manual stop or a newer turn. Valid empty histories and a registry that is still loading remain retryable within the scan window. Reloading a repaired session as a new session object also makes it eligible for scanning again. See [#58](https://github.com/HsiangNianian/dsh-auto-continue/issues/58).
|
|
100
|
-
|
|
101
|
-
The browser provides the settings card and the composer switch and mode menu, plus a status bridge that shows notifications (with Resume now / Pause this session 1h buttons, routed back to the host engine) and feeds the card's stats / paused-sessions panels.
|
|
102
|
-
|
|
103
|
-
### Recovery workflow
|
|
104
|
-
|
|
105
|
-
The diagram summarizes the automatic recovery path, the loop-guard restart path, and the exit to human intervention. Click it to open the full-size version.
|
|
106
|
-
|
|
107
|
-
[](docs/auto-continue-workflow.en.svg)
|
|
108
|
-
|
|
109
|
-
## Quick Start
|
|
110
|
-
|
|
111
|
-
DSH plugins install into a **profile** (`dsh web` → `web` profile). The commands below install into the web profile; restart `dsh web` after installation. In the desktop app, install through its **Plugins** page instead.
|
|
112
|
-
|
|
113
|
-
### Compatibility
|
|
114
|
-
|
|
115
|
-
| DSH runtime | Plugin version | Configuration entry point |
|
|
116
|
-
| --- | --- | --- |
|
|
117
|
-
| **0.2.2-rc.1** | **0.18.0 verified** | **Plugins → dsh-client-auto-continue** |
|
|
118
|
-
| **0.2.1-rc.2** | **0.18.0 verified** | **Plugins → dsh-client-auto-continue** |
|
|
119
|
-
| **0.2.1-alpha.1** | **0.18.0 verified** | **Plugins → dsh-client-auto-continue** |
|
|
120
|
-
| **0.2.0-rc.1** | **0.12.1 or newer** | **Plugins → dsh-client-auto-continue** |
|
|
121
|
-
| **0.1.7-rc.2** | **0.11.9 or newer** | Same Plugins page |
|
|
122
|
-
| Older hosts with the legacy settings API | Legacy UI retained | **Settings → Plugins → Plugin configuration** |
|
|
123
|
-
|
|
124
|
-
DSH 0.1.0-rc.6 and earlier are unsupported. Automated settings and compatibility checks cover **0.1.7-rc.2**, **0.2.0-rc.1**, **0.2.1-alpha.1** and **0.2.1-rc.2**; startup failure isolation is also checked against **0.2.0-rc.2** and **0.2.1-alpha.1**. Desktop app versions and embedded DSH runtime versions are different; use the runtime version when checking compatibility. For the CLI, run `dsh --version`; see [official DSH releases](https://github.com/deepseek-ai/deepseek-harness/releases) for available versions.
|
|
49
|
+
- **Error recovery.** Network errors, timeouts, 5xx and 429 are retried with a grace period, a cooldown that grows after each failure, and a cap on consecutive attempts. Permanent errors (auth, balance, unknown model, context too long) are skipped.
|
|
50
|
+
- **Offline hold.** Network failures wait for the connection to come back instead of burning retries.
|
|
51
|
+
- **Startup recovery.** After a host restart, sessions interrupted in the last 15 minutes are resumed, including ones you have not reopened.
|
|
52
|
+
- **Per-session modes.** A switch next to the message box sets each conversation to Follow default, Off, Recovery only or Autonomous loop.
|
|
53
|
+
- **Autonomous loop (opt-in).** Keep a session going after normal completions, with an optional round limit.
|
|
54
|
+
- **Safety.** An idempotency guard tells the model whether the last tool call finished, and a loop guard stops turns that repeat themselves.
|
|
55
|
+
- **Visibility.** A settings page with today's statistics, recent recovery attempts and paused sessions, plus optional browser notifications with **Resume now** and **Pause this session 1h** buttons.
|
|
125
56
|
|
|
126
|
-
|
|
57
|
+
## Install
|
|
127
58
|
|
|
128
|
-
|
|
59
|
+
DSH plugins install into a profile; `dsh web` uses the `web` profile. In the desktop app, install from its **Plugins** page instead of the CLI.
|
|
129
60
|
|
|
130
61
|
### From npm (recommended)
|
|
131
62
|
|
|
132
|
-
Published as [`dsh-client-auto-continue`](https://www.npmjs.com/package/dsh-client-auto-continue):
|
|
133
|
-
|
|
134
63
|
```bash
|
|
135
64
|
dsh plugin --profile web add dsh-client-auto-continue@latest
|
|
136
65
|
dsh web
|
|
137
66
|
```
|
|
138
67
|
|
|
139
|
-
|
|
68
|
+
Restart DSH and reload the browser after installing. Then open **Plugins → dsh-client-auto-continue** from the main sidebar to check that it is **Running**.
|
|
69
|
+
|
|
70
|
+
To update, let running work finish, stop DSH, run the same command again, then restart DSH and reload the browser. Your settings stay in the profile. The desktop app has its own profile: update it from the app's **Plugins** page.
|
|
71
|
+
|
|
72
|
+
### Compatibility
|
|
73
|
+
|
|
74
|
+
| DSH runtime | Plugin version | Settings location |
|
|
75
|
+
| --- | --- | --- |
|
|
76
|
+
| 0.2.2-rc.1, 0.2.1-rc.2, 0.2.1-alpha.1 | 0.20.0 verified | **Plugins → dsh-client-auto-continue** |
|
|
77
|
+
| 0.2.0-rc.1 | 0.12.1 or newer | **Plugins → dsh-client-auto-continue** |
|
|
78
|
+
| 0.1.7-rc.2 | 0.11.9 or newer | **Plugins → dsh-client-auto-continue** |
|
|
79
|
+
| Older hosts with the legacy settings API | legacy UI | **Settings → Plugins → Plugin configuration** |
|
|
140
80
|
|
|
141
|
-
|
|
81
|
+
DSH 0.1.0-rc.6 and earlier are not supported. Plugin 0.11.9 and 0.12.0 are rejected by DSH 0.2.0-rc.1's version check ([#50](https://github.com/HsiangNianian/dsh-auto-continue/issues/50)). The desktop app's version is not the DSH runtime version; check the runtime (`dsh --version` for the CLI).
|
|
142
82
|
|
|
143
|
-
|
|
83
|
+
<details>
|
|
84
|
+
<summary>Install from GitHub (tracks <code>main</code>)</summary>
|
|
144
85
|
|
|
145
|
-
|
|
86
|
+
Built files are committed, so no clone or build is needed:
|
|
146
87
|
|
|
147
88
|
```bash
|
|
148
89
|
dsh plugin --profile web add github:HsiangNianian/dsh-auto-continue
|
|
149
90
|
dsh web
|
|
150
91
|
```
|
|
151
92
|
|
|
152
|
-
|
|
93
|
+
This follows the `main` branch rather than releases. To switch install sources, run `dsh plugin --profile web add <other-spec>`; the profile dependency is replaced in place.
|
|
153
94
|
|
|
154
|
-
|
|
95
|
+
</details>
|
|
96
|
+
|
|
97
|
+
<details>
|
|
98
|
+
<summary>Install from a local checkout</summary>
|
|
155
99
|
|
|
156
|
-
Use Node.js 22
|
|
100
|
+
Use Node.js 22.
|
|
157
101
|
|
|
158
102
|
```bash
|
|
159
103
|
git clone https://github.com/HsiangNianian/dsh-auto-continue.git
|
|
160
104
|
cd dsh-auto-continue
|
|
161
105
|
npm ci
|
|
162
106
|
npm run build
|
|
163
|
-
|
|
164
|
-
# the package carries its own cordis.patch.yml (dsh.bundle.patch),
|
|
165
|
-
# so the plugin row registers itself
|
|
166
107
|
dsh plugin --profile web add "link:$(pwd)"
|
|
167
|
-
|
|
168
108
|
dsh web
|
|
169
109
|
```
|
|
170
110
|
|
|
171
|
-
|
|
111
|
+
The package ships its own `cordis.patch.yml` (`dsh.bundle.patch`), so the plugin registers itself. After editing the code, run `npm run build`, restart DSH and reload the browser.
|
|
112
|
+
|
|
113
|
+
</details>
|
|
114
|
+
|
|
115
|
+
<details>
|
|
116
|
+
<summary>Migrating an older manual installation</summary>
|
|
172
117
|
|
|
173
|
-
|
|
118
|
+
Older setups used a symlink plus a hand-written `insert` row in the loader config. That can start the engine without showing the plugin on the **Plugins** page.
|
|
174
119
|
|
|
175
|
-
1. Let
|
|
176
|
-
2.
|
|
177
|
-
3. Install with
|
|
178
|
-
4.
|
|
120
|
+
1. Let running work finish and stop `dsh web`. Back up `package.json`, `cordis.patch.yml` and `pnpm-lock.yaml` in `~/.dsh/profiles/web/`, and `~/.dsh/settings.yaml` if it exists (use `$DSH_HOME` instead of `~/.dsh` if you set it).
|
|
121
|
+
2. In `cordis.patch.yml`, remove only the hand-written `auto-continue` row inside an `insert` list (and the list if it becomes empty). Keep a top-level `- id: auto-continue` entry with `config:`; that is your settings.
|
|
122
|
+
3. Install with the npm or GitHub command above. The profile's `package.json` should now list `dsh-client-auto-continue` under `dsh.profile.bundles`.
|
|
123
|
+
4. If you had settings in the old `settings.yaml` `auto-continue` section, merge them into the profile's `cordis.patch.yml` entry:
|
|
179
124
|
|
|
180
125
|
```yaml
|
|
181
126
|
- id: auto-continue
|
|
182
127
|
config:
|
|
183
|
-
cooldownMs: 45000 #
|
|
128
|
+
cooldownMs: 45000 # your own saved value
|
|
184
129
|
```
|
|
185
130
|
|
|
186
|
-
|
|
187
|
-
5. Start `dsh web` again and reload the browser. Open **Plugins → dsh-client-auto-continue**, select the appropriate settings category, and check that your values are present. Save a change and reload to confirm it persists.
|
|
131
|
+
5. Start `dsh web`, reload the browser, open **Plugins → dsh-client-auto-continue** and check your values.
|
|
188
132
|
|
|
189
|
-
|
|
133
|
+
On hosts that offer both profile config and the legacy settings API ([#64](https://github.com/HsiangNianian/dsh-auto-continue/issues/64)), the plugin imports the `auto-continue` section of `$DSH_HOME/settings-legacy.yaml` once per profile. Values already in the profile win, and the old file is left untouched. Recovery waits until the import is done; if the import fails, the host logs an error and recovery stays held until you fix the file or permissions and restart.
|
|
190
134
|
|
|
191
|
-
|
|
135
|
+
The `include:auto-continue` label under **Built-in plugins** is the normal loader prefix, not a sign of a duplicate install.
|
|
192
136
|
|
|
193
|
-
|
|
137
|
+
</details>
|
|
194
138
|
|
|
195
|
-
|
|
139
|
+
<details>
|
|
140
|
+
<summary>Verify and uninstall</summary>
|
|
196
141
|
|
|
197
142
|
```bash
|
|
143
|
+
# the composed config should contain exactly one auto-continue entry
|
|
198
144
|
dsh --profile web --dump-config | grep -A 4 'id: auto-continue'
|
|
199
|
-
```
|
|
200
145
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
```bash
|
|
204
|
-
dsh plugin --profile web remove dsh-client-auto-continue # npm / repo install
|
|
205
|
-
# also remove this plugin's config override from cordis.patch.yml, if present
|
|
206
|
-
dsh web
|
|
146
|
+
# uninstall
|
|
147
|
+
dsh plugin --profile web remove dsh-client-auto-continue
|
|
207
148
|
```
|
|
208
149
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
## Troubleshooting
|
|
150
|
+
Also remove the `- id: auto-continue` entry from the profile's `cordis.patch.yml`, if there is one, then restart DSH.
|
|
212
151
|
|
|
213
|
-
|
|
214
|
-
- **Enabled, but no configuration fields:** open the main **Plugins** page, select the package and open **General**. The Built-in plugins status page has no editable fields.
|
|
215
|
-
- **`/api/auto-continue-bridge` returns 404:** check the DSH startup log and composed config to confirm the host component loaded. Refreshing the settings card cannot start a missing host component.
|
|
152
|
+
</details>
|
|
216
153
|
|
|
217
|
-
|
|
154
|
+
## Usage
|
|
218
155
|
|
|
219
|
-
|
|
156
|
+
Recovery is on by default. Nothing else needs to be set up.
|
|
220
157
|
|
|
221
|
-
|
|
158
|
+
### Session modes
|
|
222
159
|
|
|
223
|
-
|
|
224
|
-
Use the mode menu next to the switch to choose a mode:
|
|
160
|
+
The **Auto-continue** switch next to the message box applies to the current conversation only. The menu beside it picks a mode:
|
|
225
161
|
|
|
226
|
-
| Mode |
|
|
162
|
+
| Mode | What happens |
|
|
227
163
|
| --- | --- |
|
|
228
|
-
| Follow default |
|
|
229
|
-
| Off | No automatic
|
|
230
|
-
| Recovery only |
|
|
231
|
-
| Autonomous loop | Also
|
|
232
|
-
|
|
233
|
-
For example, keep A looping, B recovering failures and C off. Each conversation's choice is saved in the host's profile settings (`sessionModes`), shared across tabs and retained after a host restart. Choosing Follow default explicitly removes that conversation's independent policy, including an inherited override.
|
|
234
|
-
|
|
235
|
-
**Enable auto-continue globally** in **General** remains the master control. Turning it off pauses all automatic followups without replacing individual choices; turning it back on restores those choices. Switching a conversation off cancels pending grace, cooldown and loop-guard retries. It leaves any current turn running. Switching Loop to Recovery only cancels pending autonomous followups. Re-enabling does not resurrect cancelled sends.
|
|
164
|
+
| Follow default | Uses **Default session mode** from the settings (Recovery only unless you change it) |
|
|
165
|
+
| Off | No automatic messages and no loop-guard interruptions in this conversation |
|
|
166
|
+
| Recovery only | Recovers errors, output limits, silent turns and restart interruptions; leaves normal completions alone |
|
|
167
|
+
| Autonomous loop | Also continues after every normal completion, using the loop text |
|
|
236
168
|
|
|
237
|
-
|
|
169
|
+
Turning the switch off selects Off; turning it on again selects Follow default. Choices are saved on the host right away (`sessionModes`), sync across tabs and survive restarts. Switching a conversation to Off cancels anything waiting to be sent but lets a running turn finish.
|
|
238
170
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
## Configuration
|
|
171
|
+
<p align="center">
|
|
172
|
+
<img src="docs/screenshots/08-composer-toggle.png" alt="Auto-continue switch and mode menu next to the message box" width="560">
|
|
173
|
+
</p>
|
|
244
174
|
|
|
245
|
-
|
|
175
|
+
In a narrow window the label and menu collapse to an icon. DS-Bot and dsh-pocket get the same compact layout up to 640 CSS pixels. To hide the controls, turn off **Show auto-continue switch in the composer** in **General** and save; this does not change any session's mode.
|
|
246
176
|
|
|
247
|
-
|
|
177
|
+
### Pausing and manual control
|
|
248
178
|
|
|
249
|
-
|
|
179
|
+
- **Enable auto-continue globally** (in **General**) is the master switch. Turning it off stops all automatic messages without forgetting per-session choices. The loop guard keeps running; turn off **Loop guard** too if you want no interruptions at all.
|
|
180
|
+
- **Pause this session 1h** (notification button) suspends one conversation for an hour.
|
|
181
|
+
- **Resume now** (notification button) sends one continue message immediately. It ignores cooldown, the consecutive limit and any pause, but does not lift the pause.
|
|
182
|
+
- Sending a message yourself, or a new turn starting, cancels any continue message that is still waiting.
|
|
250
183
|
|
|
251
|
-
|
|
184
|
+
### Status and logs
|
|
252
185
|
|
|
253
|
-
The
|
|
186
|
+
The **Status and logs** category shows today's counts (continue messages, recoveries, failures, skipped errors, give-ups, loop breaks, by error code, with a reset button), the last 20 recovery attempts grouped by session, and the sessions that are currently paused. These live in host memory and reset when the plugin restarts. With **Verbose logs** on, every decision is logged with an `[auto-continue]` prefix in the DSH log (the terminal running `dsh web` for the CLI).
|
|
254
187
|
|
|
255
|
-
|
|
188
|
+
## Configuration
|
|
256
189
|
|
|
257
|
-
|
|
190
|
+
Open **Plugins → dsh-client-auto-continue** from the main sidebar and pick a category. (**Settings → Built-in plugins** only lists component status; it is not the editor.) Edits are staged and take effect when you click **Save**; switching categories keeps your drafts, invalid values block the save, and **Reset to default** removes an override.
|
|
258
191
|
|
|
259
|
-
|
|
192
|
+

|
|
260
193
|
|
|
261
|
-
|
|
194
|
+
Settings are stored in the `auto-continue` entry of the active profile patch, `~/.dsh/profiles/web/cordis.patch.yml` for the default web profile (older hosts: `~/.dsh/settings.yaml`, under `auto-continue:`). You can edit the file directly; omitted keys use their defaults:
|
|
262
195
|
|
|
263
196
|
```yaml
|
|
264
197
|
- id: auto-continue
|
|
265
198
|
config:
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
usePluginSource: false
|
|
270
|
-
continueText: ''
|
|
271
|
-
resumeSilentTurns: true
|
|
272
|
-
resumeCompletedTurns: false
|
|
273
|
-
resumeInterruptedChildren: false # Startup recovery: wake the root session about interrupted children
|
|
274
|
-
resumeGoals: false # Retry strategy: re-arm a goal the host disarmed on restart
|
|
275
|
-
resumePausedGoals: false # Retry strategy: also resume goals paused by hand (needs resumeGoals)
|
|
276
|
-
pauseWhenOffline: true # Retry strategy: hold network-error retries while the host is offline
|
|
277
|
-
offlineCheckMs: 15000
|
|
278
|
-
loopMaxIterations: 0 # Autonomous loop rounds per session; 0 = unlimited
|
|
279
|
-
continueTextSilent: ''
|
|
280
|
-
continueTextLoop: ''
|
|
281
|
-
continueTextInterrupted: ''
|
|
282
|
-
continueTextMaxTokens: ''
|
|
283
|
-
guardTools: true
|
|
284
|
-
guardPendingText: ''
|
|
285
|
-
guardDoneText: ''
|
|
286
|
-
graceMs: 3000
|
|
287
|
-
cooldownMs: 20000
|
|
288
|
-
maxConsecutive: 3
|
|
289
|
-
scanOnBoot: true
|
|
290
|
-
scanLimit: 8
|
|
291
|
-
freshMs: 900000
|
|
292
|
-
verbose: true
|
|
293
|
-
classify: true
|
|
294
|
-
retryableErrorPatterns: ''
|
|
295
|
-
backoffFactor: 2
|
|
296
|
-
backoffMaxMs: 300000
|
|
297
|
-
notify: false
|
|
298
|
-
loopGuard: true
|
|
299
|
-
loopShortChars: 40
|
|
300
|
-
loopWindowMs: 30000
|
|
301
|
-
loopShortCount: 12
|
|
302
|
-
loopRepeatText: 4
|
|
303
|
-
loopToolRepeat: 5
|
|
304
|
-
loopText: ''
|
|
199
|
+
cooldownMs: 45000
|
|
200
|
+
resumeCompletedTurns: true
|
|
201
|
+
loopMaxIterations: 20
|
|
305
202
|
```
|
|
306
203
|
|
|
307
|
-
|
|
308
|
-
<summary>Configuration files on older DSH versions</summary>
|
|
309
|
-
|
|
310
|
-
Older hosts store user settings in `~/.dsh/settings.yaml` under the plugin namespace instead of a profile entry:
|
|
204
|
+
Times are in milliseconds. Text fields left empty use the built-in text in the current language.
|
|
311
205
|
|
|
312
|
-
|
|
313
|
-
auto-continue:
|
|
314
|
-
cooldownMs: 45000
|
|
315
|
-
```
|
|
206
|
+
### General
|
|
316
207
|
|
|
317
|
-
|
|
208
|
+
| Setting | Key | Default | Notes |
|
|
209
|
+
| --- | --- | --- | --- |
|
|
210
|
+
| Enable auto-continue globally | `paused` | `false` | Stored inverted: `paused: true` stops all automatic messages and cancels queued ones |
|
|
211
|
+
| Show auto-continue switch in the composer | `showComposerToggle` | `true` | Only hides or shows the controls |
|
|
212
|
+
| Send continue messages with plugin source | `usePluginSource` | `false` | Off sends as the `user` source; on marks messages as `plugin:dsh-client-auto-continue` |
|
|
213
|
+
| Resume silent turns | `resumeSilentTurns` | `true` | Resume turns that had model activity but no visible output; they still count toward **Max consecutive** |
|
|
214
|
+
| Resume subagent sessions | `resumeSubagentSessions` | `false` | Resume a failed, cut-off or silent subagent, using its main conversation's mode. When DSH already disposed the child, the engine cold-resumes it from its persisted session through the host subagent service; if the host cannot resume it, the failure is handed to the main conversation instead |
|
|
215
|
+
| Default session mode | `resumeCompletedTurns` | `false` | `false` = Recovery only, `true` = Autonomous loop, for sessions on Follow default |
|
|
216
|
+
| Autonomous loop round limit | `loopMaxIterations` | `0` | Loop rounds per session, `0` = no limit. Resets when you send a message or turn the loop back on |
|
|
217
|
+
| Browser notifications | `notify` | `false` | Notifications for sends, skips, give-ups and saved settings. The browser asks for permission the first time |
|
|
218
|
+
|
|
219
|
+
### Retry strategy
|
|
220
|
+
|
|
221
|
+
| Setting | Key | Default | Notes |
|
|
222
|
+
| --- | --- | --- | --- |
|
|
223
|
+
| Grace period (ms) | `graceMs` | `3000` | Wait before sending; a new turn or your own message cancels it |
|
|
224
|
+
| Cooldown (ms) | `cooldownMs` | `20000` | Minimum gap between recovery attempts in one session. A failure during cooldown waits for the rest of it |
|
|
225
|
+
| Max consecutive | `maxConsecutive` | `3` | Attempts before giving up. Resets when you send a message or a turn ends with visible output. Loop continuations after normal completions do not count |
|
|
226
|
+
| Classify errors | `classify` | `true` | Retry transient errors only; skip permanent ones. Off = retry every error |
|
|
227
|
+
| Custom retryable errors | `retryableErrorPatterns` | `''` | One literal per line, case-insensitive, matched against code, HTTP status and message. Overrides the built-in classifier |
|
|
228
|
+
| Backoff factor | `backoffFactor` | `2` | Cooldown multiplier per consecutive failure (20 s → 40 s → 80 s) |
|
|
229
|
+
| Max backoff (ms) | `backoffMaxMs` | `300000` | Upper bound for the cooldown |
|
|
230
|
+
| Pause while offline | `pauseWhenOffline` | `true` | Hold network-error retries while the host is offline, without using up attempts |
|
|
231
|
+
| Offline re-check interval (ms) | `offlineCheckMs` | `15000` | How often a held retry checks the network. Minimum 1000 |
|
|
232
|
+
| Re-arm goals disarmed by a restart | `resumeGoals` | `false` | After a continue message, re-arm an `active` goal the restart disarmed. This acts on your behalf, hence off |
|
|
233
|
+
| Resume paused goals | `resumePausedGoals` | `false` | Also resume goals you paused by hand. Needs `resumeGoals` |
|
|
234
|
+
|
|
235
|
+
### Startup recovery
|
|
236
|
+
|
|
237
|
+
| Setting | Key | Default | Notes |
|
|
238
|
+
| --- | --- | --- | --- |
|
|
239
|
+
| Scan on host startup | `scanOnBoot` | `true` | Look for interrupted sessions, open or stored, after the host starts |
|
|
240
|
+
| Wake child sessions after restart | `resumeInterruptedChildren` | `false` | Send each root session one message listing its interrupted subagent or team-member sessions |
|
|
241
|
+
| Scan limit | `scanLimit` | `8` | Recoveries per scan pass, most recently active first |
|
|
242
|
+
| Scan window (ms) | `freshMs` | `900000` | Only interruptions newer than this are recovered; scanning also stops after this long |
|
|
318
243
|
|
|
319
|
-
|
|
244
|
+
### Continue text
|
|
320
245
|
|
|
321
|
-
|
|
246
|
+
| Setting | Key | Used when |
|
|
247
|
+
| --- | --- | --- |
|
|
248
|
+
| Continue text | `continueText` | A turn failed with an error |
|
|
249
|
+
| Continue text (max tokens) | `continueTextMaxTokens` | The output token limit was reached |
|
|
250
|
+
| Continue text (silent turn) | `continueTextSilent` | A turn ended with reasoning only |
|
|
251
|
+
| Continue text (after harness restart) | `continueTextInterrupted` | The startup scan resumes a turn a restart cut off |
|
|
252
|
+
| Continue text (autonomous loop) | `continueTextLoop` | Each autonomous-loop round |
|
|
253
|
+
| Guard text (unconfirmed result) | `guardPendingText` | Appended when the last tool call may not have finished |
|
|
254
|
+
| Guard text (tool succeeded) | `guardDoneText` | Appended when the last tool call succeeded |
|
|
255
|
+
| Loop text | `loopText` | The loop guard restarted a turn |
|
|
322
256
|
|
|
323
|
-
|
|
257
|
+
All default to `''`, which means the built-in text. Continue texts accept `{code}`, `{message}`, `{status}`, `{tool}`, `{turn}`, `{errorCount}` and `{elapsed}`; for example `Continue ({tool}: {code})` becomes `Continue (git push: UPSTREAM)`. Guard texts and the loop text accept `{tool}`, and `guardDoneText` also `{result}` (a short excerpt of the tool output).
|
|
324
258
|
|
|
325
|
-
-
|
|
326
|
-
- If you edit or reset a field while a save is in progress, the newer draft stays in the card. Click **Save** again after the current save finishes to apply it
|
|
327
|
-
- An overridden field shows a **Reset to default** button that removes the override and restores the inherited value (normally the built-in default)
|
|
328
|
-
- Boolean fields use native switches and are staged until Save. **Reset to default** removes the override and restores the inherited value. **Enable auto-continue globally** is on when recovery is enabled (`paused: false`)
|
|
329
|
-
- Invalid drafts (non-numbers, values below the minimum) block the save and mark their category, even when another category is selected
|
|
330
|
-
- In a read-only deployment the card shows the stored values but disables editing while keeping category navigation available
|
|
331
|
-
- Changes apply immediately after Save and persist in the active profile config (or `~/.dsh/settings.yaml` on older hosts)
|
|
259
|
+
Built-in texts exist in English, Chinese and Russian. They follow the DSH language: `zh` and `zh-*` use Chinese, `ru` and `ru-*` use Russian, every other locale uses English. Your own non-empty text is never replaced when the language changes.
|
|
332
260
|
|
|
333
261
|
<details>
|
|
334
|
-
<summary>
|
|
262
|
+
<summary>Built-in English texts</summary>
|
|
335
263
|
|
|
336
|
-
|
|
264
|
+
| Key | Text |
|
|
265
|
+
| --- | --- |
|
|
266
|
+
| `continueText`, `continueTextMaxTokens`, `continueTextLoop` | `Continue` |
|
|
267
|
+
| `continueTextSilent` | `Continue. Your previous turn ended with internal reasoning only, with no message and no tool call, so nothing reached the user. Always finish a turn with a tool call or a visible answer.` |
|
|
268
|
+
| `continueTextInterrupted` | `Continue. The harness was restarted while your previous turn was still running; tool calls pending at the restart are recorded with unknown outcomes. Resume where you left off, verifying external state before retrying anything that may have side effects.` |
|
|
269
|
+
| `guardPendingText` | `(The previous tool "{tool}" may not have completed. Check its state before continuing and do not run it again.)` |
|
|
270
|
+
| `guardDoneText` | `(The previous tool "{tool}" completed successfully. Result: {result}; do not run it again. Continue from there.)` |
|
|
271
|
+
| `loopText` | `(You may be stuck in a loop. Stop repeating the last action and continue with a different approach.)` |
|
|
337
272
|
|
|
338
273
|
</details>
|
|
339
274
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
|
343
|
-
|
|
|
344
|
-
|
|
|
345
|
-
|
|
|
346
|
-
|
|
|
347
|
-
|
|
|
348
|
-
|
|
|
349
|
-
|
|
|
350
|
-
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
|
355
|
-
|
|
|
356
|
-
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
| Max consecutive | `3` | Consecutive recovery-attempt cap; resets on user intervention or an observed completion with visible output. Normal autonomous-loop handoffs are exempt |
|
|
366
|
-
| Pause while offline | `on` | **Retry strategy** — hold network-error retries while the host is offline, without using up consecutive attempts (`pauseWhenOffline`) |
|
|
367
|
-
| Offline re-check interval (ms) | `15000` | **Retry strategy** — how often a held retry checks the network again (`offlineCheckMs`, minimum 1000) |
|
|
368
|
-
| Re-arm goals disarmed by a restart | `off` | **Retry strategy** — after an auto-continue send, re-arm an `active` goal the host disarmed on restart, so its continuation rounds run again (`resumeGoals`). `goals.resume` performs no human-authorization check in the service layer, so calling it automatically acts on your behalf — that is why this is off by default |
|
|
369
|
-
| Resume paused goals | `off` | **Retry strategy** — also resume goals you paused by hand (`resumePausedGoals`). Pausing is normally a deliberate human decision; takes effect only together with **Re-arm goals disarmed by a restart** |
|
|
370
|
-
| Scan on host startup | `on` | Recover interrupted sessions that become available during the startup window |
|
|
371
|
-
| Scan limit | `8` | Maximum eligible recoveries per pass, most recently active first |
|
|
372
|
-
| Scan window (ms) | `900000` | Maximum interruption age and duration of startup polling |
|
|
373
|
-
| Wake child sessions after restart | `off` | **Startup recovery** — when the startup scan finds subagent / team-member sessions that a restart interrupted, send their root session one message listing them (`resumeInterruptedChildren`). Children are never resumed directly; at most 8 child logs are cold-read per pass, independent of **Scan limit** |
|
|
374
|
-
| Verbose logs | `on` | `[auto-continue]` engine logs in the DSH terminal |
|
|
375
|
-
| Classify errors | `on` | Auto-resume transient failures only; auth / balance / model errors are skipped and notified |
|
|
376
|
-
| Custom retryable errors | empty | One case-insensitive literal per line; matching the error code, HTTP status, or message explicitly overrides the built-in classifier |
|
|
377
|
-
| Backoff factor | `2` | Cooldown multiplier per consecutive failure (2 = 20s → 40s → 80s…) |
|
|
378
|
-
| Max backoff (ms) | `300000` | Cap on the adaptive backoff interval |
|
|
379
|
-
| Browser notifications | `off` | Notify about auto-continue events and successful settings saves; confirm switching notifications on or off |
|
|
380
|
-
|
|
381
|
-
Pausing auto-continue stops automatic follow-ups, but leaves the loop guard active. Disable **Loop guard** too if you want to stop automatic interruptions. Invisible-only text does not count as repeated visible output, and fresh tool calls reset the repeated-message streak; repeated tool calls with identical arguments and results are still checked independently.
|
|
382
|
-
|
|
383
|
-
`MALFORMED_RESPONSE` errors are retryable even when echoed tool arguments contain words such as `auth`, `permission` or `quota`. Explicit HTTP 401/403 failures are still skipped by the built-in classifier, and normal cooldown/backoff and retry limits still apply. This covers live errors and startup scans; the temporary `malformed_response` / `non-whitespace character after json` retry patterns from [#75](https://github.com/HsiangNianian/dsh-auto-continue/issues/75) are no longer needed.
|
|
384
|
-
|
|
385
|
-
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:
|
|
275
|
+
### Safety
|
|
276
|
+
|
|
277
|
+
| Setting | Key | Default | Notes |
|
|
278
|
+
| --- | --- | --- | --- |
|
|
279
|
+
| Idempotency guard | `guardTools` | `true` | Before resuming, tell the model whether the last tool call finished so it does not run it twice |
|
|
280
|
+
| Loop guard | `loopGuard` | `true` | Cancel a running turn that repeats itself and restart it with the loop text |
|
|
281
|
+
| Short-sentence max (chars) | `loopShortChars` | `40` | Messages shorter than this count as short sentences |
|
|
282
|
+
| Short-sentence window (ms) | `loopWindowMs` | `30000` | Window for counting short sentences. Minimum 1000 |
|
|
283
|
+
| Short-sentence threshold | `loopShortCount` | `12` | Short sentences in the window, with no tool call, that trip the guard |
|
|
284
|
+
| Identical message count | `loopRepeatText` | `4` | Identical messages in a row (or repeated paragraphs within one streamed message) that trip the guard |
|
|
285
|
+
| Same-tool repeat count | `loopToolRepeat` | `5` | Calls of the same tool with identical arguments and results that trip the guard |
|
|
286
|
+
|
|
287
|
+
### Status and logs
|
|
288
|
+
|
|
289
|
+
| Setting | Key | Default | Notes |
|
|
290
|
+
| --- | --- | --- | --- |
|
|
291
|
+
| Verbose logs | `verbose` | `true` | Log decisions with the `[auto-continue]` prefix |
|
|
292
|
+
|
|
293
|
+
Two keys are written by the plugin itself: `locale` (mirrors the DSH language, default `en`) and `sessionModes` (per-session choices from the composer, default `{}`). You normally do not edit them.
|
|
294
|
+
|
|
295
|
+
### Error classification
|
|
296
|
+
|
|
297
|
+
With **Classify errors** on, network errors, timeouts, HTTP 5xx and 429 are retried. HTTP 401 and 403, and codes or messages about auth, credentials or API keys, balance or quota, unknown models, or context length are treated as permanent and skipped (with a notification if enabled). `MALFORMED_RESPONSE` is always retryable unless it carries an explicit 401 or 403.
|
|
298
|
+
|
|
299
|
+
If a provider returns an error that you know is safe to retry (check first that typing "continue" by hand works), add a narrow, stable fragment instead of turning classification off:
|
|
386
300
|
|
|
387
301
|
```yaml
|
|
388
302
|
- id: auto-continue
|
|
@@ -391,70 +305,76 @@ For a provider-specific error that is safe to resume (confirm first that manuall
|
|
|
391
305
|
Upstream rejected the request as invalid
|
|
392
306
|
```
|
|
393
307
|
|
|
394
|
-
Patterns are
|
|
308
|
+
Patterns are plain substrings, not regular expressions. Cooldown and **Max consecutive** still apply.
|
|
395
309
|
|
|
396
|
-
|
|
310
|
+
## How it works
|
|
397
311
|
|
|
398
|
-
|
|
312
|
+
[](docs/auto-continue-workflow.en.html)
|
|
399
313
|
|
|
400
|
-
|
|
314
|
+
1. **Triggers.** The engine listens to session events in the host. A `turn/end` with `error`, `max-tokens`, a silent ending, or `completed` (loop mode only) starts the flow. After a host restart, the startup scan checks open and stored sessions every 3 seconds until the scan window ends. The loop guard watches running turns and cancels one that repeats itself.
|
|
315
|
+
2. **Session check.** Nothing is sent while auto-continue is paused globally, the session is Off or paused for an hour, or the session is a subagent and **Resume subagent sessions** is off. A subagent follows its main conversation's mode unless it has its own, and never runs the autonomous loop or the loop guard.
|
|
316
|
+
3. **End reason.** Manual Stop and policy blocks (`blocked`) are left alone, and so are permanent errors. Everything else recoverable goes to recovery. A normal completion only continues in Autonomous loop mode, which skips the cooldown and the consecutive limit but respects `loopMaxIterations`.
|
|
317
|
+
4. **Retry budget.** Recovery stops at **Max consecutive**. Inside the cooldown, the send is deferred rather than dropped. The cooldown is multiplied by the backoff factor after each failure, up to the maximum.
|
|
318
|
+
5. **Grace period.** The engine waits `graceMs`. A new turn or a message from you cancels the send.
|
|
319
|
+
6. **Offline hold.** For network errors, the host checks for a non-loopback network interface and one resolvable public name. While offline it waits and re-checks every `offlineCheckMs`, then goes through grace and cooldown again. With `HTTP(S)_PROXY` or `ALL_PROXY` set, only interfaces are checked.
|
|
320
|
+
7. **Send.** The engine picks the text for the reason, appends the idempotency-guard note, and sends it with `agent.followup` using the session's preset and model. If user turns are already queued, the continue message is moved ahead of them while their order is kept. With `resumeGoals` on, a goal the restart disarmed is re-armed.
|
|
401
321
|
|
|
402
|
-
|
|
322
|
+
**Child sessions.** Outside of **Resume subagent sessions**, subagent and team-member sessions are never resumed directly. With the setting on, a failed child is recovered in two steps: the engine first asks the host to cold-resume the disposed child from its persisted session, delivering the continuation to the child itself, so the main conversation is not woken; when the host cannot resume it (no persistence, no live parent, or a child that is not continuable), the failure is handed to the main conversation as one message, at most once per five minutes. That hand-off stays silent while the main conversation is recovering itself, because any user message cancels its queued continuation. If the main conversation has no live agent at that moment, the hand-off is kept until it is live again. A manual **Resume now** also cold-resumes a disposed child. After a restart, with **Wake child sessions after restart** on, the startup scan collects children a restart interrupted (at most 8 child logs per pass) and sends their root session one message listing them, once per batch. The root decides whether to continue or wrap up. A root still mid-turn is left to normal recovery, and a root you stopped yourself is never woken.
|
|
403
323
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
- Retry counters, cooldown timestamps, timed notification pauses and stats stay in host process memory and reset when the engine restarts. Session mode choices (`sessionModes`) and global `paused` are saved with your other configuration
|
|
408
|
-
- Browser notifications are opt-in (`notify` setting). Enabling and saving can request browser permission; denied permission is not requested again. Turning the option off never requests permission.
|
|
324
|
+
**Unreadable sessions.** If a session's history cannot be read during the startup scan, that session is skipped and an error is logged; other sessions still recover ([#58](https://github.com/HsiangNianian/dsh-auto-continue/issues/58)). Repair it and restart DSH within the scan window to try again.
|
|
325
|
+
|
|
326
|
+
## Troubleshooting
|
|
409
327
|
|
|
410
|
-
|
|
328
|
+
| Symptom | What to check |
|
|
329
|
+
| --- | --- |
|
|
330
|
+
| "Skipping profile bundle" or "incompatible with dsh 0.2.0-rc.1" | Update to plugin 0.12.1 or newer in the profile the app actually uses, then restart |
|
|
331
|
+
| Plugin enabled, but no settings fields | Open the main **Plugins** page, not **Settings → Built-in plugins**, and select **General** |
|
|
332
|
+
| `/api/auto-continue-bridge` returns 404 | The host component did not load. Check the DSH startup log and `--dump-config`, then reload the page |
|
|
333
|
+
| An error was not resumed | Check the global switch and the session mode. Look for `[auto-continue]` log lines: they say whether the error was classified as permanent, the session hit **Max consecutive**, or the retry is held offline |
|
|
334
|
+
| Sessions not resumed after a restart | **Scan on host startup** must be on, and the interruption must be newer than the scan window (15 minutes by default) |
|
|
335
|
+
| Settings are ignored after migrating | Make sure there is one top-level `- id: auto-continue` entry in `cordis.patch.yml` and no leftover `insert` row; see the migration notes under [Install](#install) |
|
|
336
|
+
| Compact composer layout missing on a phone | Restart DSH and reload the remote page after updating the plugin |
|
|
337
|
+
|
|
338
|
+
## Privacy and permissions
|
|
339
|
+
|
|
340
|
+
- The engine runs in the DSH host and reads session events and history through DSH services. No third-party service is contacted and no credentials are stored.
|
|
341
|
+
- Continue messages go through `agent.followup`; the loop guard may call `agent.cancel` first. A resumed agent keeps the session's existing tools and permissions.
|
|
342
|
+
- The offline check reads the local network interfaces and does a DNS lookup of `api.deepseek.com`, `www.baidu.com` and `one.one.one.one`. It opens no connection and sends no request.
|
|
343
|
+
- Settings are saved through DSH's settings API to the active profile (or `~/.dsh/settings.yaml` on older hosts). Retry counters, cooldowns, one-hour pauses and statistics are kept in memory only.
|
|
344
|
+
- Browser notifications are opt-in. Permission is requested only when you turn them on and save.
|
|
411
345
|
|
|
412
346
|
## Development
|
|
413
347
|
|
|
414
|
-
Use Node.js 22.
|
|
348
|
+
Use Node.js 22.
|
|
415
349
|
|
|
416
350
|
```bash
|
|
417
351
|
npm ci
|
|
418
|
-
npm ci --prefix tests/fixtures/dsh-0.1.7
|
|
419
|
-
npm ci --prefix tests/fixtures/dsh-0.2.0
|
|
420
|
-
npm ci --prefix tests/fixtures/dsh-0.2.0-rc.2
|
|
421
|
-
npm ci --prefix tests/fixtures/dsh-0.2.1
|
|
422
|
-
npm ci --prefix tests/fixtures/dsh-0.2.1-rc.2
|
|
423
352
|
npm run typecheck
|
|
424
353
|
npm run build
|
|
425
354
|
npm test
|
|
426
|
-
npm run test:runtime
|
|
427
355
|
```
|
|
428
356
|
|
|
429
|
-
`npm
|
|
430
|
-
|
|
431
|
-
The rc.2 check also loads the published client settings service and verifies card save/reset, per-session composer choices, concurrent saves, disk reloads, locale synchronization and a fresh Host read, using snapshots without the removed `mode` field.
|
|
432
|
-
|
|
433
|
-
The rc.2 restart test uses real agent, query, and JSONL persistence services: it kills a host mid-turn, starts a fresh host without opening the conversation, and checks one recovery with the recorded model and matching prompt variables. The model adapter is deterministic; no external model requests are made.
|
|
434
|
-
|
|
435
|
-
After editing a linked checkout, run `npm run build` to write the updated `lib/` files, then restart DSH and refresh the browser. Hosts with client HMR enabled can reload a rebuilt client bundle automatically.
|
|
436
|
-
|
|
437
|
-
CI typechecks, rebuilds, runs both test suites, verifies committed `lib/` artifacts and runs [dsh-plugin-check](https://github.com/omdsh-dev/dsh-plugin-check). The same checks gate releases. See [screenshot capture notes](docs/screenshots/README.md) when updating the UI documentation.
|
|
357
|
+
`npm run test:runtime` runs the settings, startup-recovery and restart tests against published DSH packages. Install the pinned fixtures first:
|
|
438
358
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
359
|
+
```bash
|
|
360
|
+
for v in 0.1.7 0.2.0 0.2.0-rc.2 0.2.1 0.2.1-rc.2; do npm ci --prefix "tests/fixtures/dsh-$v"; done
|
|
361
|
+
npm run test:runtime
|
|
362
|
+
```
|
|
442
363
|
|
|
443
|
-
|
|
364
|
+
The runtime tests drive real DSH services with a deterministic model adapter; they make no requests to a model provider. CI also checks that the committed `lib/` matches a fresh build and runs [dsh-plugin-check](https://github.com/omdsh-dev/dsh-plugin-check).
|
|
444
365
|
|
|
445
|
-
|
|
366
|
+
The banners and social preview are generated by `npm run docs:assets`; the workflow map is an [Archify](https://github.com/tt-a1i/archify) export (`docs/auto-continue-workflow.*`, sources in `*.archify.json`) (render the PNG with `rsvg-convert -w 1280 -h 640 docs/social-preview.svg -o docs/social-preview.png`). See [docs/screenshots/README.md](docs/screenshots/README.md) for how the screenshots are captured.
|
|
446
367
|
|
|
447
368
|
## Links
|
|
448
369
|
|
|
449
|
-
-
|
|
450
|
-
-
|
|
451
|
-
-
|
|
452
|
-
-
|
|
370
|
+
- Repository: [github.com/HsiangNianian/dsh-auto-continue](https://github.com/HsiangNianian/dsh-auto-continue)
|
|
371
|
+
- npm: [dsh-client-auto-continue](https://www.npmjs.com/package/dsh-client-auto-continue)
|
|
372
|
+
- DeepSeek Harness: [github.com/deepseek-ai/deepseek-harness](https://github.com/deepseek-ai/deepseek-harness)
|
|
373
|
+
- dsh-plugin-check: [github.com/omdsh-dev/dsh-plugin-check](https://github.com/omdsh-dev/dsh-plugin-check)
|
|
374
|
+
- LINUX DO: [linux.do](https://linux.do)
|
|
453
375
|
|
|
454
|
-
|
|
376
|
+
[](https://gitstock.org/HsiangNianian/dsh-auto-continue)
|
|
455
377
|
|
|
456
378
|
## License
|
|
457
379
|
|
|
458
|
-
[
|
|
459
|
-
|
|
460
|
-
MIT © Hsiang Nianian
|
|
380
|
+
[MIT](LICENSE) © Hsiang Nianian
|