dsh-client-auto-continue 0.17.4 → 0.19.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 +47 -0
- package/README.md +230 -281
- package/README.ru.md +382 -0
- package/README.zh.md +229 -279
- 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.18.0.md +58 -0
- package/docs/releases/v0.19.0.md +62 -0
- package/docs/social-preview.png +0 -0
- package/docs/social-preview.svg +30 -1
- package/lib/client.js +347 -100
- package/lib/client.js.map +3 -3
- package/lib/index.js +790 -49
- 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 +19 -0
- package/lib/types/client/settings-card.d.ts +8 -0
- package/lib/types/host/connectivity.d.ts +4 -0
- package/lib/types/host/engine.d.ts +97 -5
- package/lib/types/index.d.ts +64 -0
- package/lib/types/shared/core.d.ts +54 -1
- package/locale/ru.json +6 -0
- package/package.json +6 -4
- 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 +241 -38
- package/src/client/settings-card.tsx +31 -4
- package/src/client/settings-notifications.ts +3 -2
- package/src/client/styles.ts +17 -19
- package/src/host/connectivity.ts +54 -0
- package/src/host/engine.ts +852 -40
- package/src/host/settings-migration.ts +1 -1
- package/src/index.ts +26 -1
- package/src/shared/core.ts +94 -3
package/README.md
CHANGED
|
@@ -5,355 +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
|
-
- **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)
|
|
53
|
-
- **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.
|
|
54
|
-
- **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`).
|
|
55
|
-
- **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
|
|
56
|
-
- **Notification buttons** — notifications carry **Resume now** (send immediately, ignoring cooldown, the consecutive cap and any pause) and **Pause this session 1h** actions
|
|
57
|
-
- **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
|
|
58
|
-
- **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
|
|
59
|
-
- **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.
|
|
60
|
-
|
|
61
|
-
It watches the live event streams and reacts to:
|
|
62
|
-
|
|
63
|
-
| Event | Meaning |
|
|
64
|
-
| --- | --- |
|
|
65
|
-
| `turn/end` → `error` | Turn failed (model / network / timeout, …) |
|
|
66
|
-
| `turn/end` → `interrupted` | Crash-orphaned turn left behind by a host restart (recovered by the startup scan) |
|
|
67
|
-
| `turn/end` → `max-tokens` | Output token ceiling reached |
|
|
68
|
-
| `turn/end` → `completed` / `no-visible-output` with no visible output | Observed model activity without visible output, or an explicit silent-ending marker |
|
|
69
|
-
| `turn/end` → `completed` | Continue a normal completion only when autonomous loop is enabled |
|
|
70
|
-
|
|
71
|
-
**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.
|
|
72
|
-
|
|
73
|
-
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.
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
## How It Works
|
|
78
|
-
|
|
79
|
-
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.
|
|
80
|
-
|
|
81
|
-
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.
|
|
82
|
-
|
|
83
|
-
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.
|
|
84
|
-
|
|
85
|
-
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).
|
|
86
|
-
|
|
87
|
-
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.
|
|
88
|
-
|
|
89
|
-
### Recovery workflow
|
|
90
|
-
|
|
91
|
-
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.
|
|
92
|
-
|
|
93
|
-
[](docs/auto-continue-workflow.en.svg)
|
|
94
|
-
|
|
95
|
-
## Quick Start
|
|
96
|
-
|
|
97
|
-
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.
|
|
98
|
-
|
|
99
|
-
### Compatibility
|
|
100
|
-
|
|
101
|
-
| DSH runtime | Plugin version | Configuration entry point |
|
|
102
|
-
| --- | --- | --- |
|
|
103
|
-
| **0.2.1-rc.2** | **0.17.4 verified** | **Plugins → dsh-client-auto-continue** |
|
|
104
|
-
| **0.2.1-alpha.1** | **0.17.4 verified** | **Plugins → dsh-client-auto-continue** |
|
|
105
|
-
| **0.2.0-rc.1** | **0.12.1 or newer** | **Plugins → dsh-client-auto-continue** |
|
|
106
|
-
| **0.1.7-rc.2** | **0.11.9 or newer** | Same Plugins page |
|
|
107
|
-
| Older hosts with the legacy settings API | Legacy UI retained | **Settings → Plugins → Plugin configuration** |
|
|
108
|
-
|
|
109
|
-
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.
|
|
110
56
|
|
|
111
|
-
|
|
57
|
+
## Install
|
|
112
58
|
|
|
113
|
-
|
|
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.
|
|
114
60
|
|
|
115
61
|
### From npm (recommended)
|
|
116
62
|
|
|
117
|
-
Published as [`dsh-client-auto-continue`](https://www.npmjs.com/package/dsh-client-auto-continue):
|
|
118
|
-
|
|
119
63
|
```bash
|
|
120
64
|
dsh plugin --profile web add dsh-client-auto-continue@latest
|
|
121
65
|
dsh web
|
|
122
66
|
```
|
|
123
67
|
|
|
124
|
-
|
|
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
|
|
125
73
|
|
|
126
|
-
|
|
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.19.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** |
|
|
127
80
|
|
|
128
|
-
|
|
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).
|
|
129
82
|
|
|
130
|
-
|
|
83
|
+
<details>
|
|
84
|
+
<summary>Install from GitHub (tracks <code>main</code>)</summary>
|
|
85
|
+
|
|
86
|
+
Built files are committed, so no clone or build is needed:
|
|
131
87
|
|
|
132
88
|
```bash
|
|
133
89
|
dsh plugin --profile web add github:HsiangNianian/dsh-auto-continue
|
|
134
90
|
dsh web
|
|
135
91
|
```
|
|
136
92
|
|
|
137
|
-
|
|
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.
|
|
94
|
+
|
|
95
|
+
</details>
|
|
138
96
|
|
|
139
|
-
|
|
97
|
+
<details>
|
|
98
|
+
<summary>Install from a local checkout</summary>
|
|
140
99
|
|
|
141
|
-
Use Node.js 22
|
|
100
|
+
Use Node.js 22.
|
|
142
101
|
|
|
143
102
|
```bash
|
|
144
103
|
git clone https://github.com/HsiangNianian/dsh-auto-continue.git
|
|
145
104
|
cd dsh-auto-continue
|
|
146
105
|
npm ci
|
|
147
106
|
npm run build
|
|
148
|
-
|
|
149
|
-
# the package carries its own cordis.patch.yml (dsh.bundle.patch),
|
|
150
|
-
# so the plugin row registers itself
|
|
151
107
|
dsh plugin --profile web add "link:$(pwd)"
|
|
152
|
-
|
|
153
108
|
dsh web
|
|
154
109
|
```
|
|
155
110
|
|
|
156
|
-
|
|
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>
|
|
157
117
|
|
|
158
|
-
|
|
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.
|
|
159
119
|
|
|
160
|
-
1. Let
|
|
161
|
-
2.
|
|
162
|
-
3. Install with
|
|
163
|
-
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:
|
|
164
124
|
|
|
165
125
|
```yaml
|
|
166
126
|
- id: auto-continue
|
|
167
127
|
config:
|
|
168
|
-
cooldownMs: 45000 #
|
|
128
|
+
cooldownMs: 45000 # your own saved value
|
|
169
129
|
```
|
|
170
130
|
|
|
171
|
-
|
|
172
|
-
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.
|
|
173
132
|
|
|
174
|
-
|
|
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.
|
|
175
134
|
|
|
176
|
-
|
|
135
|
+
The `include:auto-continue` label under **Built-in plugins** is the normal loader prefix, not a sign of a duplicate install.
|
|
177
136
|
|
|
178
|
-
|
|
137
|
+
</details>
|
|
179
138
|
|
|
180
|
-
|
|
139
|
+
<details>
|
|
140
|
+
<summary>Verify and uninstall</summary>
|
|
181
141
|
|
|
182
142
|
```bash
|
|
143
|
+
# the composed config should contain exactly one auto-continue entry
|
|
183
144
|
dsh --profile web --dump-config | grep -A 4 'id: auto-continue'
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
The composed config should contain one `id: auto-continue` entry. In **Plugins → dsh-client-auto-continue**, check that the component is **Running** and that the **General** category shows editable fields. With verbose logging enabled, engine activity appears in the terminal running DSH.
|
|
187
145
|
|
|
188
|
-
|
|
189
|
-
dsh plugin --profile web remove dsh-client-auto-continue
|
|
190
|
-
# also remove this plugin's config override from cordis.patch.yml, if present
|
|
191
|
-
dsh web
|
|
146
|
+
# uninstall
|
|
147
|
+
dsh plugin --profile web remove dsh-client-auto-continue
|
|
192
148
|
```
|
|
193
149
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
## Troubleshooting
|
|
150
|
+
Also remove the `- id: auto-continue` entry from the profile's `cordis.patch.yml`, if there is one, then restart DSH.
|
|
197
151
|
|
|
198
|
-
|
|
199
|
-
- **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.
|
|
200
|
-
- **`/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>
|
|
201
153
|
|
|
202
|
-
|
|
154
|
+
## Usage
|
|
203
155
|
|
|
204
|
-
|
|
156
|
+
Recovery is on by default. Nothing else needs to be set up.
|
|
205
157
|
|
|
206
|
-
|
|
158
|
+
### Session modes
|
|
207
159
|
|
|
208
|
-
|
|
209
|
-
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:
|
|
210
161
|
|
|
211
|
-
| Mode |
|
|
162
|
+
| Mode | What happens |
|
|
212
163
|
| --- | --- |
|
|
213
|
-
| Follow default |
|
|
214
|
-
| Off | No automatic
|
|
215
|
-
| Recovery only |
|
|
216
|
-
| Autonomous loop | Also
|
|
217
|
-
|
|
218
|
-
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.
|
|
219
|
-
|
|
220
|
-
**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.
|
|
221
|
-
|
|
222
|
-
The notification's **Pause this session 1h** still temporarily suspends one conversation. **Resume now** requests a single send even while paused or Off, without changing the stored mode. The global loop-guard setting remains independent of global pause, but a conversation set to Off is excluded from the guard too.
|
|
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 |
|
|
223
168
|
|
|
224
|
-
|
|
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.
|
|
225
170
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
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>
|
|
229
174
|
|
|
230
|
-
|
|
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.
|
|
231
176
|
|
|
232
|
-
|
|
177
|
+
### Pausing and manual control
|
|
233
178
|
|
|
234
|
-
|
|
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.
|
|
235
183
|
|
|
236
|
-
|
|
184
|
+
### Status and logs
|
|
237
185
|
|
|
238
|
-
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).
|
|
239
187
|
|
|
240
|
-
|
|
188
|
+
## Configuration
|
|
241
189
|
|
|
242
|
-
|
|
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.
|
|
243
191
|
|
|
244
|
-
|
|
192
|
+

