dsh-client-auto-continue 0.11.8 → 0.11.9
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 +20 -8
- package/README.zh.md +20 -8
- package/lib/client.js +54 -10
- package/lib/client.js.map +2 -2
- package/lib/index.js +197 -89
- package/lib/types/client/locales.d.ts +5 -0
- package/lib/types/client/settings-card.d.ts +2 -0
- package/lib/types/host/engine.d.ts +15 -11
- package/lib/types/index.d.ts +145 -11
- package/lib/types/shared/core.d.ts +14 -4
- package/package.json +9 -3
- package/src/client/locales.ts +20 -10
- package/src/client/settings-card.tsx +27 -0
- package/src/host/engine.ts +159 -87
- package/src/index.ts +74 -27
- package/src/shared/core.ts +26 -4
package/README.md
CHANGED
|
@@ -44,6 +44,7 @@ For [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh we
|
|
|
44
44
|
- **English / Chinese localization** — the settings card, built-in resume / guard / loop text, and browser notifications follow DSH's active UI language (initially selected from the browser language). Only `en` and `zh` are supported; other languages fall back to Chinese. Switching languages updates built-in defaults without overwriting custom text
|
|
45
45
|
- **Templated continue text** — `continueText` supports `{code}` `{message}` `{status}` `{tool}` `{turn}` `{errorCount}` `{sessionTitle}` `{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")
|
|
46
46
|
- **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)
|
|
47
|
+
- **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.
|
|
47
48
|
- **Pause** — a global **Pause auto-continue** toggle in the settings card stops everything (live + scan) instantly; per-session pauses (e.g. via a notification button) suspend only one session until they expire. The **Resume now** notification button is the one explicit exception: pressing it is the user asking for exactly one send, pause or not
|
|
48
49
|
- **Notification buttons** — notifications carry **Resume now** (send immediately, ignoring cooldown, the consecutive cap and any pause) and **Pause this session 1h** actions
|
|
49
50
|
- **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
|
|
@@ -57,6 +58,7 @@ It watches the live event streams and reacts to:
|
|
|
57
58
|
| `turn/end` → `error` | Turn failed (model / network / timeout, …) |
|
|
58
59
|
| `turn/end` → `interrupted` | Crash-orphaned turn left behind by a host restart (recovered by the startup scan) |
|
|
59
60
|
| `turn/end` → `max-tokens` | Output token ceiling reached |
|
|
61
|
+
| `turn/end` → `completed` / `no-visible-output` with no visible output | Turn ended normally with reasoning only: no text, no tool call |
|
|
60
62
|
| `host/agent-error` | Agent failure with no turn position (only network/timeout-class messages auto-resume) |
|
|
61
63
|
|
|
62
64
|
**Never auto-continues:** user-aborted turns (`aborted`) or policy rejections (`blocked`); live `interrupted` turn-ends too — that marker is only written by crash repair when the host reloads, so orphaned turns are recovered by the startup scan, not the live path; sessions the host already resumed itself; running sessions; subagent sessions; anything inside the cooldown / consecutive-cap windows (configurable in the settings card, below). If an interrupted session already has queued turns, the continuation runs first and the existing turns retain their order behind it.
|
|
@@ -83,6 +85,8 @@ DSH plugins install into a **profile** (`dsh web` → `web` profile). Install, r
|
|
|
83
85
|
|
|
84
86
|
> **Use the latest DSH (recommended: 0.1.2-alpha.4 or newer).** Run `dsh --version` before installing. Plugin v0.11.1 supports the settings API used by DSH 0.1.2-alpha.2+ (including alpha.3 and alpha.4) while retaining compatibility with DSH 0.1.0-rc.7 through 0.1.1; rc.6 and earlier remain unsupported (`list slot ... requires options.id`). Preview releases may appear on the [official DSH releases page](https://github.com/deepseek-ai/deepseek-harness/releases) before the public npm tag catches up.
|
|
85
87
|
|
|
88
|
+
Plugin v0.11.9 drops the host engine's dependency on the legacy `settings` register/get namespace: entry config is injected directly via `apply(ctx, config)` and merged with schema defaults, fixing the host-half startup failure on the newer settings API (the client's `configForms` support is unchanged).
|
|
89
|
+
|
|
86
90
|
Plugin v0.11.8 also supports DSH 0.1.7-alpha.2's `configForms` API. Open **Plugins → dsh-client-auto-continue** for its settings; older DSH versions retain **Settings → Plugins**. This fixes the startup error `pending (waiting for service: settingsScope)` on the newer API.
|
|
87
91
|
|
|
88
92
|
### From npm (recommended)
|
|
@@ -159,15 +163,19 @@ Everything is configurable from the GUI — no file or console edits needed. Ope
|
|
|
159
163
|
|
|
160
164
|
The settings card groups controls by handoff, safety, recovery, loop breaking, and live status. Its header also keeps the open-source repository and a **Star on GitHub** shortcut within reach.
|
|
161
165
|
|
|
162
|
-
|
|
166
|
+
DSH 0.1.7 stores these values in the `auto-continue` entry's config in the active profile patch. The GUI applies edits live without restarting the engine. Older hosts use the `auto-continue` section in `~/.dsh/settings.yaml`; the YAML example below shows that legacy format. Omitted fields use the defaults below.
|
|
167
|
+
|
|
168
|
+
Startup recovery polls every three seconds for sessions that load late, up to `freshMs` after the engine starts. Each settled session history is inspected once. `scanLimit` limits eligible recoveries per pass, so healthy or permanent-error sessions cannot crowd out interrupted ones. Pausing suspends recovery within the same window; unloading cancels the poller.
|
|
163
169
|
|
|
164
|
-
The browser mirrors DSH's active language into the internal `locale` field. Leave the
|
|
170
|
+
The browser mirrors DSH's active language into the internal `locale` field. Leave the six localized text fields empty or omit them to follow that language automatically; any non-empty value is treated as your own template and is never rewritten when the language changes:
|
|
165
171
|
|
|
166
172
|
```yaml
|
|
167
173
|
auto-continue:
|
|
168
174
|
locale: 'en' # normally managed by the browser
|
|
169
175
|
paused: false
|
|
170
176
|
continueText: ''
|
|
177
|
+
resumeSilentTurns: true
|
|
178
|
+
continueTextSilent: ''
|
|
171
179
|
continueTextMaxTokens: ''
|
|
172
180
|
guardTools: true
|
|
173
181
|
guardPendingText: ''
|
|
@@ -202,13 +210,15 @@ auto-continue:
|
|
|
202
210
|
- Boolean fields are **tri-state**: *Inherit* (use the default) / *On* / *Off*
|
|
203
211
|
- Invalid drafts (non-numbers, values below the minimum) block the save with a hint
|
|
204
212
|
- In a read-only deployment the card shows the stored values but disables every control
|
|
205
|
-
- Changes apply immediately after Save and persist in `~/.dsh/settings.yaml`
|
|
213
|
+
- Changes apply immediately after Save and persist in the active profile config (or `~/.dsh/settings.yaml` on older hosts)
|
|
206
214
|
|
|
207
215
|
| Field | Default | Description |
|
|
208
216
|
| --- | --- | --- |
|
|
209
217
|
| Pause auto-continue | `off` | Global pause: no live or scan auto-send fires, queued pending sends are cancelled |
|
|
210
218
|
| Continue text | `Continue` | Text automatically sent after an interruption |
|
|
211
219
|
| Continue text (max tokens) | `Continue` | Text sent when the output token ceiling is reached (same placeholders) |
|
|
220
|
+
| Resume silent turns | `on` | Resume a turn that ended normally with reasoning only (no text, no tool call); does not reset the consecutive count |
|
|
221
|
+
| Continue text (silent turn) | `Continue. Your previous turn ended with internal reasoning only, ...` | Text sent to resume a silent turn (same placeholders) |
|
|
212
222
|
| Idempotency guard | `on` | Inspect the last tool call before resuming and steer the model (see What It Does) |
|
|
213
223
|
| Loop guard | `on` | Detect a running turn spinning in place and restart it (see What It Does) |
|
|
214
224
|
| Short-sentence max (chars) | `40` | A model message shorter than this counts as a short sentence (spinning signal) |
|
|
@@ -221,10 +231,10 @@ auto-continue:
|
|
|
221
231
|
| 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 |
|
|
222
232
|
| Grace period (ms) | `3000` | Wait after an interruption; cancelled if the host recovers on its own |
|
|
223
233
|
| Cooldown (ms) | `20000` | Min interval between auto-continues per session (failed attempts count too) |
|
|
224
|
-
| Max consecutive | `3` | Max consecutive auto-continues; stops until a user intervenes or a turn completes |
|
|
225
|
-
| Scan on
|
|
226
|
-
| Scan limit | `8` |
|
|
227
|
-
| Scan window (ms) | `900000` |
|
|
234
|
+
| Max consecutive | `3` | Max consecutive auto-continues; stops until a user intervenes or a turn completes with visible output |
|
|
235
|
+
| Scan on host startup | `on` | Recover interrupted sessions that become available during the startup window |
|
|
236
|
+
| Scan limit | `8` | Maximum eligible recoveries per pass, most recently active first |
|
|
237
|
+
| Scan window (ms) | `900000` | Maximum interruption age and duration of startup polling |
|
|
228
238
|
| Verbose logs | `on` | `[auto-continue]` console logs |
|
|
229
239
|
| Classify errors | `on` | Auto-resume transient failures only; auth / balance / model errors are skipped and notified |
|
|
230
240
|
| Custom retryable errors | empty | One case-insensitive literal per line; matching the error code, HTTP status, or message explicitly overrides the built-in classifier |
|
|
@@ -242,7 +252,7 @@ auto-continue:
|
|
|
242
252
|
|
|
243
253
|
Patterns are literal substrings, not regular expressions. Blank lines are ignored; any matching line wins before the built-in permanent-error rules. Cooldown and consecutive-attempt limits still apply.
|
|
244
254
|
|
|
245
|
-
`continueText` (and `continueTextMaxTokens`) accept the placeholders `{code}`, `{message}`, `{status}`, `{tool}` (last tool call before the failure), `{turn}`, `{errorCount}` (consecutive failures including this one), `{sessionTitle}` (from the session list) and `{elapsed}` (time since the failure, e.g. `1m5s`) — e.g. `Continue ({tool}: {code})` becomes `Continue (git push: UPSTREAM)`. The guard texts accept `{tool}` and `{result}` (a truncated excerpt of the last tool output).
|
|
255
|
+
`continueText` (and `continueTextMaxTokens`, `continueTextSilent`) accept the placeholders `{code}`, `{message}`, `{status}`, `{tool}` (last tool call before the failure), `{turn}`, `{errorCount}` (consecutive failures including this one), `{sessionTitle}` (from the session list) and `{elapsed}` (time since the failure, e.g. `1m5s`) — e.g. `Continue ({tool}: {code})` becomes `Continue (git push: UPSTREAM)`. The guard texts accept `{tool}` and `{result}` (a truncated excerpt of the last tool output).
|
|
246
256
|
|
|
247
257
|
---
|
|
248
258
|
|
|
@@ -259,6 +269,8 @@ The plugin is browser-only and touches **no files, credentials, or network beyon
|
|
|
259
269
|
|
|
260
270
|
## Development
|
|
261
271
|
|
|
272
|
+
The CI runtime test uses the published DSH 0.1.7 packages to check the HTTP bridge and live settings through the real Loader. Run `npm ci --prefix tests/fixtures/dsh-0.1.7` once, then `npm run test:runtime` after building.
|
|
273
|
+
|
|
262
274
|
```bash
|
|
263
275
|
npm run typecheck # tsc --noEmit
|
|
264
276
|
npm run build # lib/client.js + lib/index.js + lib/types
|
package/README.zh.md
CHANGED
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
- **中英文本地化** — 设置卡片、内置续跑 / 护栏 / 循环文案以及浏览器通知都跟随 DSH 当前界面语言(初始值来自浏览器语言)。只支持 `en` 和 `zh`, 其他语言回落中文; 切换语言只会替换内置默认值, 不会覆盖用户自定义文本
|
|
45
45
|
- **模板化继续文本** — `continueText` 支持 `{code}` `{message}` `{status}` `{tool}` `{turn}` `{errorCount}` `{sessionTitle}` `{elapsed}` 占位符, 续跑消息可携带失败上下文(如「继续 (git push 失败: UPSTREAM)」); 达到 `max-tokens` 时使用**另一套模板**(如「继续输出, 不要重复已生成的内容」)
|
|
46
46
|
- **幂等护栏** — 续跑前检查上一步工具调用: 结果未确认(回合在工具执行中途夭折, 如 `git push` 可能已经推上去了)时, 续跑消息会提示模型先确认状态、不要重复执行; 工具已确认成功时说明已完成、请勿重复; 工具失败则不加护栏(重试本来就是目的)。两段护栏文本都可配置(支持 `{tool}` / `{result}` 占位符)
|
|
47
|
+
- **无输出回合续跑** — 已观察到模型步骤或推理回复,但回合正常结束且没有可见输出时自动恢复。没有模型活动的空回合不会触发;文本、工具调用、图片、扩展块和已显示的流式内容均算可见输出。未观察到开始的回合不会被猜测为静默。启动后也能恢复显式的 `no-visible-output` 标记。关闭开关会取消排队中的静默续跑;即使开关关闭,静默回合也不会清零重试上限。
|
|
47
48
|
- **暂停** — 设置卡片里的全局 **暂停自动继续** 开关可立即停掉一切(实时 + 扫描); 会话级暂停(如通过通知按钮)只挂起单个会话, 到期自动恢复。唯一的显式例外是通知里的 **立即续跑** 按钮——按下它等于用户明确要求发送这一次, 不受暂停限制
|
|
48
49
|
- **通知按钮** — 通知带 **立即续跑**(无视冷却、连续上限与暂停, 马上发送)和 **暂停该会话 1 小时** 按钮
|
|
49
50
|
- **循环守卫** — 连**运行中的回合**也盯着, 四个信号都会触发守卫(取消当前回合并用可配置的循环提示文本重启, 「停止重复, 换一种方式」): 模型**连续输出完全相同的消息**(不限长度, 如 "Let me test variants of the regex…" 连续 7 遍)、单条流式 assistant 消息内部出现连续近似重复段落、短时间内连续多条短句且期间无工具调用(典型的「Let me read…」空转)、或同一工具被连续反复调用且**参数与结果都相同**(参数或结果有变化视为有进展)。取消带有内部来源标记, 绝不会与用户手动停止混淆——只有守卫发起的取消才会重启。阈值、时间窗与提示文本都可配置
|
|
@@ -57,6 +58,7 @@
|
|
|
57
58
|
| `turn/end` → `error` | 回合失败(模型 / 网络 / 超时等) |
|
|
58
59
|
| `turn/end` → `interrupted` | 宿主崩溃重启后遗留的中断回合(由启动扫描恢复) |
|
|
59
60
|
| `turn/end` → `max-tokens` | 达到输出 token 上限 |
|
|
61
|
+
| `turn/end` → `completed` / `no-visible-output` 且无可见输出 | 回合正常结束但只有推理: 没有文本, 也没有工具调用 |
|
|
60
62
|
| `host/agent-error` | 无回合位置的 Agent 失败(仅网络/超时类消息自动续跑) |
|
|
61
63
|
|
|
62
64
|
**绝不自动继续:** 用户主动停止(`aborted`)或策略拒绝(`blocked`); 实时流里的 `interrupted` 同样不自动继续——该标记只在宿主重载时由崩溃修复写入, 孤儿回合由启动扫描恢复, 不走实时路径; 宿主已自行恢复的会话; 正在运行的会话; 子代理会话; 处于冷却期 / 连续次数上限内的会话(可在设置卡片中调整, 见下)。若中断会话已有排队消息, 续跑消息会先执行, 原有消息随后按原顺序处理。
|
|
@@ -83,6 +85,8 @@ DSH 插件安装进 **profile**(`dsh web` 对应 `web` profile)。安装后重
|
|
|
83
85
|
|
|
84
86
|
> **请使用最新 DSH(推荐 0.1.2-alpha.4 或更高版本)。** 安装前先运行 `dsh --version`。插件 v0.11.1 已支持 DSH 0.1.2-alpha.2+ 使用的设置 API(包括 alpha.3 和 alpha.4), 同时继续兼容 DSH 0.1.0-rc.7 至 0.1.1; rc.6 及更早版本仍不支持(`list slot ... requires options.id`)。预览版可能先发布在 [DSH 官方 Releases](https://github.com/deepseek-ai/deepseek-harness/releases), 公开 npm 标签会稍后跟进。
|
|
85
87
|
|
|
88
|
+
插件 v0.11.9 移除了 host 引擎对旧 `settings` register/get 命名空间的依赖: 配置改为通过 `apply(ctx, config)` 直接注入并按 schema 默认值合并, 修复了新 settings API 下 host 侧启动失败的问题(client 的 `configForms` 支持不变)。
|
|
89
|
+
|
|
86
90
|
插件 v0.11.8 也已支持 DSH 0.1.7-alpha.2 的 `configForms` API。新版从 **插件 → dsh-client-auto-continue** 进入设置, 旧版仍从 **设置 → 插件** 进入。此适配修复了新版启动时的 `pending (waiting for service: settingsScope)` 错误。
|
|
87
91
|
|
|
88
92
|
### 从 npm 安装(推荐)
|
|
@@ -159,15 +163,19 @@ dsh web
|
|
|
159
163
|
|
|
160
164
|
新版配置卡会按接力方式、安全节奏、恢复雷达、循环断路器与现场状态组织配置; 卡片顶部也直接放出了开源仓库和 **Star on GitHub** 入口。
|
|
161
165
|
|
|
162
|
-
|
|
166
|
+
DSH 0.1.7 将这些值保存在当前 profile patch 的 `auto-continue` 条目 config 中,GUI 编辑会实时生效,无需重启引擎。旧版宿主仍使用 `~/.dsh/settings.yaml` 的 `auto-continue` 段落;下面的 YAML 示例展示旧版格式。省略的字段使用下表默认值。
|
|
167
|
+
|
|
168
|
+
启动恢复会每三秒等待一次延迟加载的会话,在引擎启动后的 `freshMs` 时间窗结束。每个已就绪会话的历史只检查一次,`scanLimit` 只限制每轮符合条件的恢复数量,正常会话或永久错误不会挤占名额。暂停会在同一时间窗内挂起恢复,卸载插件会取消轮询。
|
|
163
169
|
|
|
164
|
-
浏览器会把 DSH 当前语言同步到内部 `locale`
|
|
170
|
+
浏览器会把 DSH 当前语言同步到内部 `locale` 字段。下面六个本地化文本字段保持留空或直接省略时, 会自动跟随语言; 任何非空值都视为用户自己的模板, 切换语言时不会改写:
|
|
165
171
|
|
|
166
172
|
```yaml
|
|
167
173
|
auto-continue:
|
|
168
174
|
locale: 'zh' # 通常由浏览器自动维护
|
|
169
175
|
paused: false
|
|
170
176
|
continueText: ''
|
|
177
|
+
resumeSilentTurns: true
|
|
178
|
+
continueTextSilent: ''
|
|
171
179
|
continueTextMaxTokens: ''
|
|
172
180
|
guardTools: true
|
|
173
181
|
guardPendingText: ''
|
|
@@ -202,13 +210,15 @@ auto-continue:
|
|
|
202
210
|
- 布尔字段是三态:**继承**(用默认)/ 开 / 关
|
|
203
211
|
- 非法输入(非数字、小于最小值)会阻止保存并给出提示
|
|
204
212
|
- 只读部署中卡片只显示已存值, 所有控件禁用
|
|
205
|
-
-
|
|
213
|
+
- 保存后立即生效,持久化在当前 profile 配置中(旧版宿主使用 `~/.dsh/settings.yaml`)
|
|
206
214
|
|
|
207
215
|
| 字段 | 默认 | 说明 |
|
|
208
216
|
| --- | --- | --- |
|
|
209
217
|
| 暂停自动继续 | 关 | 全局暂停: 实时与扫描都不再自动发送, 已排队的待发送也会取消 |
|
|
210
218
|
| 继续文本 | `继续` | 中断后自动发送的消息内容 |
|
|
211
219
|
| 超限时的继续文本 | `继续` | 达到输出 token 上限时自动发送的文本(支持相同占位符) |
|
|
220
|
+
| 续跑无输出回合 | 开 | 回合正常结束但只有推理(没有文本、没有工具调用)时自动续跑; 不清零连续次数 |
|
|
221
|
+
| 无输出回合的继续文本 | `继续。你上一轮只输出了内部推理, ...` | 续跑无输出回合时发送的文本(支持相同占位符) |
|
|
212
222
|
| 幂等护栏 | 开 | 续跑前检查上一步工具调用并给出指引(见「它做什么」) |
|
|
213
223
|
| 循环守卫 | 开 | 检测运行中的回合空转并重启(见「它做什么」) |
|
|
214
224
|
| 短句长度上限 (字符) | `40` | 模型消息文本短于该值计为一条短句(空转信号) |
|
|
@@ -221,10 +231,10 @@ auto-continue:
|
|
|
221
231
|
| 工具已成功时的护栏文本 | `(上一步工具「{tool}」已完成, 结果: {result}; 不要重复执行, 直接继续)` | 上一步工具已确认成功时附加; 支持 {tool} / {result} 占位符 |
|
|
222
232
|
| 宽限期 (ms) | `3000` | 中断后等待的时长; 期间宿主自行恢复则取消 |
|
|
223
233
|
| 冷却时间 (ms) | `20000` | 同一会话两次自动「继续」的最小间隔(失败尝试也计入) |
|
|
224
|
-
| 最大连续次数 | `3` | 同一会话连续自动「继续」上限; 超过后停止,
|
|
225
|
-
|
|
|
226
|
-
| 扫描会话数 | `8` |
|
|
227
|
-
| 扫描时间窗 (ms) | `900000` |
|
|
234
|
+
| 最大连续次数 | `3` | 同一会话连续自动「继续」上限; 超过后停止, 直到用户介入或出现有可见输出的成功回合 |
|
|
235
|
+
| 启动恢复扫描 | 开 | 恢复启动时间窗内延迟加载的中断会话 |
|
|
236
|
+
| 扫描会话数 | `8` | 每轮最多恢复的符合条件的会话数,优先最近活动的会话 |
|
|
237
|
+
| 扫描时间窗 (ms) | `900000` | 中断的最大年龄,同时限制启动轮询的持续时间 |
|
|
228
238
|
| 详细日志 | 开 | 控制台输出 `[auto-continue]` 日志 |
|
|
229
239
|
| 错误分类 | 开 | 仅自动恢复临时性错误; 认证 / 余额 / 模型等永久性错误跳过并通知 |
|
|
230
240
|
| 自定义可恢复错误 | 空 | 每行一个大小写不敏感的普通文本片段; 命中错误码、HTTP 状态或消息时显式覆盖内置分类 |
|
|
@@ -242,7 +252,7 @@ auto-continue:
|
|
|
242
252
|
|
|
243
253
|
匹配项是普通子串, 不是正则表达式。空行会被忽略; 任一行命中后会优先于内置永久错误规则。冷却与最大连续次数仍然生效。
|
|
244
254
|
|
|
245
|
-
`continueText`(以及 `continueTextMaxTokens`)支持占位符 `{code}`、`{message}`、`{status}`、`{tool}`(失败前最后一次工具调用)、`{turn}`、`{errorCount}`(连续失败次数, 含本次)、`{sessionTitle}`(来自会话列表)和 `{elapsed}`(距失败经过的时间, 如 `1m5s`)——例如 `继续 ({tool}: {code})` 会变成 `继续 (git push: UPSTREAM)`。护栏文本支持 `{tool}` 与 `{result}`(上一步工具输出的截断摘要)。
|
|
255
|
+
`continueText`(以及 `continueTextMaxTokens`、`continueTextSilent`)支持占位符 `{code}`、`{message}`、`{status}`、`{tool}`(失败前最后一次工具调用)、`{turn}`、`{errorCount}`(连续失败次数, 含本次)、`{sessionTitle}`(来自会话列表)和 `{elapsed}`(距失败经过的时间, 如 `1m5s`)——例如 `继续 ({tool}: {code})` 会变成 `继续 (git push: UPSTREAM)`。护栏文本支持 `{tool}` 与 `{result}`(上一步工具输出的截断摘要)。
|
|
246
256
|
|
|
247
257
|
---
|
|
248
258
|
|
|
@@ -259,6 +269,8 @@ auto-continue:
|
|
|
259
269
|
|
|
260
270
|
## 开发
|
|
261
271
|
|
|
272
|
+
CI 会使用已发布的 DSH 0.1.7 组件,通过真实 Loader 检查 HTTP 桥与设置的实时读写。先运行一次 `npm ci --prefix tests/fixtures/dsh-0.1.7`,构建后运行 `npm run test:runtime`。
|
|
273
|
+
|
|
262
274
|
```bash
|
|
263
275
|
npm run typecheck # tsc --noEmit
|
|
264
276
|
npm run build # lib/client.js + lib/index.js + lib/types
|
package/lib/client.js
CHANGED
|
@@ -40,6 +40,7 @@ var LOCALIZED_TEXT_DEFAULTS = {
|
|
|
40
40
|
zh: {
|
|
41
41
|
continueText: "继续",
|
|
42
42
|
continueTextMaxTokens: "继续",
|
|
43
|
+
continueTextSilent: "继续。你上一轮只输出了内部推理, 既没有回复也没有调用工具, 用户什么都没看到。每一轮都要以工具调用或可见回复结束。",
|
|
43
44
|
guardPendingText: "(上一步工具「{tool}」可能未完成, 先确认状态再继续, 不要重复执行)",
|
|
44
45
|
guardDoneText: "(上一步工具「{tool}」已完成, 结果: {result}; 不要重复执行, 直接继续)",
|
|
45
46
|
loopText: "(检测到你可能陷入循环, 请停止重复刚才的动作, 换一种方式继续)"
|
|
@@ -47,6 +48,7 @@ var LOCALIZED_TEXT_DEFAULTS = {
|
|
|
47
48
|
en: {
|
|
48
49
|
continueText: "Continue",
|
|
49
50
|
continueTextMaxTokens: "Continue",
|
|
51
|
+
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.",
|
|
50
52
|
guardPendingText: '(The previous tool "{tool}" may not have completed. Check its state before continuing and do not run it again.)',
|
|
51
53
|
guardDoneText: '(The previous tool "{tool}" completed successfully. Result: {result}; do not run it again. Continue from there.)',
|
|
52
54
|
loopText: "(You may be stuck in a loop. Stop repeating the last action and continue with a different approach.)"
|
|
@@ -55,6 +57,7 @@ var LOCALIZED_TEXT_DEFAULTS = {
|
|
|
55
57
|
var DEFAULT_CONFIG = {
|
|
56
58
|
locale: "zh",
|
|
57
59
|
...LOCALIZED_TEXT_DEFAULTS.zh,
|
|
60
|
+
resumeSilentTurns: true,
|
|
58
61
|
guardTools: true,
|
|
59
62
|
graceMs: 3e3,
|
|
60
63
|
cooldownMs: 2e4,
|
|
@@ -106,6 +109,11 @@ var zh = {
|
|
|
106
109
|
"field.continueTextMaxTokens": "超限时的继续文本",
|
|
107
110
|
"field.continueTextMaxTokensHint": "达到输出 token 上限时自动发送的文本, 支持与继续文本相同的占位符。",
|
|
108
111
|
"default.continueTextMaxTokens": LOCALIZED_TEXT_DEFAULTS.zh.continueTextMaxTokens,
|
|
112
|
+
"field.resumeSilentTurns": "续跑无输出回合",
|
|
113
|
+
"field.resumeSilentTurnsHint": "已观察到模型活动但没有可见输出时续跑;不把空回合、图片或扩展内容误判为静默,冷却与连续上限照常生效。",
|
|
114
|
+
"field.continueTextSilent": "无输出回合的继续文本",
|
|
115
|
+
"field.continueTextSilentHint": "回合只输出推理就结束时自动发送的文本, 支持与继续文本相同的占位符。",
|
|
116
|
+
"default.continueTextSilent": LOCALIZED_TEXT_DEFAULTS.zh.continueTextSilent,
|
|
109
117
|
"field.guardTools": "幂等护栏",
|
|
110
118
|
"field.guardToolsHint": "续跑前检查上一步工具调用: 结果未确认时提示先确认状态, 已成功时提示不要重复执行, 避免重复 commit/调 API。",
|
|
111
119
|
"field.guardPendingText": "结果未确认时的护栏文本",
|
|
@@ -119,13 +127,13 @@ var zh = {
|
|
|
119
127
|
"field.cooldownMs": "冷却时间 (ms)",
|
|
120
128
|
"field.cooldownMsHint": "同一会话两次自动「继续」的最小间隔, 失败尝试也计入。",
|
|
121
129
|
"field.maxConsecutive": "最大连续次数",
|
|
122
|
-
"field.maxConsecutiveHint": "
|
|
123
|
-
"field.scanOnBoot": "
|
|
124
|
-
"field.scanOnBootHint": "
|
|
130
|
+
"field.maxConsecutiveHint": "同一会话连续自动「继续」的上限;直到用户介入或成功回合产生已确认的可见输出才清零。",
|
|
131
|
+
"field.scanOnBoot": "启动恢复扫描",
|
|
132
|
+
"field.scanOnBootHint": "宿主启动后在扫描时间窗内等待延迟加载的中断会话,每个已就绪会话只检查一次。",
|
|
125
133
|
"field.scanLimit": "扫描会话数",
|
|
126
|
-
"field.scanLimitHint": "
|
|
134
|
+
"field.scanLimitHint": "每次扫描最多恢复多少个符合条件的会话,优先最近活动的会话。",
|
|
127
135
|
"field.freshMs": "扫描时间窗 (ms)",
|
|
128
|
-
"field.freshMsHint": "
|
|
136
|
+
"field.freshMsHint": "只处理该时间窗内的中断;启动轮询也会在这段时间后结束。",
|
|
129
137
|
"field.verbose": "详细日志",
|
|
130
138
|
"field.verboseHint": "在浏览器控制台输出 [auto-continue] 日志。",
|
|
131
139
|
"field.classify": "错误分类",
|
|
@@ -210,6 +218,11 @@ var en = {
|
|
|
210
218
|
"field.continueTextMaxTokens": "Continue text (max tokens)",
|
|
211
219
|
"field.continueTextMaxTokensHint": "Text sent when the output token ceiling is reached; same placeholders as the continue text.",
|
|
212
220
|
"default.continueTextMaxTokens": LOCALIZED_TEXT_DEFAULTS.en.continueTextMaxTokens,
|
|
221
|
+
"field.resumeSilentTurns": "Resume silent turns",
|
|
222
|
+
"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.",
|
|
223
|
+
"field.continueTextSilent": "Continue text (silent turn)",
|
|
224
|
+
"field.continueTextSilentHint": "Text sent when a turn ends with reasoning only; same placeholders as the continue text.",
|
|
225
|
+
"default.continueTextSilent": LOCALIZED_TEXT_DEFAULTS.en.continueTextSilent,
|
|
213
226
|
"field.guardTools": "Idempotency guard",
|
|
214
227
|
"field.guardToolsHint": "Before resuming, inspect the last tool call: if its result is unconfirmed, tell the model to check state first; if it succeeded, tell it not to rerun — avoids duplicate commits / API calls.",
|
|
215
228
|
"field.guardPendingText": "Guard text (unconfirmed result)",
|
|
@@ -223,13 +236,13 @@ var en = {
|
|
|
223
236
|
"field.cooldownMs": "Cooldown (ms)",
|
|
224
237
|
"field.cooldownMsHint": "Minimum interval between auto-continues per session; failed attempts count too.",
|
|
225
238
|
"field.maxConsecutive": "Max consecutive",
|
|
226
|
-
"field.maxConsecutiveHint": "Max consecutive auto-continues per session;
|
|
227
|
-
"field.scanOnBoot": "Scan on
|
|
228
|
-
"field.scanOnBootHint": "
|
|
239
|
+
"field.maxConsecutiveHint": "Max consecutive auto-continues per session; resets only after user intervention or a completed turn with confirmed visible output.",
|
|
240
|
+
"field.scanOnBoot": "Scan on host startup",
|
|
241
|
+
"field.scanOnBootHint": "Wait for delayed interrupted sessions during the startup scan window; inspect each settled session once.",
|
|
229
242
|
"field.scanLimit": "Scan limit",
|
|
230
|
-
"field.scanLimitHint": "
|
|
243
|
+
"field.scanLimitHint": "Maximum eligible sessions to recover per pass, most recently active first.",
|
|
231
244
|
"field.freshMs": "Scan window (ms)",
|
|
232
|
-
"field.freshMsHint": "Only interruptions inside this window are considered.",
|
|
245
|
+
"field.freshMsHint": "Only interruptions inside this window are considered; startup polling also ends after this duration.",
|
|
233
246
|
"field.verbose": "Verbose logs",
|
|
234
247
|
"field.verboseHint": "Log [auto-continue] lines to the browser console.",
|
|
235
248
|
"field.classify": "Classify errors",
|
|
@@ -1033,6 +1046,8 @@ var AutoContinueSettingsCardController = class {
|
|
|
1033
1046
|
booleanField("paused"),
|
|
1034
1047
|
textField("continueText"),
|
|
1035
1048
|
textField("continueTextMaxTokens"),
|
|
1049
|
+
booleanField("resumeSilentTurns"),
|
|
1050
|
+
textField("continueTextSilent"),
|
|
1036
1051
|
booleanField("guardTools"),
|
|
1037
1052
|
textField("guardPendingText"),
|
|
1038
1053
|
textField("guardDoneText"),
|
|
@@ -1064,6 +1079,8 @@ var AutoContinueSettingsCardController = class {
|
|
|
1064
1079
|
paused: this.form.field("paused"),
|
|
1065
1080
|
continueText: this.form.field("continueText"),
|
|
1066
1081
|
continueTextMaxTokens: this.form.field("continueTextMaxTokens"),
|
|
1082
|
+
resumeSilentTurns: this.form.field("resumeSilentTurns"),
|
|
1083
|
+
continueTextSilent: this.form.field("continueTextSilent"),
|
|
1067
1084
|
guardTools: this.form.field("guardTools"),
|
|
1068
1085
|
guardPendingText: this.form.field("guardPendingText"),
|
|
1069
1086
|
guardDoneText: this.form.field("guardDoneText"),
|
|
@@ -1465,6 +1482,33 @@ function AutoContinueSettingsCard(props) {
|
|
|
1465
1482
|
placeholder: t("default.continueTextMaxTokens"),
|
|
1466
1483
|
onReset: () => props.resetField("continueTextMaxTokens")
|
|
1467
1484
|
}
|
|
1485
|
+
),
|
|
1486
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1487
|
+
BooleanField,
|
|
1488
|
+
{
|
|
1489
|
+
wide: true,
|
|
1490
|
+
id: "auto-continue-resume-silent-turns",
|
|
1491
|
+
label: t("field.resumeSilentTurns"),
|
|
1492
|
+
hint: t("field.resumeSilentTurnsHint"),
|
|
1493
|
+
...shared,
|
|
1494
|
+
...state2.resumeSilentTurns,
|
|
1495
|
+
onEdit: (text) => props.edit("resumeSilentTurns", text),
|
|
1496
|
+
onReset: () => props.resetField("resumeSilentTurns")
|
|
1497
|
+
}
|
|
1498
|
+
),
|
|
1499
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1500
|
+
ValueField,
|
|
1501
|
+
{
|
|
1502
|
+
wide: true,
|
|
1503
|
+
id: "auto-continue-continue-text-silent",
|
|
1504
|
+
label: t("field.continueTextSilent"),
|
|
1505
|
+
hint: t("field.continueTextSilentHint"),
|
|
1506
|
+
...shared,
|
|
1507
|
+
...state2.continueTextSilent,
|
|
1508
|
+
onEdit: (text) => props.edit("continueTextSilent", text),
|
|
1509
|
+
placeholder: t("default.continueTextSilent"),
|
|
1510
|
+
onReset: () => props.resetField("continueTextSilent")
|
|
1511
|
+
}
|
|
1468
1512
|
)
|
|
1469
1513
|
]
|
|
1470
1514
|
}
|