dsh-client-auto-continue 0.17.3 → 0.18.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 CHANGED
@@ -1,5 +1,41 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.18.0](https://github.com/HsiangNianian/dsh-auto-continue/releases/tag/v0.18.0) — 2026-11-10
4
+
5
+ ### Added
6
+
7
+ - **Offline hold** (`pauseWhenOffline`, on by default; `offlineCheckMs`, default 15000): a network-error retry first checks that the host is online and, while it is not, waits and re-checks without consuming `maxConsecutive`, then resumes through the usual grace period and cooldown ([#81](https://github.com/HsiangNianian/dsh-auto-continue/issues/81), thanks @xiuchuan666)
8
+ - **Autonomous loop round limit** (`loopMaxIterations`, default 0 = unlimited): stop the loop after N rounds per session and report it once; a user message or turning the loop back on resets the count ([#81](https://github.com/HsiangNianian/dsh-auto-continue/issues/81))
9
+ - **Child-session hand-off** (`resumeInterruptedChildren`, off by default): the startup scan now judges subagent and team-member sessions that a restart interrupted (`open-turn`, `aborted{disposed|legacy}`, `interrupted`, `max-tokens`, or a retryable `error`) and sends their root session one message listing them, once per batch signature. Child sessions are still never resumed directly; parents that finished cleanly or that the user stopped by hand are skipped, and at most 8 child logs are cold-read per pass from a dedicated ledger that does not consume the main scan budget
10
+ - **Goal re-arm** (`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. `goals.resume` performs no human-authorization check in the service layer, so automatic use acts on the user's behalf — hence opt-in only
11
+ - **Resume paused goals** (`resumePausedGoals`, off by default): also resume goals the user paused by hand; gated behind `resumeGoals` ([#77](https://github.com/HsiangNianian/dsh-auto-continue/issues/77), [#80](https://github.com/HsiangNianian/dsh-auto-continue/pull/80), thanks @loyalchiiina)
12
+ - **Plugin message source** (`usePluginSource`, off by default): send continue prompts with `source.kind: 'plugin:dsh-client-auto-continue'` instead of `user`; echo matching accepts both, including messages queued before the switch changes ([#79](https://github.com/HsiangNianian/dsh-auto-continue/pull/79), thanks @fu050409)
13
+
14
+ ### Fixed
15
+
16
+ - Child-session hand-off ignores interruptions older than `freshMs`, so a long-finished root session is not woken for a child cut off days ago, and a woken root is restored with the model its log recorded ([#80](https://github.com/HsiangNianian/dsh-auto-continue/pull/80))
17
+
18
+ ### Maintenance
19
+
20
+ - Startup scan diagnostics report subagent / no-origin / other-origin session counts, and an unresolvable parent chain is logged once per session instead of every round
21
+ - Recovery test fixtures keep the offline hold off so they never depend on the machine's real network; the new suite fakes DNS and network interfaces
22
+
23
+ [Upgrade instructions and validation](docs/releases/v0.18.0.md) · [Full changes](https://github.com/HsiangNianian/dsh-auto-continue/compare/v0.17.4...v0.18.0)
24
+
25
+ ## [0.17.4](https://github.com/HsiangNianian/dsh-auto-continue/releases/tag/v0.17.4) — 2026-11-07
26
+
27
+ ### Fixed
28
+
29
+ - Retry `MALFORMED_RESPONSE` errors without treating keywords in echoed tool arguments as permanent authentication, quota or configuration failures ([#75](https://github.com/HsiangNianian/dsh-auto-continue/issues/75), thanks @yuloop)
30
+ - Apply the shared classification fix to live errors, loaded-session startup scans and stored-session scans, preserving explicit HTTP 401/403 checks, custom overrides and retry limits
31
+
32
+ ### Maintenance
33
+
34
+ - Add regression coverage across all three recovery paths, permanent-error boundaries, the consecutive-attempt cap and custom-pattern precedence
35
+ - Update both READMEs with the built-in behavior and removal of the temporary workaround
36
+
37
+ [Upgrade instructions and validation](docs/releases/v0.17.4.md) · [Full changes](https://github.com/HsiangNianian/dsh-auto-continue/compare/v0.17.3...v0.17.4)
38
+
3
39
  ## [0.17.3](https://github.com/HsiangNianian/dsh-auto-continue/releases/tag/v0.17.3) — 2026-11-02
4
40
 
5
41
  ### Fixed
package/README.md CHANGED
@@ -45,15 +45,18 @@ Automatic recovery for [DeepSeek Harness](https://github.com/deepseek-ai/deepsee
45
45
  **Smart recovery** (all configurable):
46
46
 
47
47
  - **Session modes** — switch auto-continue on or off beside the message input, for that conversation only. The mode menu next to the switch shows the current mode and opens Follow default, Off, Recovery only or Autonomous loop. Choices save on the host, survive restarts and sync across tabs; hiding the control does not change them
48
- - **Error classification** — transient failures (network / timeout / 5xx / 429…) are auto-resumed; permanent ones are **skipped** and notified, because retrying them never helps. A failure counts as permanent when its HTTP status is 401/403 or its code/message matches auth, credential/API-key, balance/quota, unknown-model, or context-length/overflow keywords. Provider-specific exceptions can be opted into with literal custom retryable patterns; turn classification off to resume everything
48
+ - **Error classification** — transient failures (network / timeout / 5xx / 429…) are auto-resumed; permanent ones are **skipped** and notified, because retrying them never helps. A failure counts as permanent when its HTTP status is 401/403 or, except for `MALFORMED_RESPONSE`, its code/message matches auth, credential/API-key, balance/quota, unknown-model, or context-length/overflow keywords. Provider-specific exceptions can be opted into with literal custom retryable patterns; turn classification off to resume everything
49
49
  - **Adaptive backoff** — consecutive failures wait longer each time (cooldown × factor: 20s → 40s → 80s…), capped at the max backoff, instead of hammering a broken upstream
50
+ - **Offline hold** — on by default (`pauseWhenOffline`). Before retrying a network failure (`TRANSPORT`, `TIMEOUT`, DNS or connection errors), the host checks it is online: a non-loopback network interface plus one resolvable public name. While offline the retry waits and re-checks every `offlineCheckMs` (15s) without using up **Max consecutive**, then goes through the normal grace period and cooldown once the network is back. Server errors (5xx, 429) are not held. With `HTTP(S)_PROXY` / `ALL_PROXY` set, only interfaces are checked, since local DNS may not work behind such a proxy
50
51
  - **English / Chinese localization** — the settings card uses DSH's locale service. Built-in resume / guard / loop text and browser notifications use Chinese for `zh` and `zh-*` (case-insensitive), and English for every other or unset locale. Switching languages updates built-in defaults without overwriting custom text
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")
52
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)
53
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.
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
+ - **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
55
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
56
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
57
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
58
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
59
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.
@@ -68,9 +71,20 @@ It watches the live event streams and reacts to:
68
71
  | `turn/end` → `completed` / `no-visible-output` with no visible output | Observed model activity without visible output, or an explicit silent-ending marker |
69
72
  | `turn/end` → `completed` | Continue a normal completion only when autonomous loop is enabled |
70
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
+
71
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.
72
86
 
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.
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.
74
88
 
75
89
  ---
76
90
 
@@ -100,8 +114,9 @@ DSH plugins install into a **profile** (`dsh web` → `web` profile). The comman
100
114
 
101
115
  | DSH runtime | Plugin version | Configuration entry point |
102
116
  | --- | --- | --- |
103
- | **0.2.1-rc.2** | **0.17.3 verified** | **Plugins → dsh-client-auto-continue** |
104
- | **0.2.1-alpha.1** | **0.17.2 verified** | **Plugins → dsh-client-auto-continue** |
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** |
105
120
  | **0.2.0-rc.1** | **0.12.1 or newer** | **Plugins → dsh-client-auto-continue** |
106
121
  | **0.1.7-rc.2** | **0.11.9 or newer** | Same Plugins page |
107
122
  | Older hosts with the legacy settings API | Legacy UI retained | **Settings → Plugins → Plugin configuration** |
@@ -251,9 +266,16 @@ The browser mirrors DSH's active language into the internal `locale` field: `zh`
251
266
  locale: 'en' # normally managed by the browser
252
267
  paused: false
253
268
  showComposerToggle: true
269
+ usePluginSource: false
254
270
  continueText: ''
255
271
  resumeSilentTurns: true
256
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
257
279
  continueTextSilent: ''
258
280
  continueTextLoop: ''
259
281
  continueTextInterrupted: ''
@@ -319,11 +341,13 @@ When migrating from the legacy settings file to DSH 0.1.7 / 0.2, move these valu
319
341
  | --- | --- | --- |
320
342
  | Pause auto-continue | `off` | Global pause: no live or scan auto-send fires, queued pending sends are cancelled |
321
343
  | Show auto-continue switch in the composer | `on` | Show the session switch and mode menu (`showComposerToggle`); hiding them does not change modes |
344
+ | Send continue messages with plugin source | `off` | `usePluginSource`: off keeps the legacy `user` source; on uses `plugin:dsh-client-auto-continue` |
322
345
  | Continue text | `Continue` | Text automatically sent after an interruption |
323
346
  | Continue text (max tokens) | `Continue` | Text sent when the output token ceiling is reached (same placeholders) |
324
347
  | 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
348
  | Continue text (silent turn) | `Continue. Your previous turn ended with internal reasoning only, ...` | Text sent to resume a silent turn (same placeholders) |
326
349
  | Default session mode | Recovery only | For sessions following the default; stored as `resumeCompletedTurns` (`false` = Recovery only, `true` = Autonomous loop) |
350
+ | Autonomous loop round limit | `0` | Maximum autonomous rounds per session (`loopMaxIterations`); `0` means no limit. Resets when you send a message or turn the loop back on |
327
351
  | Continue text (autonomous loop) | `Continue` | Text sent on each autonomous-loop resume (same placeholders) |
328
352
  | 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
353
  | Idempotency guard | `on` | Inspect the last tool call before resuming and steer the model (see What It Does) |
@@ -339,9 +363,14 @@ When migrating from the legacy settings file to DSH 0.1.7 / 0.2, move these valu
339
363
  | Grace period (ms) | `3000` | Wait after an interruption; cancelled if the host recovers on its own |
340
364
  | Cooldown (ms) | `20000` | Min interval between recovery attempts per session; failures during cooldown wait for the remaining interval, then grace |
341
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** |
342
370
  | Scan on host startup | `on` | Recover interrupted sessions that become available during the startup window |
343
371
  | Scan limit | `8` | Maximum eligible recoveries per pass, most recently active first |
344
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** |
345
374
  | Verbose logs | `on` | `[auto-continue]` engine logs in the DSH terminal |
346
375
  | Classify errors | `on` | Auto-resume transient failures only; auth / balance / model errors are skipped and notified |
347
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 |
@@ -351,6 +380,8 @@ When migrating from the legacy settings file to DSH 0.1.7 / 0.2, move these valu
351
380
 
352
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.
353
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
+
354
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:
355
386
 
356
387
  ```yaml
@@ -395,7 +426,7 @@ npm test
395
426
  npm run test:runtime
396
427
  ```
397
428
 
398
- `npm test` covers recovery, autonomous-loop limits and toggles, child-session exclusion, manual resume during pauses, startup scanning and malformed-session isolation, queue ordering, statistics, localization, settings UI lifecycle and edits made during pending saves. `npm run test:runtime` uses published DSH **0.1.7-rc.2**, **0.2.0-rc.1** and **0.2.1-alpha.1** Settings, Loader and HTTP services. It also runs the actual 0.2 profile compatibility gate and checks client activation when one settings provider is absent. Startup recovery tests inject session read failures into real **0.2.0-rc.2** and **0.2.1-alpha.1** Session/Cordis/HTTP components and verify that healthy sessions still recover. These controlled faults do not imply that normal DSH loading produces malformed logs. The runtime harness controls agent events; it does not send requests to a model provider.
429
+ `npm test` covers recovery, autonomous-loop limits and toggles, child-session exclusion and the post-restart hand-off, manual resume during pauses, startup scanning and malformed-session isolation, queue ordering, statistics, localization, settings UI lifecycle and edits made during pending saves. `npm run test:runtime` uses published DSH **0.1.7-rc.2**, **0.2.0-rc.1** and **0.2.1-alpha.1** Settings, Loader and HTTP services. It also runs the actual 0.2 profile compatibility gate and checks client activation when one settings provider is absent. Startup recovery tests inject session read failures into real **0.2.0-rc.2** and **0.2.1-alpha.1** Session/Cordis/HTTP components and verify that healthy sessions still recover. These controlled faults do not imply that normal DSH loading produces malformed logs. The runtime harness controls agent events; it does not send requests to a model provider.
399
430
 
400
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.
401
432
 
package/README.zh.md CHANGED
@@ -45,15 +45,18 @@
45
45
  **智能恢复**(全部可配置):
46
46
 
47
47
  - **会话模式** — 在输入框旁用开关控制当前会话的自动继续,旁边显示当前模式的菜单可选择跟随默认、仅故障恢复或自主循环。选择保存在宿主配置里,重启后保留,并同步到其他标签页。隐藏控件不会改变模式
48
- - **错误分类** — 临时性错误(网络 / 超时 / 5xx / 429 等)自动续跑; 永久性错误跳过并通知, 因为重试也没用。判定为永久性的条件: HTTP 状态码 401/403, 或 code/message 命中认证、凭据/API Key、余额/配额、模型不存在、上下文长度/超限等关键词。provider 专属例外可由用户显式填写普通文本匹配; 关闭分类后则全部自动继续
48
+ - **错误分类** — 临时性错误(网络 / 超时 / 5xx / 429 等)自动续跑; 永久性错误跳过并通知, 因为重试也没用。判定为永久性的条件: HTTP 状态码 401/403, 或非 `MALFORMED_RESPONSE` 错误的 code/message 命中认证、凭据/API Key、余额/配额、模型不存在、上下文长度/超限等关键词。provider 专属例外可由用户显式填写普通文本匹配; 关闭分类后则全部自动继续
49
49
  - **自适应退避** — 连续失败时等待时间递增(冷却 × 系数: 20s → 40s → 80s…), 有上限, 不再对故障上游狂轰滥炸
50
+ - **断网挂起** — 默认开启(`pauseWhenOffline`)。网络类失败(`TRANSPORT`、`TIMEOUT`、DNS 或连接错误)续跑前,宿主先检测是否联网:有非回环网卡,且至少一个公共域名能解析。断网时挂起,每 `offlineCheckMs`(15 秒)复检一次,不消耗**最大连续次数**;联网后照常走宽限期和冷却再续跑。服务端错误(5xx、429)不挂起。设置了 `HTTP(S)_PROXY` / `ALL_PROXY` 时只检查网卡,因为这类代理下本地 DNS 可能本来就不可用
50
51
  - **中英文本地化** — 设置卡片使用 DSH 的语言服务。内置续跑 / 护栏 / 循环文案以及浏览器通知在 `zh` 和 `zh-*` 时使用中文(不区分大小写),其他语言或未设置语言时使用英文。切换语言只会替换内置默认值,不会覆盖用户自定义文本
51
52
  - **模板化继续文本** — `continueText` 支持 `{code}` `{message}` `{status}` `{tool}` `{turn}` `{errorCount}` `{elapsed}` 占位符, 续跑消息可携带失败上下文(如「继续 (git push 失败: UPSTREAM)」); 达到 `max-tokens` 时使用**另一套模板**(如「继续输出, 不要重复已生成的内容」)
52
53
  - **幂等护栏** — 续跑前检查上一步工具调用: 结果未确认(回合在工具执行中途夭折, 如 `git push` 可能已经推上去了)时, 续跑消息会提示模型先确认状态、不要重复执行; 工具已确认成功时说明已完成、请勿重复; 工具失败则不加护栏(重试本来就是目的)。两段护栏文本都可配置(支持 `{tool}` / `{result}` 占位符)
53
54
  - **无输出回合续跑** — 已观察到模型步骤或推理回复,但回合正常结束且没有可见输出时自动恢复。没有模型活动的空回合不会触发;文本、工具调用、图片、扩展块和已显示的流式内容均算可见输出。未观察到开始的回合不会被猜测为静默。启动后也能恢复显式的 `no-visible-output` 标记。关闭开关会取消排队中的静默续跑;即使开关关闭,静默回合也不会清零重试上限。
54
- - **自主循环** — 默认关闭(`resumeCompletedTurns`)。开启后,正常完成的回合经过宽限期便会续跑,不受恢复冷却和次数上限约束。仅有推理的回合和显式 `no-visible-output` 仍消耗重试预算并遵守退避。全局暂停、会话暂停、手动停止或将该会话改为仅故障恢复 / 关闭都会停止循环。默认模式只影响选择了「跟随默认」的会话。自主循环使用单独的提示文本 `continueTextLoop`(默认 `继续`),与循环守卫的提示文本不同。
55
+ - **自主循环** — 默认关闭(`resumeCompletedTurns`)。开启后,正常完成的回合经过宽限期便会续跑,不受恢复冷却和次数上限约束。仅有推理的回合和显式 `no-visible-output` 仍消耗重试预算并遵守退避。全局暂停、会话暂停、手动停止或将该会话改为仅故障恢复 / 关闭都会停止循环。默认模式只影响选择了「跟随默认」的会话。自主循环使用单独的提示文本 `continueTextLoop`(默认 `继续`),与循环守卫的提示文本不同。`loopMaxIterations` 限制每个会话的自主续跑轮数(默认 0,不限制):到达上限后循环停下并提示一次(日志,开启通知时另有浏览器通知);你自己发一条消息或重新开启循环后重新计数
55
56
  - **暂停** — 在**常规**中关闭**全局启用自动继续**并保存,会停止实时事件与启动扫描触发的自动发送; 会话级暂停(如通过通知按钮)只挂起单个会话, 到期自动恢复。即使两种暂停同时生效,通知里的 **立即续跑** 仍可发送一次。发送后保留暂停状态,后续自动恢复和自主循环仍受暂停约束
56
57
  - **通知按钮** — 通知带 **立即续跑**(无视冷却、连续上限与暂停, 马上发送)和 **暂停该会话 1 小时** 按钮
58
+ - **子会话交接** — 需显式开启(`resumeInterruptedChildren`,默认关):启动扫描发现子代理 / 团队成员会话被重启打断时,每个 **root 会话**只会收到一条列出这些子会话的消息,同一批只发一次。子会话本身仍然永不被续跑 —— 由 root 决定逐个继续还是收尾。只有父会话自己干净结束、或自己也是被这次重启关闭的时候才会接受唤醒;父会话自己仍在进行中的回合交给原有恢复路径,被你手动停止的父会话绝不唤醒
59
+ - **goal 重新武装** — 需显式开启(`resumeGoals`,默认关):任一次自动续跑(或子会话唤醒)发出后,把重启时被宿主失活的 `active` goal 重新武装,让它的自动继续轮重新转起来。**恢复被暂停的 goal**(`resumePausedGoals`)还会恢复你手动暂停的 goal,且必须同时开启 `resumeGoals` 才生效
57
60
  - **循环守卫** — 连**运行中的回合**也盯着, 四个信号都会触发守卫(取消当前回合并用可配置的循环提示文本重启, 「停止重复, 换一种方式」): 模型**连续输出完全相同的消息**(不限长度, 如 "Let me test variants of the regex…" 连续 7 遍)、单条流式 assistant 消息内部出现连续近似重复段落、短时间内连续多条短句且期间无工具调用(典型的「Let me read…」空转)、或同一工具被连续反复调用且**参数与结果都相同**(参数或结果有变化视为有进展)。取消带有内部来源标记, 绝不会与用户手动停止混淆——只有守卫发起的取消才会重启。阈值、时间窗与提示文本都可配置
58
61
  - **统计面板** — 设置卡片展示今日自动继续次数、恢复成功、继续后失败、永久性跳过、达上限停止、循环打断, 按错误码统计, 可一键清零
59
62
  - **浏览器通知** — 可选:自动继续事件和配置保存成功时弹出提醒。切换通知选项并保存后会确认新状态,关闭时也会发最后一条确认。开启时可能请求浏览器权限;被拒绝后会在设置页说明,不影响配置保存。
@@ -68,9 +71,20 @@
68
71
  | `turn/end` → `completed` / `no-visible-output` 且无可见输出 | 已观察到模型活动但没有可见输出,或收到显式无输出结束标记 |
69
72
  | `turn/end` → `completed` | 仅在开启自主循环时续跑正常完成的回合 |
70
73
 
74
+ 每类回合各自会不会被续跑,以及由哪个开关约束:
75
+
76
+ | 场景 | 是否自动续跑 | 触发路径 | 受哪个开关约束 |
77
+ | --- | --- | --- | --- |
78
+ | 本会话的回合失败、达到输出上限,或被宿主重启截断 | 会 —— 在同一会话内发一条续跑消息 | 实时事件,或重启后的启动扫描 | **全局启用自动继续**、会话模式、**启动恢复扫描**(`scanOnBoot`) |
79
+ | 本会话回合结束但没有可见输出 | 会 | 实时事件或启动扫描 | **续跑无输出回合**(`resumeSilentTurns`) |
80
+ | 本会话回合正常完成 | 仅在**自主循环**下 | `turn/end` → `completed` | `resumeCompletedTurns` / 会话模式 |
81
+ | 子代理或团队成员会话被重启打断 | **不会** —— 子会话永不直接被续跑 | 启动扫描收集清单,然后向它的 **root 会话**发一条唤醒消息 | `resumeInterruptedChildren`(默认关) |
82
+ | 会话带有被重启失活的 `active` goal | 不会自动发生:续跑出去的回合需要 goal 重新武装 | 该会话任一次自动续跑之后 | `resumeGoals`(默认关) |
83
+ | 会话带有你手动暂停的 goal | 仅在你显式选择时 | 同上 | `resumeGoals` **与** `resumePausedGoals`(均默认关) |
84
+
71
85
  **恢复会停止于:**用户手动停止、策略拒绝(`blocked`)、暂停、子代理会话以及连续次数上限。新回合开始或用户手动发送消息会取消待发送的继续提示;实时 `interrupted` 标记交给启动扫描处理。冷却期间出现的可恢复错误会**延后重试,不会直接丢弃**。已有排队消息时,续跑消息先执行,原有消息随后按原顺序处理。循环守卫则可以单独打断并重启正在重复动作的回合。
72
86
 
73
- 子代理会话由父代理管理。插件会在实时恢复和启动扫描中跳过它们,忽略对它们发起的 **立即续跑**,循环守卫也不会打断它们。识别出子代理会话时,已排队的恢复操作会被取消。
87
+ 子代理会话由父代理管理。插件会在实时恢复和启动扫描中跳过它们,忽略对它们发起的 **立即续跑**,循环守卫也不会打断它们。识别出子代理会话时,已排队的恢复操作会被取消。可选的**重启后唤醒子代理会话**(`resumeInterruptedChildren`,默认关闭)不改变这一点:插件仍然绝不续跑子会话,只是把「哪些子会话被重启打断」告诉它们的 root 会话,由 root 决定继续还是收尾。
74
88
 
75
89
  ---
76
90
 
@@ -100,8 +114,9 @@ DSH 插件安装进 **profile**(`dsh web` 对应 `web` profile)。下面的命
100
114
 
101
115
  | DSH 内核 | 插件版本 | 配置入口 |
102
116
  | --- | --- | --- |
103
- | **0.2.1-rc.2** | **已验证 0.17.3** | **插件 → dsh-client-auto-continue** |
104
- | **0.2.1-alpha.1** | **已验证 0.17.2** | **插件 → dsh-client-auto-continue** |
117
+ | **0.2.2-rc.1** | **已验证 0.18.0** | **插件 → dsh-client-auto-continue** |
118
+ | **0.2.1-rc.2** | **已验证 0.18.0** | **插件 → dsh-client-auto-continue** |
119
+ | **0.2.1-alpha.1** | **已验证 0.18.0** | **插件 → dsh-client-auto-continue** |
105
120
  | **0.2.0-rc.1** | **0.12.1 或更新版本** | **插件 → dsh-client-auto-continue** |
106
121
  | **0.1.7-rc.2** | **0.11.9 或更新版本** | 同上,从主侧栏的插件页进入 |
107
122
  | 使用旧设置 API 的宿主 | 保留旧版设置界面兼容 | **设置 → 插件 → 插件配置** |
@@ -248,9 +263,16 @@ DSH 0.1.7 / 0.2 将这些值保存在当前 profile patch 的 `auto-continue`
248
263
  locale: 'zh' # 通常由浏览器自动维护
249
264
  paused: false
250
265
  showComposerToggle: true
266
+ usePluginSource: false
251
267
  continueText: ''
252
268
  resumeSilentTurns: true
253
269
  resumeCompletedTurns: false
270
+ resumeInterruptedChildren: false # 启动恢复:把被打断的子会话清单告诉 root 会话
271
+ resumeGoals: false # 重试策略:重新武装被重启失活的 goal
272
+ resumePausedGoals: false # 重试策略:连手动暂停的 goal 也恢复(需先开 resumeGoals)
273
+ pauseWhenOffline: true # 重试策略:宿主断网时挂起网络类错误的续跑
274
+ offlineCheckMs: 15000
275
+ loopMaxIterations: 0 # 每个会话的自主循环轮数上限;0 为不限制
254
276
  continueTextSilent: ''
255
277
  continueTextLoop: ''
256
278
  continueTextInterrupted: ''
@@ -318,11 +340,13 @@ auto-continue:
318
340
  | --- | --- | --- |
319
341
  | 暂停自动继续 | 关 | 全局暂停: 实时与扫描都不再自动发送, 已排队的待发送也会取消 |
320
342
  | 在会话区显示自动继续开关 | 开 | 显示会话开关和模式菜单(`showComposerToggle`);隐藏不会改变模式 |
343
+ | 以插件来源发送继续消息 | 关 | `usePluginSource`:关闭时沿用旧版 `user` 来源;开启时使用 `plugin:dsh-client-auto-continue` |
321
344
  | 继续文本 | `继续` | 中断后自动发送的消息内容 |
322
345
  | 超限时的继续文本 | `继续` | 达到输出 token 上限时自动发送的文本(支持相同占位符) |
323
346
  | 续跑无输出回合 | 开 | 回合正常结束但只有推理(没有文本、没有工具调用)时自动续跑; 不清零连续次数 |
324
347
  | 无输出回合的继续文本 | `继续。你上一轮只输出了内部推理, ...` | 续跑无输出回合时发送的文本(支持相同占位符) |
325
348
  | 默认会话模式 | 仅故障恢复 | 用于跟随默认的会话;沿用 `resumeCompletedTurns` 配置(`false` 为仅故障恢复,`true` 为自主循环) |
349
+ | 自主循环轮数上限 | `0` | 每个会话最多自主续跑的轮数(`loopMaxIterations`),`0` 为不限制;你发消息或重新开启循环后重新计数 |
326
350
  | 自主循环的继续文本 | `继续` | 自主循环续跑时发送的文本(支持相同占位符) |
327
351
  | 宿主重启后恢复的继续文本 | `继续。宿主在你上一轮运行期间重启了; …` | 启动扫描恢复被重启中断的会话时发送的文本(支持相同占位符) |
328
352
  | 幂等护栏 | 开 | 续跑前检查上一步工具调用并给出指引(见「它做什么」) |
@@ -338,9 +362,14 @@ auto-continue:
338
362
  | 宽限期 (ms) | `3000` | 中断后等待的时长; 期间宿主自行恢复则取消 |
339
363
  | 冷却时间 (ms) | `20000` | 同一会话恢复尝试的最小间隔;期间出现的失败会等待剩余冷却,再进入宽限期 |
340
364
  | 最大连续次数 | `3` | 连续恢复尝试上限;用户介入或观察到有可见输出的成功回合后重置。正常完成后的自主循环接力不计入 |
365
+ | 断网时暂停续跑 | 开 | **重试策略** —— 宿主断网时挂起网络类错误的续跑,不消耗连续次数(`pauseWhenOffline`) |
366
+ | 断网复检间隔 (ms) | `15000` | **重试策略** —— 挂起期间多久重新检测一次网络(`offlineCheckMs`,最小 1000) |
367
+ | 重新武装被重启失活的 goal | 关 | **重试策略** —— 自动续跑发出后,把重启时被宿主失活的 `active` goal 重新武装,让它的自动继续轮能重新运转(`resumeGoals`)。`goals.resume` 在服务层不做人类授权校验,插件自动调用等于代替你授权 —— 所以默认关闭 |
368
+ | 恢复被暂停的 goal | 关 | **重试策略** —— 同时恢复你手动暂停的 goal(`resumePausedGoals`)。暂停通常是人的显式决定;只有同时开启**重新武装被重启失活的 goal**时才生效 |
341
369
  | 启动恢复扫描 | 开 | 恢复启动时间窗内延迟加载的中断会话 |
342
370
  | 扫描会话数 | `8` | 每轮最多恢复的符合条件的会话数,优先最近活动的会话 |
343
371
  | 扫描时间窗 (ms) | `900000` | 中断的最大年龄,同时限制启动轮询的持续时间 |
372
+ | 重启后唤醒子代理会话 | 关 | **启动恢复** —— 启动扫描发现子代理 / 团队成员会话被重启打断时,向它们的 root 会话发一条列出清单的消息(`resumeInterruptedChildren`)。子会话永不直接被续跑;每轮最多冷读 8 个子会话日志,与**扫描会话数**相互独立 |
344
373
  | 详细日志 | 开 | 在运行 DSH 的终端输出 `[auto-continue]` 引擎日志 |
345
374
  | 错误分类 | 开 | 仅自动恢复临时性错误; 认证 / 余额 / 模型等永久性错误跳过并通知 |
346
375
  | 自定义可恢复错误 | 空 | 每行一个大小写不敏感的普通文本片段; 命中错误码、HTTP 状态或消息时显式覆盖内置分类 |
@@ -350,6 +379,8 @@ auto-continue:
350
379
 
351
380
  暂停自动继续会停止自动续跑,但循环守卫仍独立运行。如需停止自动打断,请同时关闭**循环守卫**。仅含不可见字符的正文不计入可见消息复读;新的工具调用会重置正文重复计数,而同工具、同参数、同结果的工具死循环仍独立检测。
352
381
 
382
+ `MALFORMED_RESPONSE` 格式错误会允许重试,即使回显的工具参数包含 `auth`、`permission`、`quota` 等词。内置分类仍会跳过明确的 HTTP 401/403,冷却、退避和重试上限照常生效。实时错误和启动扫描均适用;[#75](https://github.com/HsiangNianian/dsh-auto-continue/issues/75) 中临时添加的 `malformed_response` / `non-whitespace character after json` 两条匹配已不再需要。
383
+
353
384
  遇到确认可以安全续跑的 provider 专属错误时(先确认手动发送「继续」确实能恢复), 应添加足够具体、稳定的片段, 而不是全局关闭错误分类:
354
385
 
355
386
  ```yaml
@@ -394,7 +425,7 @@ npm test
394
425
  npm run test:runtime
395
426
  ```
396
427
 
397
- `npm test` 覆盖错误恢复、自主循环上限与开关、子会话排除、暂停期间手动续跑、启动扫描及畸形会话隔离、队列顺序、统计、本地化、设置界面生命周期及保存期间继续编辑的情况。`npm run test:runtime` 使用已发布的 DSH **0.1.7-rc.2**、**0.2.0-rc.1** 和 **0.2.1-alpha.1** Settings、Loader、HTTP 组件,并运行真实的 0.2 profile 兼容检查及缺少其中一种设置服务时的客户端激活测试。启动恢复测试在真实的 **0.2.0-rc.2** 和 **0.2.1-alpha.1** Session、Cordis、HTTP 组件中注入会话读取故障,验证健康会话仍能恢复;这不代表正常的 DSH 加载流程会产生损坏日志。运行时测试使用受控的 agent 事件,不会向模型服务发送请求。
428
+ `npm test` 覆盖错误恢复、自主循环上限与开关、子会话排除与重启后交接、暂停期间手动续跑、启动扫描及畸形会话隔离、队列顺序、统计、本地化、设置界面生命周期及保存期间继续编辑的情况。`npm run test:runtime` 使用已发布的 DSH **0.1.7-rc.2**、**0.2.0-rc.1** 和 **0.2.1-alpha.1** Settings、Loader、HTTP 组件,并运行真实的 0.2 profile 兼容检查及缺少其中一种设置服务时的客户端激活测试。启动恢复测试在真实的 **0.2.0-rc.2** 和 **0.2.1-alpha.1** Session、Cordis、HTTP 组件中注入会话读取故障,验证健康会话仍能恢复;这不代表正常的 DSH 加载流程会产生损坏日志。运行时测试使用受控的 agent 事件,不会向模型服务发送请求。
398
429
 
399
430
  rc.2 测试还加载已发布的客户端设置服务,使用不再包含 `mode` 的真实快照,验证卡片保存/重置、会话模式、并发保存、磁盘重新加载、语言同步与重新读取宿主配置。
400
431
 
@@ -0,0 +1,35 @@
1
+ ## Malformed-response recovery
2
+
3
+ Fix [#75](https://github.com/HsiangNianian/dsh-auto-continue/issues/75): `MALFORMED_RESPONSE` errors could be mistaken for permanent failures when their echoed tool arguments contained words such as `auth`, `permission`, `api_key` or `quota exceeded`
4
+
5
+ The classifier now recognizes that error code before matching permanent-error text. Explicit HTTP 401/403 failures are still blocked by the built-in rules, and custom retryable patterns retain their existing priority. Cooldown, backoff and consecutive-attempt limits still apply
6
+
7
+ The shared fix covers live errors, startup scans of loaded sessions and stored-session scans
8
+
9
+ ## Upgrade
10
+
11
+ Let current work finish, stop DSH, then update the profile you use
12
+
13
+ ```bash
14
+ dsh plugin --profile web add dsh-client-auto-continue@0.17.4
15
+ dsh web
16
+ ```
17
+
18
+ Desktop app users should update through the app's Plugins page and restart the app, since it uses its own profile
19
+
20
+ - Reload open browser tabs after restarting
21
+ - Remove the temporary `malformed_response` and `non-whitespace character after json` entries added for #75 from **Custom retryable errors**, then Save; keep any unrelated custom entries
22
+ - For an older conversation already stuck on the error, send `Continue` once after updating — startup recovery only scans failures within its configured window, 15 minutes by default
23
+
24
+ ## Validation
25
+
26
+ - Regression tests fail on 0.17.3 and pass with the fix: 17 error cases across live, loaded-session startup and stored-session scan paths
27
+ - Explicit HTTP 401/403 checks, genuine permanent failures, the consecutive-attempt cap and custom-pattern precedence
28
+ - Typecheck, build, full test suite and DSH runtime compatibility tests
29
+ - DSH 0.2.2-rc.1 core services with a local model adapter: the reported `auth` / `permission` cases recover without the workaround; real 401 and context-limit cases remain blocked
30
+
31
+ The model adapter injects deterministic failures; no real provider API or the reporter's private conversation was used
32
+
33
+ Thanks @yuloop for the detailed report and reproduction
34
+
35
+ **Full changes:** https://github.com/HsiangNianian/dsh-auto-continue/compare/v0.17.3...v0.17.4
@@ -0,0 +1,58 @@
1
+ Network outages no longer burn through the retry budget, the autonomous loop can be capped, and restarts can now hand interrupted subagent work back to its parent
2
+
3
+ ## Offline hold
4
+
5
+ Requested in [#81](https://github.com/HsiangNianian/dsh-auto-continue/issues/81). Previously a dropped connection used up every retry in a few minutes, and nothing continued once the network came back
6
+
7
+ - Before retrying a network failure (`TRANSPORT`, `TIMEOUT`, DNS or connection errors), the host checks it is online: a non-loopback interface plus one resolvable public name, DNS only, no requests
8
+ - While offline the retry waits and re-checks every `offlineCheckMs` (15s) without using up **Max consecutive**, then continues through the normal grace period and cooldown
9
+ - Server errors (5xx, 429) are not held. A message from you, a new turn, a pause or switching the session off cancels the hold
10
+ - With `HTTP(S)_PROXY` / `ALL_PROXY` set, only interfaces are checked, so a proxy-only network is never mistaken for offline
11
+ - On by default (`pauseWhenOffline`); turn it off in **Retry strategy** to keep the old behavior
12
+
13
+ ## Autonomous loop round limit
14
+
15
+ Also from [#81](https://github.com/HsiangNianian/dsh-auto-continue/issues/81)
16
+
17
+ - `loopMaxIterations` caps autonomous rounds per session; `0` (the default) means no limit
18
+ - When reached, the loop stops and reports it once: a log line, plus a browser notification when notifications are on
19
+ - Sending a message yourself or turning the loop back on starts the count over
20
+
21
+ ## Child sessions and goals after a restart
22
+
23
+ Requested in [#77](https://github.com/HsiangNianian/dsh-auto-continue/issues/77) and contributed in [#80](https://github.com/HsiangNianian/dsh-auto-continue/pull/80). All three switches are off by default
24
+
25
+ - **Wake child sessions after restart** (`resumeInterruptedChildren`): when the startup scan finds subagent or team-member sessions a restart cut off, their root session gets one message listing them, so the parent decides what to continue. Children are still never resumed directly, parents you stopped yourself are never woken, and only interruptions inside the scan window (`freshMs`) count
26
+ - **Re-arm goals disarmed by a restart** (`resumeGoals`): after an auto-continue send, re-arm an `active` goal the host disarmed, so its continuation rounds run again. This authorizes on your behalf, hence opt-in
27
+ - **Resume paused goals** (`resumePausedGoals`): also resume goals you paused by hand; needs `resumeGoals`
28
+
29
+ ## Plugin message source
30
+
31
+ From [#79](https://github.com/HsiangNianian/dsh-auto-continue/pull/79): **Send continue messages with plugin source** (`usePluginSource`, off by default) marks continue prompts as `plugin:dsh-client-auto-continue` instead of `user`. Echo matching accepts both
32
+
33
+ ## Upgrade
34
+
35
+ Let current work finish, stop DSH, then update the profile you use
36
+
37
+ ```bash
38
+ dsh plugin --profile web add dsh-client-auto-continue@0.18.0
39
+ dsh web
40
+ ```
41
+
42
+ Desktop app users should update through the app's Plugins page and restart the app, since it uses its own profile
43
+
44
+ - Reload open browser tabs after restarting so the settings page shows the new fields
45
+ - Existing settings, session modes and pauses stay in place. The offline hold is the only new behavior that is on by default
46
+
47
+ ## Validation
48
+
49
+ - Typecheck, build, the full regression suite and the DSH runtime compatibility tests for `0.1.7`, `0.2.0`, `0.2.0-rc.2`, `0.2.1` and `0.2.1-rc.2`
50
+ - DSH `0.2.2-rc.1` (latest): settings, profile compatibility, client settings services, startup scan and a real process restart recovering an unopened JSONL session with its original model
51
+ - The goal integration was checked against the `dsh-goal` 0.2.2-rc.1 `GoalView` / `resume(agent, { id, revision })` contract
52
+ - New offline / loop-cap suite fakes DNS and network interfaces; the existing recovery suites were also run with DNS forced to fail to confirm none depend on the real network
53
+
54
+ Runtime tests use controlled agent events and a deterministic model fixture, with no calls to an external model provider
55
+
56
+ Thanks @xiuchuan666, @loyalchiiina and @fu050409
57
+
58
+ **Full changes:** https://github.com/HsiangNianian/dsh-auto-continue/compare/v0.17.4...v0.18.0
package/lib/client.js CHANGED
@@ -69,6 +69,7 @@ var LOCALIZED_TEXT_DEFAULTS = {
69
69
  var DEFAULT_CONFIG = {
70
70
  locale: "en",
71
71
  ...LOCALIZED_TEXT_DEFAULTS.en,
72
+ usePluginSource: false,
72
73
  resumeSilentTurns: true,
73
74
  resumeCompletedTurns: false,
74
75
  continueTextLoop: "",
@@ -93,7 +94,13 @@ var DEFAULT_CONFIG = {
93
94
  loopWindowMs: 3e4,
94
95
  loopShortCount: 12,
95
96
  loopRepeatText: 4,
96
- loopToolRepeat: 5
97
+ loopToolRepeat: 5,
98
+ resumeInterruptedChildren: false,
99
+ resumeGoals: false,
100
+ resumePausedGoals: false,
101
+ pauseWhenOffline: true,
102
+ offlineCheckMs: 15e3,
103
+ loopMaxIterations: 0
97
104
  };
98
105
  var RECOVERY_WINDOW_MS = 10 * 60 * 1e3;
99
106
  var ECHO_WINDOW_MS = 10 * 60 * 1e3;
@@ -127,6 +134,8 @@ var zh = {
127
134
  "field.paused": "全局启用自动继续",
128
135
  "field.showComposerToggle": "在会话区显示自动继续开关",
129
136
  "field.showComposerToggleHint": "默认显示。隐藏控件不会改变会话模式;点击保存后生效。",
137
+ "field.usePluginSource": "以插件来源发送继续消息",
138
+ "field.usePluginSourceHint": "默认关闭,沿用旧版用户消息来源;开启后标记为本插件来源。点击保存后生效。",
130
139
  "composer.label": "自动继续",
131
140
  "composer.mode": "自动继续模式",
132
141
  "composer.scope": "只控制当前会话,立即保存并同步到其他标签页。关闭后也不再自动打断循环。",
@@ -149,6 +158,18 @@ var zh = {
149
158
  "field.resumeSilentTurnsHint": "已观察到模型活动但没有可见输出时续跑;不把空回合、图片或扩展内容误判为静默,冷却与连续上限照常生效。",
150
159
  "field.resumeCompletedTurns": "默认会话模式",
151
160
  "field.resumeCompletedTurnsHint": "用于没有单独设置模式的会话。仅故障恢复不会接力正常完成的回合;自主循环会在正常完成后继续。无输出和失败回合仍受重试预算约束。",
161
+ "field.resumeInterruptedChildren": "重启后唤醒子代理会话",
162
+ "field.resumeInterruptedChildrenHint": "启动扫描发现子代理 / 团队成员会话在重启时被打断时,给它的父会话发送一条带会话清单的提示,由父会话决定继续或收尾。父会话本身已正常结束(或被你手动停止)时不会唤醒。默认关闭。",
163
+ "field.resumeGoals": "重新武装被重启失活的 goal",
164
+ "field.resumeGoalsHint": "会话被自动续跑时,把被宿主 disarm 的 active goal 重新 arm,让 goal 的自动继续轮能转起来。注意:这等于代替你做了授权,所以默认关闭。",
165
+ "field.resumePausedGoals": "恢复被暂停的 goal",
166
+ "field.resumePausedGoalsHint": "连你手动 pause 的 goal 也一并恢复(需同时开启「重新武装被重启失活的 goal」)。暂停通常是人的明确决定,非必要别开。",
167
+ "field.pauseWhenOffline": "断网时暂停续跑",
168
+ "field.pauseWhenOfflineHint": "网络类错误(连不上、DNS 失败、传输超时)续跑前先检测宿主是否联网;断网时挂起,不消耗连续次数,联网后自动继续。设了 HTTP(S)_PROXY 时只检查网卡。",
169
+ "field.offlineCheckMs": "断网复检间隔 (ms)",
170
+ "field.offlineCheckMsHint": "挂起期间多久重新检测一次网络,最小 1000。",
171
+ "field.loopMaxIterations": "自主循环轮数上限",
172
+ "field.loopMaxIterationsHint": "每个会话自主续跑的最多轮数,0 为不限制。到达上限后停下并提示一次;你发消息或重新开启循环后重新计数。",
152
173
  "field.continueTextLoop": "自主循环的继续文本",
153
174
  "field.continueTextLoopHint": "自主循环每次续跑时发送的文本。",
154
175
  "default.continueTextLoop": LOCALIZED_TEXT_DEFAULTS.zh.continueTextLoop,
@@ -277,6 +298,8 @@ var en = {
277
298
  "field.paused": "Enable auto-continue globally",
278
299
  "field.showComposerToggle": "Show auto-continue switch in the composer",
279
300
  "field.showComposerToggleHint": "Shown by default. Hiding the control does not change session modes. Click Save to apply.",
301
+ "field.usePluginSource": "Send continue messages with plugin source",
302
+ "field.usePluginSourceHint": "Off by default to keep the legacy user-message source. Turn on to identify messages as coming from this plugin. Click Save to apply.",
280
303
  "composer.label": "Auto-continue",
281
304
  "composer.mode": "Auto-continue mode",
282
305
  "composer.scope": "Only affects this session. Saved immediately and synced across tabs. Off also disables loop-guard interruptions here.",
@@ -299,6 +322,18 @@ var en = {
299
322
  "field.resumeSilentTurnsHint": "Resume observed model activity without visible output. No-op turns, images and extension blocks are not treated as silent; cooldown and retry limits still apply.",
300
323
  "field.resumeCompletedTurns": "Default session mode",
301
324
  "field.resumeCompletedTurnsHint": "Applies to sessions without their own mode. Recovery only leaves normal completions alone; autonomous loop continues after them. Silent and failed turns still consume the retry budget.",
325
+ "field.resumeInterruptedChildren": "Wake child sessions after restart",
326
+ "field.resumeInterruptedChildrenHint": "When the startup scan finds a subagent / team-member session interrupted by a restart, send its parent session one prompt listing those children so the parent can continue or wrap up. Skipped when the parent already finished cleanly or you stopped it yourself. Off by default.",
327
+ "field.resumeGoals": "Re-arm goals disarmed by a restart",
328
+ "field.resumeGoalsHint": "When a session is auto-continued, re-arm an active goal that the host disarmed so its continuation rounds can run again. This authorizes on your behalf, so it is off by default.",
329
+ "field.resumePausedGoals": "Resume paused goals",
330
+ "field.resumePausedGoalsHint": "Also resume goals you paused by hand (requires “Re-arm goals disarmed by a restart” to be on as well). Pausing is normally a deliberate human decision; leave this off unless you want it.",
331
+ "field.pauseWhenOffline": "Pause while offline",
332
+ "field.pauseWhenOfflineHint": "Before retrying a network error (unreachable host, DNS failure, transport timeout), check that the host is online. While offline the retry waits without using up consecutive attempts, then continues once the network is back. With HTTP(S)_PROXY set, only network interfaces are checked.",
333
+ "field.offlineCheckMs": "Offline re-check interval (ms)",
334
+ "field.offlineCheckMsHint": "How often a held retry checks the network again. Minimum 1000.",
335
+ "field.loopMaxIterations": "Autonomous loop round limit",
336
+ "field.loopMaxIterationsHint": "Maximum autonomous rounds per session; 0 means no limit. When reached, the loop stops and tells you once; sending a message or turning the loop back on starts the count over.",
302
337
  "field.continueTextLoop": "Continue text (autonomous loop)",
303
338
  "field.continueTextLoopHint": "Text sent on each autonomous-loop continuation.",
304
339
  "default.continueTextLoop": LOCALIZED_TEXT_DEFAULTS.en.continueTextLoop,
@@ -1041,10 +1076,17 @@ var AutoContinueSettingsCardController = class {
1041
1076
  this.form = new CardForm(scope, [
1042
1077
  booleanField("paused"),
1043
1078
  booleanField("showComposerToggle"),
1079
+ booleanField("usePluginSource"),
1044
1080
  textField("continueText"),
1045
1081
  textField("continueTextMaxTokens"),
1046
1082
  booleanField("resumeSilentTurns"),
1047
1083
  booleanField("resumeCompletedTurns"),
1084
+ booleanField("resumeInterruptedChildren"),
1085
+ booleanField("resumeGoals"),
1086
+ booleanField("resumePausedGoals"),
1087
+ booleanField("pauseWhenOffline"),
1088
+ numberField("offlineCheckMs", 1e3),
1089
+ numberField("loopMaxIterations", 0),
1048
1090
  textField("continueTextLoop"),
1049
1091
  textField("continueTextSilent"),
1050
1092
  textField("continueTextInterrupted"),
@@ -1082,10 +1124,17 @@ var AutoContinueSettingsCardController = class {
1082
1124
  notificationFeedback: this.notificationFeedback,
1083
1125
  paused: this.form.field("paused"),
1084
1126
  showComposerToggle: this.form.field("showComposerToggle"),
1127
+ usePluginSource: this.form.field("usePluginSource"),
1085
1128
  continueText: this.form.field("continueText"),
1086
1129
  continueTextMaxTokens: this.form.field("continueTextMaxTokens"),
1087
1130
  resumeSilentTurns: this.form.field("resumeSilentTurns"),
1088
1131
  resumeCompletedTurns: this.form.field("resumeCompletedTurns"),
1132
+ resumeInterruptedChildren: this.form.field("resumeInterruptedChildren"),
1133
+ resumeGoals: this.form.field("resumeGoals"),
1134
+ resumePausedGoals: this.form.field("resumePausedGoals"),
1135
+ pauseWhenOffline: this.form.field("pauseWhenOffline"),
1136
+ offlineCheckMs: this.form.field("offlineCheckMs"),
1137
+ loopMaxIterations: this.form.field("loopMaxIterations"),
1089
1138
  continueTextLoop: this.form.field("continueTextLoop"),
1090
1139
  continueTextSilent: this.form.field("continueTextSilent"),
1091
1140
  continueTextInterrupted: this.form.field("continueTextInterrupted"),
@@ -1176,9 +1225,9 @@ function AutoContinueSettingsPage(props) {
1176
1225
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AutoContinueSettingsCard, { ...props }) });
1177
1226
  }
1178
1227
  var groups = [
1179
- { id: "general", fields: ["paused", "showComposerToggle", "resumeSilentTurns", "resumeCompletedTurns", "notify"] },
1180
- { id: "recovery", fields: ["graceMs", "cooldownMs", "maxConsecutive", "classify", "retryableErrorPatterns", "backoffFactor", "backoffMaxMs"] },
1181
- { id: "startup", fields: ["scanOnBoot", "scanLimit", "freshMs"] },
1228
+ { id: "general", fields: ["paused", "showComposerToggle", "usePluginSource", "resumeSilentTurns", "resumeCompletedTurns", "loopMaxIterations", "notify"] },
1229
+ { id: "recovery", fields: ["graceMs", "cooldownMs", "maxConsecutive", "classify", "retryableErrorPatterns", "backoffFactor", "backoffMaxMs", "pauseWhenOffline", "offlineCheckMs", "resumeGoals", "resumePausedGoals"] },
1230
+ { id: "startup", fields: ["scanOnBoot", "resumeInterruptedChildren", "scanLimit", "freshMs"] },
1182
1231
  { id: "prompts", fields: ["continueText", "continueTextMaxTokens", "continueTextSilent", "continueTextInterrupted", "continueTextLoop", "guardPendingText", "guardDoneText", "loopText"] },
1183
1232
  { id: "safety", fields: ["guardTools", "loopGuard", "loopShortChars", "loopWindowMs", "loopShortCount", "loopRepeatText", "loopToolRepeat"] },
1184
1233
  { id: "status", fields: ["verbose"] }