dsh-client-auto-continue 0.14.1 → 0.14.3

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/README.md CHANGED
@@ -80,6 +80,8 @@ The host-side engine subscribes to the session event firehose inside the dsh hos
80
80
 
81
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).
82
82
 
83
+ 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).
84
+
83
85
  The browser provides the settings card and composer switch, 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.
84
86
 
85
87
  ### Recovery workflow
@@ -96,12 +98,13 @@ DSH plugins install into a **profile** (`dsh web` → `web` profile). The comman
96
98
 
97
99
  | DSH runtime | Plugin version | Configuration entry point |
98
100
  | --- | --- | --- |
99
- | **0.2.1-alpha.1** | **0.14.1 verified** | **Plugins → dsh-client-auto-continue** |
101
+ | **0.2.1-rc.2** | **0.14.3 verified** | **Plugins → dsh-client-auto-continue** |
102
+ | **0.2.1-alpha.1** | **0.14.2 verified** | **Plugins → dsh-client-auto-continue** |
100
103
  | **0.2.0-rc.1** | **0.12.1 or newer** | **Plugins → dsh-client-auto-continue** |
101
104
  | **0.1.7-rc.2** | **0.11.9 or newer** | Same Plugins page |
102
105
  | Older hosts with the legacy settings API | Legacy UI retained | **Settings → Plugins → Plugin configuration** |
103
106
 
104
- DSH 0.1.0-rc.6 and earlier are unsupported. Automated runtime checks cover **0.1.7-rc.2**, **0.2.0-rc.1** 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.
107
+ 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** and **0.2.1-alpha.1**; 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.
105
108
 
