dsh-session-superagent 0.9.110 → 0.9.111

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
@@ -2,6 +2,26 @@
2
2
 
3
3
  格式参照 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
4
4
 
5
+ ## [0.9.111] - 2026-11-03 —— 暂停后旧错误永远挂着;再给"退出码"加一道全库扫描
6
+
7
+ ### 从截图那条误报想到的
8
+ 304 误报修好之后,还有个遗留问题:**暂停的守不再轮询,旧的 `lastError` 就永远挂在面板上**
9
+ —— 客户看到的红点与「异常」计数,其实是几小时前的旧记录。
10
+
11
+ ### 改法
12
+ 1. 暂停 / 恢复时清掉瞬时状态:`lastError` / `deferReason` / `lastDeferred` / `consecutiveFailures` / `nextAt`;
13
+ 2. 新增全库扫描 `scripts/audit-exit-codes.mjs`:**打印了 FAIL 却没返回非 0** 的脚本一律报出来
14
+ (这是本轮之前的同类"第三类装死",现在有门禁守着);
15
+ 3. 接进 `preflight`(第 36 项「退出码一致」)。
16
+
17
+ ### 验证
18
+ - 暂停用例:造一个 `lastError` → 面板点暂停 → 状态里 `lastError` 与 `deferReason` 都为 null;
19
+ - 退出码扫描:把 `audit-promises.mjs` 里两处 `process.exitCode = 1` 都换成 `void 0` →
20
+ `FAIL 这些脚本打印了 FAIL 却不返回失败:scripts/audit-promises.mjs`(exit=1);还原后 PASS。
21
+
22
+ ### 测试
23
+ 合计 **218 例**。
24
+
5
25
  ## [0.9.110] - 2026-11-02 —— 截图里的「gh: HTTP 304(没归类的错误)」是误报
6
26
 
7
27
  ### 客户看到的
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  <img src="assets/icon-180.png" width="88" height="88" alt="">
4
4
 
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
- [![Version](https://img.shields.io/badge/version-0.9.110-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.111-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
7
7
  [![npm](https://img.shields.io/npm/v/dsh-session-superagent.svg)](https://www.npmjs.com/package/dsh-session-superagent)
8
8
  [![dsh](https://img.shields.io/badge/DeepSeek%20Harness-plugin-orange.svg)](https://github.com/topics/dsh-plugin)
9
9
 
@@ -122,7 +122,7 @@ dsh plugin install /path/to/dsh-session-superagent
122
122
  ## 开发
123
123
 
124
124
  ```sh
125
- node --test # 217 项单测
125
+ node --test # 218 项单测
126
126
  ```
127
127
 
128
128
  ### 工具输出:文本给人和 agent,JSON 给程序
package/client.js CHANGED
@@ -14,7 +14,7 @@ window.__ModuleLoader__.load({
14
14
  const { useCallback, useEffect, useRef, useState } = React
15
15
 
16
16
  // 客户端版本探针:每次模块加载写一次,用来确认浏览器里跑的是哪一版
17
- const CLIENT_VERSION = '0.9.110'
17
+ const CLIENT_VERSION = '0.9.111'
18
18
  let BASE = '/session-superagent'
19
19
  /**
20
20
  * 挑「最新的那个服务端实例」。
package/lib/index.js CHANGED
@@ -40,7 +40,7 @@ import {
40
40
 
41
41
  export const name = 'dsh-session-superagent'
42
42
  /** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
43
- export const SERVER_VERSION = '0.9.110'
43
+ export const SERVER_VERSION = '0.9.111'
44
44
  export const inject = ['tools', 'agents', 'webServer']
45
45
  /** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
46
46
  // 本进程启动时刻:用来区分「刚重启还没轮到」与「定时器真的丢了」
@@ -1505,6 +1505,14 @@ const UPDATE_CACHE_MS = 10 * 60 * 1000
1505
1505
  entry.nextAt = null
1506
1506
  // 没传 enabled 就保持原值:只改间隔/标签不该把暂停的 watcher 悄悄恢复
1507
1507
  entry.enabled = body.enabled === undefined ? (entry.enabled !== false) : body.enabled !== false
1508
+ // 暂停/恢复时清掉「上一次的错误」:暂停后不再轮询,旧错误会一直挂在面板上变成假异常
1509
+ if (body.enabled === false || body.enabled === true) {
1510
+ entry.lastError = null
1511
+ entry.deferReason = null
1512
+ entry.lastDeferred = null
1513
+ entry.consecutiveFailures = 0
1514
+ entry.nextAt = null
1515
+ }
1508
1516
  // 只有**新建**时才做添加前体检:编辑已有守不该再打一次网络
1509
1517
  const isNew = !created && !state.watchers[id]
1510
1518
  let warnings = []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-superagent",
3
- "version": "0.9.110",
3
+ "version": "0.9.111",
4
4
  "description": "Session-level superagent for DeepSeek Harness: watch a GitHub repository and wake a session when something needs doing. Credentials never reach the model.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",