dsh-client-auto-continue 0.21.0 → 0.21.1

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,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.21.1](https://github.com/HsiangNianian/dsh-auto-continue/releases/tag/v0.21.1) — 2026-11-26
4
+
5
+ ### Fixed
6
+
7
+ - With **Resume goals** (`resumeGoals`) on, a continuation re-armed any `active` goal that was disarmed, including one the user disarmed by stopping a turn. After a stop followed by a retryable error, goal rounds started again on their own. The plugin now reads the session log and leaves the goal disarmed when the user's last stop is newer than the last goal `resume` or `create`. The failed turn is still retried. Restarts, loop-guard cancels and other host cancels still re-arm as before ([#97](https://github.com/HsiangNianian/dsh-auto-continue/pull/97), thanks @xiaobaifly7)
8
+
9
+ [Upgrade instructions and validation](docs/releases/v0.21.1.md) · [Full changes](https://github.com/HsiangNianian/dsh-auto-continue/compare/v0.21.0...v0.21.1)
10
+
3
11
  ## [0.21.0](https://github.com/HsiangNianian/dsh-auto-continue/releases/tag/v0.21.0) — 2026-11-25
4
12
 
5
13
  ### Added
package/README.md CHANGED
@@ -73,7 +73,7 @@ To update, let running work finish, stop DSH, run the same command again, then r
73
73
 
74
74
  | DSH runtime | Plugin version | Settings location |
75
75
  | --- | --- | --- |
76
- | 0.2.2-rc.1, 0.2.1-rc.2, 0.2.1-alpha.1 | 0.21.0 verified | **Plugins → dsh-client-auto-continue** |
76
+ | 0.2.2-rc.1, 0.2.1-rc.2, 0.2.1-alpha.1 | 0.21.1 verified | **Plugins → dsh-client-auto-continue** |
77
77
  | 0.2.0-rc.1 | 0.12.1 or newer | **Plugins → dsh-client-auto-continue** |
78
78
  | 0.1.7-rc.2 | 0.11.9 or newer | **Plugins → dsh-client-auto-continue** |
79
79
  | Older hosts with the legacy settings API | legacy UI | **Settings → Plugins → Plugin configuration** |
@@ -229,7 +229,7 @@ Times are in milliseconds. Text fields left empty use the built-in text in the c
229
229
  | Max backoff (ms) | `backoffMaxMs` | `300000` | Upper bound for the cooldown |
230
230
  | Pause while offline | `pauseWhenOffline` | `true` | Hold network-error retries while the host is offline, without using up attempts |
231
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 |
232
+ | Re-arm goals disarmed by a restart | `resumeGoals` | `false` | After a continue message, re-arm an `active` goal the restart disarmed. A goal you disarmed by stopping a turn stays off until you resume it. This acts on your behalf, hence off |
233
233
  | Resume paused goals | `resumePausedGoals` | `false` | Also resume goals you paused by hand. Needs `resumeGoals`. Without it, a session whose goal is paused is not resumed after a restart or an error |
234
234
 
235
235
  ### Startup recovery
package/README.ru.md CHANGED
@@ -73,7 +73,7 @@ dsh web
73
73
 
74
74
  | Среда DSH | Версия плагина | Где настройки |
75
75
  | --- | --- | --- |
76
- | 0.2.2-rc.1, 0.2.1-rc.2, 0.2.1-alpha.1 | 0.21.0 проверена | **Plugins → dsh-client-auto-continue** |
76
+ | 0.2.2-rc.1, 0.2.1-rc.2, 0.2.1-alpha.1 | 0.21.1 проверена | **Plugins → dsh-client-auto-continue** |
77
77
  | 0.2.0-rc.1 | 0.12.1 и новее | **Plugins → dsh-client-auto-continue** |
78
78
  | 0.1.7-rc.2 | 0.11.9 и новее | **Plugins → dsh-client-auto-continue** |
79
79
  | Старые хосты с устаревшим API настроек | старый интерфейс | **Settings → Plugins → Plugin configuration** |
@@ -231,7 +231,7 @@ dsh plugin --profile web remove dsh-client-auto-continue
231
231
  | Максимальная задержка (мс) | `backoffMaxMs` | `300000` | Верхняя граница интервала |
232
232
  | Пауза при отсутствии сети | `pauseWhenOffline` | `true` | Пока у хоста нет сети, повтор сетевых ошибок ждёт и не тратит попытки |
233
233
  | Интервал повторной проверки сети (мс) | `offlineCheckMs` | `15000` | Как часто проверять сеть во время ожидания; минимум 1000 |
234
- | Перевзводить цели, снятые перезапуском | `resumeGoals` | `false` | После отправки снова «взводит» цель (goal) в состоянии `active`, которую перезапуск снял. Это действие от вашего имени, поэтому по умолчанию выключено |
234
+ | Перевзводить цели, снятые перезапуском | `resumeGoals` | `false` | После отправки снова «взводит» цель (goal) в состоянии `active`, которую перезапуск снял. Цель, снятую вашей остановкой хода, плагин не трогает, пока вы сами её не возобновите. Это действие от вашего имени, поэтому по умолчанию выключено |
235
235
  | Возобновлять приостановленные цели | `resumePausedGoals` | `false` | Продолжать и цели, которые вы поставили на паузу сами. Работает только вместе с `resumeGoals`. Без этого сессия с приостановленной целью не продолжается после перезапуска или ошибки |
236
236
 
237
237
  ### Восстановление при запуске
package/README.zh.md CHANGED
@@ -73,7 +73,7 @@ dsh web
73
73
 
74
74
  | DSH 内核 | 插件版本 | 设置入口 |
75
75
  | --- | --- | --- |
76
- | 0.2.2-rc.1、0.2.1-rc.2、0.2.1-alpha.1 | 0.21.0 已验证 | **插件 → dsh-client-auto-continue** |
76
+ | 0.2.2-rc.1、0.2.1-rc.2、0.2.1-alpha.1 | 0.21.1 已验证 | **插件 → dsh-client-auto-continue** |
77
77
  | 0.2.0-rc.1 | 0.12.1 及以上 | **插件 → dsh-client-auto-continue** |
78
78
  | 0.1.7-rc.2 | 0.11.9 及以上 | **插件 → dsh-client-auto-continue** |
79
79
  | 仅有旧版设置 API 的宿主 | 旧版界面 | **设置 → 插件 → 插件配置** |
@@ -229,7 +229,7 @@ dsh plugin --profile web remove dsh-client-auto-continue
229
229
  | 最大退避间隔 (ms) | `backoffMaxMs` | `300000` | 冷却时间的上限 |
230
230
  | 断网时暂停续跑 | `pauseWhenOffline` | `true` | 宿主断网时挂起网络类错误的重试,不消耗次数 |
231
231
  | 断网复检间隔 (ms) | `offlineCheckMs` | `15000` | 挂起期间多久检测一次网络,最小 1000 |
232
- | 重新武装被重启失活的 goal | `resumeGoals` | `false` | 发出继续消息后,把重启时被 disarm 的 `active` goal 重新 arm。这相当于替你授权,所以默认关闭 |
232
+ | 重新武装被重启失活的 goal | `resumeGoals` | `false` | 发出继续消息后,把重启时被 disarm 的 `active` goal 重新 arm。你手动停止回合而失活的 goal 不会被重新 arm,等你自己恢复。这相当于替你授权,所以默认关闭 |
233
233
  | 恢复被暂停的 goal | `resumePausedGoals` | `false` | 连你手动暂停的 goal 也恢复;需同时开启 `resumeGoals`。不开时,goal 已暂停的会话在重启或出错后不续跑 |
234
234
 
235
235
  ### 启动恢复
@@ -0,0 +1,39 @@
1
+ If you stop a turn, the goal stays stopped, even when a retry kicks in afterwards
2
+
3
+ From @xiaobaifly7 in [#97](https://github.com/HsiangNianian/dsh-auto-continue/pull/97), again found on a real profile
4
+
5
+ ## What went wrong
6
+
7
+ With **Resume goals** on, every continuation re-armed an `active` goal that was disarmed. That setting is meant for restarts, which disarm goals as a side effect. But DSH also disarms the goal when you stop an ordinary turn, and the plugin couldn't tell the two apart
8
+
9
+ So: you press stop, type "stop touching the network", the next turn hits a 429, the plugin retries it and re-arms the goal, and goal rounds keep going as if you never stopped
10
+
11
+ ## What changed
12
+
13
+ Before re-arming, the plugin looks back through the session log. If your last stop is newer than the last goal `resume` or `create`, it leaves the goal off
14
+
15
+ - The failed turn is still retried, only the goal waits
16
+ - Resuming the goal yourself lifts the hold, since that's a newer `resume`
17
+ - Restarts, the loop guard and other host cancels don't count as your stop, so they re-arm like before
18
+ - Paused goals with **Resume paused goals** work the same as before
19
+ - If the log can't be read, nothing is re-armed
20
+
21
+ ## Upgrade
22
+
23
+ Let current work finish, stop DSH, then update the profile you use
24
+
25
+ ```bash
26
+ dsh plugin --profile web add dsh-client-auto-continue@0.21.1
27
+ dsh web
28
+ ```
29
+
30
+ Desktop app users should update through the app's Plugins page and restart the app, since it uses its own profile. No settings changed
31
+
32
+ ## Validation
33
+
34
+ - Typecheck, build, the full regression suite and the DSH runtime compatibility tests
35
+ - A new case in `tests/restart-resume-guards.mjs` retries a failed turn in five sessions: stopped by you, stopped then resumed, restarted, cancelled by a parent, and with no cancel cause. Only the first one keeps its goal off. It fails without the fix
36
+
37
+ Thanks @xiaobaifly7 for another one straight from real use
38
+
39
+ **Full changes:** https://github.com/HsiangNianian/dsh-auto-continue/compare/v0.21.0...v0.21.1
package/lib/index.js CHANGED
@@ -1888,6 +1888,17 @@ function isHostCancel(value) {
1888
1888
  const cause = readCancelCause(value);
1889
1889
  return cause !== void 0 && RESTART_CANCEL_CAUSES.has(cause);
1890
1890
  }
1891
+ function goalStoppedByUser(events) {
1892
+ for (let index = events.length - 1; index >= 0; index -= 1) {
1893
+ const event = events[index];
1894
+ if (event.type === "goal/change") {
1895
+ if (event.data?.operation === "resume" || event.data?.operation === "create") return false;
1896
+ } else if (event.type === "turn/end" && readCancelCause(event.data?.reason) === "user") {
1897
+ return true;
1898
+ }
1899
+ }
1900
+ return false;
1901
+ }
1891
1902
  function classifyChildInterruption(events, config) {
1892
1903
  let lastEnd;
1893
1904
  for (let i = events.length - 1; i >= 0; i -= 1) {
@@ -3981,6 +3992,10 @@ var AutoContinueRunner = class {
3981
3992
  }
3982
3993
  const ref = view.ref ?? { id: view.id, revision };
3983
3994
  if (view.phase === "active" && view.activation === "disarmed") {
3995
+ if (goalStoppedByUser(snapshotSessionEvents(agent.session))) {
3996
+ this.log(`会话 ${sessionId}: goal 是用户停下的, 不重新武装(等用户自己恢复)`);
3997
+ return;
3998
+ }
3984
3999
  goals.resume(agent, ref);
3985
4000
  this.log(`会话 ${sessionId}: goal 被重启失活, 已重新武装`);
3986
4001
  return;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-client-auto-continue",
3
3
  "description": "Automatically resume interrupted DSH conversations, with an optional autonomous loop.",
4
- "version": "0.21.0",
4
+ "version": "0.21.1",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/types/index.d.ts",
@@ -376,6 +376,24 @@ function isHostCancel(value: unknown): boolean {
376
376
  return cause !== undefined && RESTART_CANCEL_CAUSES.has(cause);
377
377
  }
378
378
 
379
+ /**
380
+ * Whether the user switched the goal off. A restart and a user stop of a turn that was not a goal
381
+ * round both leave an active goal disarmed; only the stop is a decision to wait. The newer of the
382
+ * last user stop and the last goal resume/create decides, so the user's own resume lifts the hold.
383
+ */
384
+ function goalStoppedByUser(events: readonly SessionEvent[]): boolean {
385
+ for (let index = events.length - 1; index >= 0; index -= 1) {
386
+ const event = events[index] as { type: string; data?: { operation?: unknown; reason?: unknown } };
387
+ if (event.type === 'goal/change') {
388
+ if (event.data?.operation === 'resume' || event.data?.operation === 'create') return false;
389
+ } else if (event.type === 'turn/end' && readCancelCause(event.data?.reason) === 'user') {
390
+ // Only the user's stop: a restart, parent, hook (loop guard) or unknown cause is not a decision to wait.
391
+ return true;
392
+ }
393
+ }
394
+ return false;
395
+ }
396
+
379
397
  /**
380
398
  * Decide whether a child session's tail is a restart interruption worth waking
381
399
  * its root session for. Returns `undefined` when the child finished normally,
@@ -2924,6 +2942,10 @@ export class AutoContinueRunner {
2924
2942
  }
2925
2943
  const ref: GoalRefLike = view.ref ?? { id: view.id, revision };
2926
2944
  if (view.phase === 'active' && view.activation === 'disarmed') {
2945
+ if (goalStoppedByUser(snapshotSessionEvents(agent.session))) {
2946
+ this.log(`会话 ${sessionId}: goal 是用户停下的, 不重新武装(等用户自己恢复)`);
2947
+ return;
2948
+ }
2927
2949
  goals.resume(agent, ref);
2928
2950
  this.log(`会话 ${sessionId}: goal 被重启失活, 已重新武装`);
2929
2951
  return;