106
109
  **Plugins 0.11.9 and 0.12.0 are rejected by DSH 0.2.0-rc.1’s version check.** Upgrade the plugin to 0.12.1 or newer; its existing configuration-form integration works on this runtime. See [#50](https://github.com/HsiangNianian/dsh-auto-continue/issues/50).
107
110
 
@@ -322,6 +325,8 @@ When migrating from the legacy settings file to DSH 0.1.7 / 0.2, move these valu
322
325
  | Max backoff (ms) | `300000` | Cap on the adaptive backoff interval |
323
326
  | Browser notifications | `off` | Notify about auto-continue events and successful settings saves; confirm switching notifications on or off |
324
327
 
328
+ 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.
329
+
325
330
  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:
326
331
 
327
332
  ```yaml
@@ -351,19 +356,21 @@ The recovery engine runs inside the DSH host. The browser provides the configura
351
356
 
352
357
  ## Development
353
358
 
354
- Use Node.js 22. Install both pinned runtime fixtures to reproduce CI locally:
359
+ Use Node.js 22. Install the pinned runtime fixtures to reproduce CI locally:
355
360
 
356
361
  ```bash
357
362
  npm ci
358
363
  npm ci --prefix tests/fixtures/dsh-0.1.7
359
364
  npm ci --prefix tests/fixtures/dsh-0.2.0
365
+ npm ci --prefix tests/fixtures/dsh-0.2.0-rc.2
366
+ npm ci --prefix tests/fixtures/dsh-0.2.1
360
367
  npm run typecheck
361
368
  npm run build
362
369
  npm test
363
370
  npm run test:runtime
364
371
  ```
365
372
 
366
- `npm test` covers recovery, autonomous-loop limits and toggles, child-session exclusion, manual resume during pauses, startup scanning, 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** and **0.2.0-rc.1** Settings, Loader and HTTP services. It also runs the actual 0.2 profile compatibility gate and checks client activation with Cordis 4.0.4 when one settings provider is absent. The runtime harness controls agent events; it does not send requests to a model provider.
373
+ `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.
367
374
 
368
375
  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.
369
376
 
@@ -391,3 +398,5 @@ CI typechecks, rebuilds, runs both test suites, verifies committed `lib/` artifa
391
398
  [![MIT](https://img.shields.io/badge/license-MIT-65a30d)](LICENSE)
392
399
 
393
400
  MIT © Hsiang Nianian
401
+
402
+ The rc.2 check also loads the published client settings service and verifies card save/reset, the composer toggle, locale synchronization and a fresh Host read, using snapshots without the removed `mode` field.
package/README.zh.md CHANGED
@@ -80,6 +80,8 @@
80
80
 
81
81
  宿主启动时还会扫描存活会话: 最后一个回合在**扫描时间窗**(默认 15 分钟)内以非人为原因结束、且其后没有新回合或用户消息的会话, 会被自动续跑(例如浏览器关闭期间宿主崩溃——agent-loop 恢复会话后引擎接着接手)。
82
82
 
83
+ 启动恢复按会话隔离异常。历史无法读取或含有无效事件时,只在本次启动扫描中跳过该会话并记录错误,其他会话仍可恢复,也不会被它占用恢复名额。插件不会静默删除损坏记录,以免漏掉人工停止或更新的回合。合法的空历史、尚未就绪的会话注册表仍会在扫描窗口内重试;修复后的会话若重新加载为新的 Session 对象,也可再次参与扫描。详见 [#58](https://github.com/HsiangNianian/dsh-auto-continue/issues/58)。
84
+
83
85
  浏览器负责设置卡片、会话区开关和一条状态桥(展示通知, 带「立即续跑 / 暂停该会话 1 小时」按钮并把动作回传给宿主引擎; 驱动卡片里的统计与暂停面板)。
84
86
 
85
87
  ### 恢复流程
@@ -96,12 +98,13 @@ DSH 插件安装进 **profile**(`dsh web` 对应 `web` profile)。下面的命
96
98
 
97
99
  | DSH 内核 | 插件版本 | 配置入口 |
98
100
  | --- | --- | --- |
99
- | **0.2.1-alpha.1** | **已验证 0.14.1** | **插件 → dsh-client-auto-continue** |
101
+ | **0.2.1-rc.2** | **已验证 0.14.3** | **插件 → dsh-client-auto-continue** |
102
+ | **0.2.1-alpha.1** | **已验证 0.14.2** | **插件 → dsh-client-auto-continue** |
100
103
  | **0.2.0-rc.1** | **0.12.1 或更新版本** | **插件 → dsh-client-auto-continue** |
101
104
  | **0.1.7-rc.2** | **0.11.9 或更新版本** | 同上,从主侧栏的插件页进入 |
102
105
  | 使用旧设置 API 的宿主 | 保留旧版设置界面兼容 | **设置 → 插件 → 插件配置** |
103
106
 
104
- 不支持 DSH 0.1.0-rc.6 及更早版本。自动化运行时测试覆盖 **0.1.7-rc.2**、**0.2.0-rc.1** 和 **0.2.1-alpha.1**。桌面应用版本不等于内置的 DSH 内核版本,请按内核版本判断兼容性;CLI 可运行 `dsh --version`,可用版本见 [DSH 官方 Releases](https://github.com/deepseek-ai/deepseek-harness/releases)。
107
+ 不支持 DSH 0.1.0-rc.6 及更早版本。自动化设置与兼容测试覆盖 **0.1.7-rc.2**、**0.2.0-rc.1** 和 **0.2.1-alpha.1**,另在 **0.2.0-rc.2** 和 **0.2.1-alpha.1** 上验证启动扫描的异常隔离。桌面应用版本不等于内置的 DSH 内核版本,请按内核版本判断兼容性;CLI 可运行 `dsh --version`,可用版本见 [DSH 官方 Releases](https://github.com/deepseek-ai/deepseek-harness/releases)。
105
108
 
106
109
  **插件 0.11.9 和 0.12.0 会被 DSH 0.2.0-rc.1 的版本检查拦截。** 请升级到 0.12.1 或更新版本;现有配置表单接口可在该内核正常工作。详见 [#50](https://github.com/HsiangNianian/dsh-auto-continue/issues/50)。
107
110
 
@@ -322,6 +325,8 @@ auto-continue:
322
325
  | 最大退避间隔 (ms) | `300000` | 自适应退避的上限 |
323
326
  | 浏览器通知 | 关 | 自动继续事件和配置保存成功时通知;切换通知开关并保存后确认状态 |
324
327
 
328
+ 暂停自动继续会停止自动续跑,但循环守卫仍独立运行。如需停止自动打断,请同时关闭**循环守卫**。仅含不可见字符的正文不计入可见消息复读;新的工具调用会重置正文重复计数,而同工具、同参数、同结果的工具死循环仍独立检测。
329
+
325
330
  遇到确认可以安全续跑的 provider 专属错误时(先确认手动发送「继续」确实能恢复), 应添加足够具体、稳定的片段, 而不是全局关闭错误分类:
326
331
 
327
332
  ```yaml
@@ -351,19 +356,21 @@ auto-continue:
351
356
 
352
357
  ## 开发
353
358
 
354
- 使用 Node.js 22,安装两个锁定版本的运行时测试环境,即可在本地执行 CI 检查:
359
+ 使用 Node.js 22,安装锁定版本的运行时测试环境,即可在本地执行 CI 检查:
355
360
 
356
361
  ```bash
357
362
  npm ci
358
363
  npm ci --prefix tests/fixtures/dsh-0.1.7
359
364
  npm ci --prefix tests/fixtures/dsh-0.2.0
365
+ npm ci --prefix tests/fixtures/dsh-0.2.0-rc.2
366
+ npm ci --prefix tests/fixtures/dsh-0.2.1
360
367
  npm run typecheck
361
368
  npm run build
362
369
  npm test
363
370
  npm run test:runtime
364
371
  ```
365
372
 
366
- `npm test` 覆盖错误恢复、自主循环上限与开关、子会话排除、暂停期间手动续跑、启动扫描、队列顺序、统计、本地化、设置界面生命周期及保存期间继续编辑的情况。`npm run test:runtime` 使用已发布的 DSH **0.1.7-rc.2** 和 **0.2.0-rc.1** Settings、Loader、HTTP 组件,并运行真实的 0.2 profile 兼容检查,以及 Cordis 4.0.4 中缺少其中一种设置服务时的客户端激活测试。运行时测试使用受控的 agent 事件,不会向模型服务发送请求。
373
+ `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 事件,不会向模型服务发送请求。
367
374
 
368
375
  修改链接的本地仓库后,运行 `npm run build` 写入最新的 `lib/` 产物,再重启 DSH 并刷新浏览器。开启 client HMR 的宿主可自动重新加载已构建的客户端包。
369
376
 
@@ -391,3 +398,5 @@ CI 执行类型检查、构建、两组测试、已提交 `lib/` 产物校验及
391
398
  [![MIT](https://img.shields.io/badge/license-MIT-65a30d)](LICENSE)
392
399
 
393
400
  MIT © Hsiang Nianian
401
+
402
+ rc.2 测试还加载已发布的客户端设置服务,使用不再包含 `mode` 的真实快照,验证卡片保存/重置、会话开关、语言同步与重新读取宿主配置。
package/lib/client.js CHANGED
@@ -125,7 +125,7 @@ var zh = {
125
125
  "composer.scope": "控制当前配置下所有会话的自动继续,修改立即保存。",
126
126
  "composer.saving": "正在保存自动继续设置…",
127
127
  "composer.saveFailed": "保存失败,请重试",
128
- "field.pausedHint": "恢复意外中断的会话。关闭并保存后,全局暂停恢复并取消已排队的继续。",
128
+ "field.pausedHint": "恢复意外中断的会话。关闭并保存后,全局暂停恢复并取消已排队的继续。循环守卫独立运行;如需停止自动打断,请同时关闭循环守卫。",
129
129
  "field.continueText": "继续文本",
130
130
  "field.continueTextHint": "中断后自动发送的消息内容。",
131
131
  "default.continueText": LOCALIZED_TEXT_DEFAULTS.zh.continueText,
@@ -257,7 +257,7 @@ var en = {
257
257
  "composer.scope": "Controls auto-continue for all sessions in this profile. Changes save immediately.",
258
258
  "composer.saving": "Saving auto-continue setting…",
259
259
  "composer.saveFailed": "Could not save. Try again.",
260
- "field.pausedHint": "Resume interrupted sessions. Turn off and save to pause recovery globally and cancel queued continuations.",
260
+ "field.pausedHint": "Resume interrupted sessions. Turn off and save to pause recovery globally and cancel queued continuations. The loop guard stays active; turn it off separately to stop automatic interruptions.",
261
261
  "field.continueText": "Continue text",
262
262
  "field.continueTextHint": "Message automatically sent after an interruption.",
263
263
  "default.continueText": LOCALIZED_TEXT_DEFAULTS.en.continueText,
@@ -526,6 +526,9 @@ function startBridge() {
526
526
  }
527
527
 
528
528
  // src/client/settings-form.ts
529
+ function canWriteSettings(snapshot) {
530
+ return snapshot.status === "ready" && snapshot.writable && (snapshot.mode === void 0 || snapshot.mode === "host");
531
+ }
529
532
  function numberField(field, min = 0) {
530
533
  return {
531
534
  field,
@@ -592,7 +595,7 @@ var CardForm = class {
592
595
  const snapshot = this.scope.getSnapshot();
593
596
  return {
594
597
  available: snapshot.status === "ready",
595
- writable: snapshot.writable,
598
+ writable: canWriteSettings(snapshot),
596
599
  dirty: this.plan().length > 0,
597
600
  invalid: this.plan().some((item) => item.run === void 0),
598
601
  saving: this.saving,
@@ -641,7 +644,7 @@ var CardForm = class {
641
644
  const plan = this.plan();
642
645
  const writes = plan.flatMap((item) => item.run === void 0 ? [] : [item.run]);
643
646
  const snapshot = this.scope.getSnapshot();
644
- if (plan.length === 0 || this.saving || writes.length !== plan.length || snapshot.status !== "ready" || !snapshot.writable || snapshot.mode !== "host") return false;
647
+ if (plan.length === 0 || this.saving || writes.length !== plan.length || !canWriteSettings(snapshot)) return false;
645
648
  const edits = plan.map(({ field, staged }) => ({ field, staged }));
646
649
  this.saving = true;
647
650
  this.failed = false;
@@ -998,7 +1001,7 @@ var AutoContinueSettingsCardController = class {
998
1001
  async save() {
999
1002
  const state2 = this.form.shell();
1000
1003
  const snapshot = this.scope.getSnapshot();
1001
- if (this.disposed || !state2.available || !state2.writable || !state2.dirty || state2.invalid || state2.saving || snapshot.mode !== "host") return;
1004
+ if (this.disposed || !state2.available || !state2.writable || !state2.dirty || state2.invalid || state2.saving) return;
1002
1005
  const sequence = ++this.saveSequence;
1003
1006
  const before = snapshot.value?.notify ?? DEFAULT_CONFIG.notify;
1004
1007
  const target = this.form.field("notify").text;
@@ -1020,7 +1023,7 @@ var AutoContinueSettingsCardController = class {
1020
1023
  return {
1021
1024
  visible: snapshot.status === "ready" && (snapshot.value?.showComposerToggle ?? DEFAULT_CONFIG.showComposerToggle),
1022
1025
  enabled: !(snapshot.value?.paused ?? DEFAULT_CONFIG.paused),
1023
- writable: snapshot.status === "ready" && snapshot.writable && snapshot.mode === "host",
1026
+ writable: canWriteSettings(snapshot),
1024
1027
  saving: this.composerSaving,
1025
1028
  failed: this.composerFailed
1026
1029
  };
@@ -1344,7 +1347,7 @@ function mountSettings(ctx, scope) {
1344
1347
  const syncLocale = () => {
1345
1348
  const active = ctx.locale.getLocale().active;
1346
1349
  const snapshot = scope.getSnapshot();
1347
- if (snapshot.status !== "ready" || !snapshot.writable || snapshot.mode !== "host") return;
1350
+ if (!canWriteSettings(snapshot)) return;
1348
1351
  if (mirroredLocale !== active) {
1349
1352
  mirroredLocale = active;
1350
1353
  mirrorAttempts = 0;