dsh-client-auto-continue 0.11.4 → 0.11.6

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
@@ -16,6 +16,7 @@
16
16
  <a href="https://www.npmjs.com/package/dsh-client-auto-continue"><img src="https://img.shields.io/npm/dm/dsh-client-auto-continue?label=downloads" alt="npm downloads"></a>
17
17
  <a href="https://github.com/HsiangNianian/dsh-auto-continue/stargazers"><img src="https://img.shields.io/github/stars/HsiangNianian/dsh-auto-continue?logo=github&label=Stars" alt="GitHub stars"></a>
18
18
  <a href="https://github.com/HsiangNianian/dsh-auto-continue/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-65a30d?style=flat" alt="MIT license"></a>
19
+ <br>
19
20
  <a href="https://awesome-dsh-plugin.com"><img src="https://awesome-dsh-plugin.com/badge.svg" alt="awesome · DSH plugin"></a>
20
21
  <a href="https://www.dsh.so/artifact/dsh-auto-continue/"><img src="https://www.dsh.so/badge/install/dsh-auto-continue.svg" alt="dsh.so install"></a>
21
22
  <br>
@@ -45,7 +46,7 @@ For [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (`dsh we
45
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)
46
47
  - **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
47
48
  - **Notification buttons** — notifications carry **Resume now** (send immediately, ignoring cooldown, the consecutive cap and any pause) and **Pause this session 1h** actions
48
- - **Loop guard** — watches **running** turns too. Three 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), 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
49
+ - **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
49
50
  - **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
50
51
  - **Browser notifications** — optional alerts when auto-continue fires, gives up, or hits a permanent error; the browser asks for permission on first use, and nothing is shown again after a denial
51
52
 
@@ -211,7 +212,7 @@ auto-continue:
211
212
  | Short-sentence max (chars) | `40` | A model message shorter than this counts as a short sentence (spinning signal) |
212
213
  | Short-sentence window (ms) | `30000` | Consecutive short sentences must land inside this window; normal thinking spread over time is not misjudged |
213
214
  | Short-sentence threshold | `12` | Consecutive short sentences inside the window, with no tool call in between, trip the loop guard |
214
- | Identical message count | `4` | Consecutive identical messages (any length) trip the loop guard — the strongest spinning signal |
215
+ | Identical message count | `4` | Consecutive identical messages (any length) trip the loop guard — the strongest spinning signal; the same threshold is also used for repeated near-duplicate streamed paragraphs inside one message |
215
216
  | Same-tool repeat count | `5` | Consecutive calls of the same tool with identical arguments and results trip the loop guard |
216
217
  | Loop text | `(You may be stuck in a loop. Stop repeating the last action and continue with a different approach.)` | Text sent after the loop guard restarts a turn; `{tool}` placeholder |
217
218
  | Guard text (unconfirmed result) | `(The previous tool "{tool}" may not have completed. Check its state before continuing and do not run it again.)` | Appended when the last tool may have partially executed; `{tool}` placeholder |
package/README.zh.md CHANGED
@@ -16,6 +16,7 @@
16
16
  <a href="https://www.npmjs.com/package/dsh-client-auto-continue"><img src="https://img.shields.io/npm/dm/dsh-client-auto-continue?label=downloads" alt="npm downloads"></a>
17
17
  <a href="https://github.com/HsiangNianian/dsh-auto-continue/stargazers"><img src="https://img.shields.io/github/stars/HsiangNianian/dsh-auto-continue?logo=github&label=Stars" alt="GitHub stars"></a>
18
18
  <a href="https://github.com/HsiangNianian/dsh-auto-continue/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-65a30d?style=flat" alt="MIT license"></a>
19
+ <br>
19
20
  <a href="https://awesome-dsh-plugin.com"><img src="https://awesome-dsh-plugin.com/badge.svg" alt="awesome · DSH plugin"></a>
20
21
  <a href="https://www.dsh.so/artifact/dsh-auto-continue/"><img src="https://www.dsh.so/badge/install/dsh-auto-continue.svg" alt="dsh.so install"></a>
21
22
  <br>
@@ -45,7 +46,7 @@
45
46
  - **幂等护栏** — 续跑前检查上一步工具调用: 结果未确认(回合在工具执行中途夭折, 如 `git push` 可能已经推上去了)时, 续跑消息会提示模型先确认状态、不要重复执行; 工具已确认成功时说明已完成、请勿重复; 工具失败则不加护栏(重试本来就是目的)。两段护栏文本都可配置(支持 `{tool}` / `{result}` 占位符)
46
47
  - **暂停** — 设置卡片里的全局 **暂停自动继续** 开关可立即停掉一切(实时 + 扫描); 会话级暂停(如通过通知按钮)只挂起单个会话, 到期自动恢复。唯一的显式例外是通知里的 **立即续跑** 按钮——按下它等于用户明确要求发送这一次, 不受暂停限制
47
48
  - **通知按钮** — 通知带 **立即续跑**(无视冷却、连续上限与暂停, 马上发送)和 **暂停该会话 1 小时** 按钮
48
- - **循环守卫** — 连**运行中的回合**也盯着, 三个信号都会触发守卫(取消当前回合并用可配置的循环提示文本重启, 「停止重复, 换一种方式」): 模型**连续输出完全相同的消息**(不限长度, 如 "Let me test variants of the regex…" 连续 7 遍)、短时间内连续多条短句且期间无工具调用(典型的「Let me read…」空转)、或同一工具被连续反复调用且**参数与结果都相同**(参数或结果有变化视为有进展)。取消带有内部来源标记, 绝不会与用户手动停止混淆——只有守卫发起的取消才会重启。阈值、时间窗与提示文本都可配置
49
+ - **循环守卫** — 连**运行中的回合**也盯着, 四个信号都会触发守卫(取消当前回合并用可配置的循环提示文本重启, 「停止重复, 换一种方式」): 模型**连续输出完全相同的消息**(不限长度, 如 "Let me test variants of the regex…" 连续 7 遍)、单条流式 assistant 消息内部出现连续近似重复段落、短时间内连续多条短句且期间无工具调用(典型的「Let me read…」空转)、或同一工具被连续反复调用且**参数与结果都相同**(参数或结果有变化视为有进展)。取消带有内部来源标记, 绝不会与用户手动停止混淆——只有守卫发起的取消才会重启。阈值、时间窗与提示文本都可配置
49
50
  - **统计面板** — 设置卡片展示今日自动继续次数、恢复成功、继续后失败、永久性跳过、达上限停止、循环打断, 按错误码统计, 可一键清零
50
51
  - **浏览器通知** — 可选: 自动继续成功 / 放弃 / 遇到永久性错误时弹出提醒; 首次使用时请求权限, 被拒绝后不再打扰
51
52
 
@@ -211,7 +212,7 @@ auto-continue:
211
212
  | 短句长度上限 (字符) | `40` | 模型消息文本短于该值计为一条短句(空转信号) |
212
213
  | 短句时间窗 (ms) | `30000` | 连续短句必须落在这个时间窗内; 正常思考的短文本散布在长时间里不会被误判 |
213
214
  | 连续短句阈值 | `12` | 时间窗内连续多少条短句且期间无工具调用时判定空转循环 |
214
- | 相同消息重复次数 | `4` | 连续输出多少条完全相同的消息时判定空转(不限长度, 最强信号) |
215
+ | 相同消息重复次数 | `4` | 连续输出多少条完全相同的消息时判定空转(不限长度, 最强信号); 同一阈值也用于单条流式消息内连续近似重复段落 |
215
216
  | 同工具重复次数 | `5` | 同工具+同参数+同结果的连续调用多少次时判定死循环 |
216
217
  | 循环提示文本 | `(检测到你可能陷入循环, 请停止重复刚才的动作, 换一种方式继续)` | 打断后重启回合时发送的文本; 支持 {tool} 占位符 |
217
218
  | 结果未确认时的护栏文本 | `(上一步工具「{tool}」可能未完成, 先确认状态再继续, 不要重复执行)` | 上一步工具可能已部分执行时附加; 支持 {tool} 占位符 |
package/lib/client.js CHANGED
@@ -147,7 +147,7 @@ var zh = {
147
147
  "stats.gaveUp": "停止(达上限)",
148
148
  "stats.looped": "循环打断",
149
149
  "field.loopGuard": "循环守卫",
150
- "field.loopGuardHint": "检测运行中的回合空转: 连续短句且无工具调用, 或连续调用相同工具时, 自动取消并用循环提示文本重启回合。",
150
+ "field.loopGuardHint": "检测运行中的回合空转: 连续短句且无工具调用、流式消息内连续复读, 或连续调用相同工具时, 自动取消并用循环提示文本重启回合。",
151
151
  "field.loopShortChars": "短句长度上限 (字符)",
152
152
  "field.loopShortCharsHint": "模型消息文本短于该值计为一条短句(空转信号)。",
153
153
  "field.loopWindowMs": "短句时间窗 (ms)",
@@ -155,7 +155,7 @@ var zh = {
155
155
  "field.loopShortCount": "连续短句阈值",
156
156
  "field.loopShortCountHint": "时间窗内连续多少条短句且期间无工具调用时判定空转循环。",
157
157
  "field.loopRepeatText": "相同消息重复次数",
158
- "field.loopRepeatTextHint": "连续输出多少条完全相同的消息时判定空转(最强信号, 不限长度, 如模型反复说同一句话)。",
158
+ "field.loopRepeatTextHint": "连续输出多少条完全相同的消息时判定空转(最强信号, 不限长度, 也用于流式消息内连续复读段落)。",
159
159
  "field.loopToolRepeat": "同工具重复次数",
160
160
  "field.loopToolRepeatHint": "同工具+同参数+同结果的连续调用多少次时判定死循环; 参数或结果有变化视为有进展。",
161
161
  "field.loopText": "循环提示文本",
@@ -251,7 +251,7 @@ var en = {
251
251
  "stats.gaveUp": "Gave up (cap)",
252
252
  "stats.looped": "Loops broken",
253
253
  "field.loopGuard": "Loop guard",
254
- "field.loopGuardHint": "Detects a running turn spinning in place — many short sentences with no tool calls, or the same tool repeating — cancels it and restarts with the loop text.",
254
+ "field.loopGuardHint": "Detects a running turn spinning in place — many short sentences with no tool calls, repeated paragraphs inside one streamed assistant message, or the same tool repeating — then cancels and restarts with the loop text.",
255
255
  "field.loopShortChars": "Short-sentence max (chars)",
256
256
  "field.loopShortCharsHint": "A model message shorter than this counts as a short sentence (spinning signal).",
257
257
  "field.loopWindowMs": "Short-sentence window (ms)",
@@ -259,7 +259,7 @@ var en = {
259
259
  "field.loopShortCount": "Short-sentence threshold",
260
260
  "field.loopShortCountHint": "How many consecutive short sentences inside the window, with no tool call, trip the loop guard.",
261
261
  "field.loopRepeatText": "Identical message count",
262
- "field.loopRepeatTextHint": "How many consecutive identical messages trip the guard (strongest signal, any length, e.g. the model repeating the same line).",
262
+ "field.loopRepeatTextHint": "How many consecutive identical messages trip the guard (strongest signal, any length; also used for repeated paragraphs inside one streamed assistant message).",
263
263
  "field.loopToolRepeat": "Same-tool repeat count",
264
264
  "field.loopToolRepeatHint": "How many consecutive calls of the same tool with identical arguments and results trip the loop guard; a changed argument or result counts as progress.",
265
265
  "field.loopText": "Loop text",
@@ -1799,11 +1799,20 @@ var inject = ["slots", "locale", "settingsScope"];
1799
1799
  function apply(ctx) {
1800
1800
  ctx.effect(() => ctx.locale.register(NS, { zh, en }), "auto-continue: dictionaries");
1801
1801
  const scope = ctx.settingsScope.bind({ namespace: SETTINGS_NS });
1802
+ const MAX_MIRROR_ATTEMPTS = 3;
1803
+ let mirroredLocale;
1804
+ let mirrorAttempts = 0;
1802
1805
  const syncLocale = () => {
1803
1806
  const active = ctx.locale.getLocale().active;
1804
1807
  const snapshot = scope.getSnapshot();
1805
1808
  if (snapshot.status !== "ready" || !snapshot.writable || snapshot.mode !== "host") return;
1809
+ if (mirroredLocale !== active) {
1810
+ mirroredLocale = active;
1811
+ mirrorAttempts = 0;
1812
+ }
1806
1813
  if (snapshot.value?.locale === active) return;
1814
+ if (mirrorAttempts >= MAX_MIRROR_ATTEMPTS) return;
1815
+ mirrorAttempts += 1;
1807
1816
  void scope.set("locale", active);
1808
1817
  };
1809
1818
  ctx.effect(() => scope.subscribe(syncLocale), "auto-continue: locale settings sync");