|
|
245
193
|
|
|
246
|
-
|
|
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:
|
|
247
195
|
|
|
248
196
|
```yaml
|
|
249
197
|
- id: auto-continue
|
|
250
198
|
config:
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
continueText: ''
|
|
255
|
-
resumeSilentTurns: true
|
|
256
|
-
resumeCompletedTurns: false
|
|
257
|
-
continueTextSilent: ''
|
|
258
|
-
continueTextLoop: ''
|
|
259
|
-
continueTextInterrupted: ''
|
|
260
|
-
continueTextMaxTokens: ''
|
|
261
|
-
guardTools: true
|
|
262
|
-
guardPendingText: ''
|
|
263
|
-
guardDoneText: ''
|
|
264
|
-
graceMs: 3000
|
|
265
|
-
cooldownMs: 20000
|
|
266
|
-
maxConsecutive: 3
|
|
267
|
-
scanOnBoot: true
|
|
268
|
-
scanLimit: 8
|
|
269
|
-
freshMs: 900000
|
|
270
|
-
verbose: true
|
|
271
|
-
classify: true
|
|
272
|
-
retryableErrorPatterns: ''
|
|
273
|
-
backoffFactor: 2
|
|
274
|
-
backoffMaxMs: 300000
|
|
275
|
-
notify: false
|
|
276
|
-
loopGuard: true
|
|
277
|
-
loopShortChars: 40
|
|
278
|
-
loopWindowMs: 30000
|
|
279
|
-
loopShortCount: 12
|
|
280
|
-
loopRepeatText: 4
|
|
281
|
-
loopToolRepeat: 5
|
|
282
|
-
loopText: ''
|
|
199
|
+
cooldownMs: 45000
|
|
200
|
+
resumeCompletedTurns: true
|
|
201
|
+
loopMaxIterations: 20
|
|
283
202
|
```
|
|
284
203
|
|
|
285
|
-
|
|
286
|
-
|
|
204
|
+
Times are in milliseconds. Text fields left empty use the built-in text in the current language.
|
|
205
|
+
|
|
206
|
+
### General
|
|
207
|
+
|
|
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 while it's still loaded, using its main conversation's mode. DSH usually closes a failed background subagent right away, so this mostly helps subagents that stay loaded |
|
|
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 |
|
|
243
|
+
|
|
244
|
+
### Continue text
|
|
245
|
+
|
|
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 |
|
|
287
256
|
|
|
288
|
-
|
|
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).
|
|
289
258
|
|
|
290
|
-
|
|
291
|
-
auto-continue:
|
|
292
|
-
cooldownMs: 45000
|
|
293
|
-
```
|
|
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.
|
|
294
260
|
|
|
295
|
-
|
|
261
|
+
<details>
|
|
262
|
+
<summary>Built-in English texts</summary>
|
|
263
|
+
|
|
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.)` |
|
|
296
272
|
|
|
297
273
|
</details>
|
|
298
274
|
|
|
299
|
-
|
|
275
|
+
### Safety
|
|
300
276
|
|
|
301
|
-
|
|
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 |
|
|
302
286
|
|
|
303
|
-
|
|
304
|
-
- 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
|
|
305
|
-
- An overridden field shows a **Reset to default** button that removes the override and restores the inherited value (normally the built-in default)
|
|
306
|
-
- 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`)
|
|
307
|
-
- Invalid drafts (non-numbers, values below the minimum) block the save and mark their category, even when another category is selected
|
|
308
|
-
- In a read-only deployment the card shows the stored values but disables editing while keeping category navigation available
|
|
309
|
-
- Changes apply immediately after Save and persist in the active profile config (or `~/.dsh/settings.yaml` on older hosts)
|
|
287
|
+
### Status and logs
|
|
310
288
|
|
|
311
|
-
|
|
312
|
-
|
|
289
|
+
| Setting | Key | Default | Notes |
|
|
290
|
+
| --- | --- | --- | --- |
|
|
291
|
+
| Verbose logs | `verbose` | `true` | Log decisions with the `[auto-continue]` prefix |
|
|
313
292
|
|
|
314
|
-
|
|
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.
|
|
315
294
|
|
|
316
|
-
|
|
295
|
+
### Error classification
|
|
317
296
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
| Show auto-continue switch in the composer | `on` | Show the session switch and mode menu (`showComposerToggle`); hiding them does not change modes |
|
|
322
|
-
| Continue text | `Continue` | Text automatically sent after an interruption |
|
|
323
|
-
| Continue text (max tokens) | `Continue` | Text sent when the output token ceiling is reached (same placeholders) |
|
|
324
|
-
| Resume silent turns | `on` | Resume a turn that ended normally with reasoning only (no text, no tool call); does not reset the consecutive count |
|
|
325
|
-
| Continue text (silent turn) | `Continue. Your previous turn ended with internal reasoning only, ...` | Text sent to resume a silent turn (same placeholders) |
|
|
326
|
-
| Default session mode | Recovery only | For sessions following the default; stored as `resumeCompletedTurns` (`false` = Recovery only, `true` = Autonomous loop) |
|
|
327
|
-
| Continue text (autonomous loop) | `Continue` | Text sent on each autonomous-loop resume (same placeholders) |
|
|
328
|
-
| Continue text (harness restart) | `Continue. The harness was restarted while your previous turn was still running; …` | Text sent when the boot scan resumes a session that a harness restart closed mid-turn (same placeholders) |
|
|
329
|
-
| Idempotency guard | `on` | Inspect the last tool call before resuming and steer the model (see What It Does) |
|
|
330
|
-
| Loop guard | `on` | Detect a running turn spinning in place and restart it (see What It Does) |
|
|
331
|
-
| Short-sentence max (chars) | `40` | A model message shorter than this counts as a short sentence (spinning signal) |
|
|
332
|
-
| Short-sentence window (ms) | `30000` | Consecutive short sentences must land inside this window; normal thinking spread over time is not misjudged |
|
|
333
|
-
| Short-sentence threshold | `12` | Consecutive short sentences inside the window, with no tool call in between, trip the loop guard |
|
|
334
|
-
| 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 |
|
|
335
|
-
| Same-tool repeat count | `5` | Consecutive calls of the same tool with identical arguments and results trip the loop guard |
|
|
336
|
-
| 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 |
|
|
337
|
-
| 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 |
|
|
338
|
-
| 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 |
|
|
339
|
-
| Grace period (ms) | `3000` | Wait after an interruption; cancelled if the host recovers on its own |
|
|
340
|
-
| Cooldown (ms) | `20000` | Min interval between recovery attempts per session; failures during cooldown wait for the remaining interval, then grace |
|
|
341
|
-
| Max consecutive | `3` | Consecutive recovery-attempt cap; resets on user intervention or an observed completion with visible output. Normal autonomous-loop handoffs are exempt |
|
|
342
|
-
| Scan on host startup | `on` | Recover interrupted sessions that become available during the startup window |
|
|
343
|
-
| Scan limit | `8` | Maximum eligible recoveries per pass, most recently active first |
|
|
344
|
-
| Scan window (ms) | `900000` | Maximum interruption age and duration of startup polling |
|
|
345
|
-
| Verbose logs | `on` | `[auto-continue]` engine logs in the DSH terminal |
|
|
346
|
-
| Classify errors | `on` | Auto-resume transient failures only; auth / balance / model errors are skipped and notified |
|
|
347
|
-
| Custom retryable errors | empty | One case-insensitive literal per line; matching the error code, HTTP status, or message explicitly overrides the built-in classifier |
|
|
348
|
-
| Backoff factor | `2` | Cooldown multiplier per consecutive failure (2 = 20s → 40s → 80s…) |
|
|
349
|
-
| Max backoff (ms) | `300000` | Cap on the adaptive backoff interval |
|
|
350
|
-
| Browser notifications | `off` | Notify about auto-continue events and successful settings saves; confirm switching notifications on or off |
|
|
351
|
-
|
|
352
|
-
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.
|
|
353
|
-
|
|
354
|
-
`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.
|
|
355
|
-
|
|
356
|
-
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:
|
|
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:
|
|
357
300
|
|
|
358
301
|
```yaml
|
|
359
302
|
- id: auto-continue
|
|
@@ -362,70 +305,76 @@ For a provider-specific error that is safe to resume (confirm first that manuall
|
|
|
362
305
|
Upstream rejected the request as invalid
|
|
363
306
|
```
|
|
364
307
|
|
|
365
|
-
Patterns are
|
|
308
|
+
Patterns are plain substrings, not regular expressions. Cooldown and **Max consecutive** still apply.
|
|
366
309
|
|
|
367
|
-
|
|
310
|
+
## How it works
|
|
368
311
|
|
|
369
|
-
|
|
312
|
+
[](docs/auto-continue-workflow.en.html)
|
|
370
313
|
|
|
371
|
-
|
|
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.
|
|
372
321
|
|
|
373
|
-
|
|
322
|
+
**Child sessions.** Outside of **Resume subagent sessions**, subagent and team-member sessions are never resumed directly, and that setting only covers live ones. 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.
|
|
374
323
|
|
|
375
|
-
|
|
376
|
-
- Recovery sends your configured text through `agent.followup`. The loop guard can cancel a looping turn through `agent.cancel` before sending its recovery prompt. Resumed agents continue with the session's existing tools and permissions
|
|
377
|
-
- Saving configuration uses DSH's settings API: the active profile patch on DSH 0.1.7 / 0.2, or `~/.dsh/settings.yaml` on older hosts
|
|
378
|
-
- 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
|
|
379
|
-
- 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.
|
|
380
325
|
|
|
381
|
-
|
|
326
|
+
## Troubleshooting
|
|
327
|
+
|
|
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.
|
|
382
345
|
|
|
383
346
|
## Development
|
|
384
347
|
|
|
385
|
-
Use Node.js 22.
|
|
348
|
+
Use Node.js 22.
|
|
386
349
|
|
|
387
350
|
```bash
|
|
388
351
|
npm ci
|
|
389
|
-
npm ci --prefix tests/fixtures/dsh-0.1.7
|
|
390
|
-
npm ci --prefix tests/fixtures/dsh-0.2.0
|
|
391
|
-
npm ci --prefix tests/fixtures/dsh-0.2.0-rc.2
|
|
392
|
-
npm ci --prefix tests/fixtures/dsh-0.2.1
|
|
393
|
-
npm ci --prefix tests/fixtures/dsh-0.2.1-rc.2
|
|
394
352
|
npm run typecheck
|
|
395
353
|
npm run build
|
|
396
354
|
npm test
|
|
397
|
-
npm run test:runtime
|
|
398
355
|
```
|
|
399
356
|
|
|
400
|
-
`npm
|
|
357
|
+
`npm run test:runtime` runs the settings, startup-recovery and restart tests against published DSH packages. Install the pinned fixtures first:
|
|
401
358
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
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.
|
|
407
|
-
|
|
408
|
-
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.
|
|
409
|
-
|
|
410
|
-
---
|
|
411
|
-
|
|
412
|
-
## Activity
|
|
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
|
+
```
|
|
413
363
|
|
|
414
|
-
|
|
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).
|
|
415
365
|
|
|
416
|
-
|
|
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.
|
|
417
367
|
|
|
418
368
|
## Links
|
|
419
369
|
|
|
420
|
-
-
|
|
421
|
-
-
|
|
422
|
-
-
|
|
423
|
-
-
|
|
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)
|
|
424
375
|
|
|
425
|
-
|
|
376
|
+
[](https://gitstock.org/HsiangNianian/dsh-auto-continue)
|
|
426
377
|
|
|
427
378
|
## License
|
|
428
379
|
|
|
429
|
-
[
|
|
430
|
-
|
|
431
|
-
MIT © Hsiang Nianian
|
|
380
|
+
[MIT](LICENSE) © Hsiang Nianian
|