dsh-session-superagent 0.9.237 → 0.9.238

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,44 @@
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.238] - 2026-11-05 —— 「轮询失败」这个标签用错了地方
6
+
7
+ ### M3 · 唤醒失败被说成「轮询失败」
8
+
9
+ 面板显示:
10
+
11
+ ```
12
+ a/b 轮询失败:wake failed: session not live
13
+ ```
14
+
15
+ 三处都不对:
16
+
17
+ - **归错类** —— 轮询其实**成功了**(正常拉到数据、正常判断、正常决定叫醒),失败的是「叫醒」这一步;
18
+ - **英文内部话** —— `session not live`、`no followup/steer/inbox on agent`、`agent busy (running)`、`merged empty`;
19
+ - **没有下一步** —— 客户不知道该干什么。
20
+
21
+ 客户看到「轮询失败」会去查网络、查 token —— 而真正的问题是宿主重启过、会话不在了。
22
+
23
+ ### 改法
24
+
25
+ 失败原因全部改成「现象 + 下一步」的中文(保留英文状态值便于排查):
26
+
27
+ | 以前 | 现在 |
28
+ |---|---|
29
+ | `session not live` | 这个会话已经不在宿主里了 —— 宿主重启过,或这个会话被关掉了;面板里刷新一下,还在就重建这条主理鱼 |
30
+ | `agent busy (running)` | 会话正忙(agent busy: running)—— 等它空闲,这轮会自动顺延 |
31
+ | `no followup/steer/inbox on agent` | 宿主没给这个会话提供投递入口 —— 换个宿主版本,或直接在会话里 @ 它 |
32
+ | `merged empty` | 合并后没有内容可发(这几条都已被处理过)—— 不用管,下一轮会重新判断 |
33
+
34
+ 错误文本加了 `wake:` 前缀,面板据此分开显示**「唤醒失败」**与**「轮询失败」**。
35
+
36
+ ### 证据
37
+
38
+ ```
39
+ npm test → 380/380(新增:唤醒原因要有中文 + 下一步 + 保留英文状态值)
40
+ ui-audit → 11/11(100 分)
41
+ ```
42
+
5
43
  ## [0.9.237] - 2026-11-05 —— 剩下的错误文案:`undefined`、切掉建议、英文内部话
6
44
 
7
45
  T33 一共给了 6 条必须修,0.9.236 修了前两条(假报错 / 丢下一步),这次是后四条。
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.237-green.svg)](https://github.com/MYCF711/dsh-session-superagent/releases)
6
+ [![Version](https://img.shields.io/badge/version-0.9.238-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
  [![awesome](https://img.shields.io/badge/awesome-dsh--plugin-%E2%9C%93-success.svg)](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
@@ -146,7 +146,7 @@ Gitee 私有仓库要在「设置 → 凭证」填私人令牌;公开仓库不
146
146
  ## 开发
147
147
 
148
148
  ```sh
149
- npm test # 379 项单测(带离线开关;裸 node --test 会真去 spawn gh,两分半)
149
+ npm test # 380 项单测(带离线开关;裸 node --test 会真去 spawn gh,两分半)
150
150
  ```
151
151
 
152
152
  ### 工具输出:文本给人和 agent,JSON 给程序
@@ -198,7 +198,7 @@ dsh plugin --profile <profile> add dsh-session-superagent@latest
198
198
  ## 验收(不用装宿主也能跑)
199
199
 
200
200
  ```bash
201
- npm test # 379 项单测(带离线开关,约 1.6 秒)
201
+ npm test # 380 项单测(带离线开关,约 1.6 秒)
202
202
  node scripts/ui-audit.mjs # 11 项 UI 指标(写死颜色 / 自造 token / 官方结构采用 …)
203
203
  node scripts/preflight.mjs # 40 项门禁(含上面两条,外加 profile 一致性、路由面、包内容)
204
204
  node scripts/render-preview.mjs preview.html # 双主题静态预览,直接浏览器打开
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.237'
17
+ const CLIENT_VERSION = '0.9.238'
18
18
  let BASE = '/session-superagent'
19
19
  /**
20
20
  * 挑「最新的那个服务端实例」。
@@ -680,6 +680,9 @@ window.__ModuleLoader__.load({
680
680
 
681
681
  /** Dock entry: the machine-wide ring plus its click-through detail list. */
682
682
  /** 把错误拆成「现象」和「建议」:服务端存的是 short +(hint),建议在末尾的括号里。 */
683
+ // 唤醒失败 vs 轮询失败:前者轮询是成功的,说成「轮询失败」会让客户去查网络
684
+ function isWakeFailure(text) { return /^wake:/.test(String(text || '')) }
685
+
683
686
  function splitErrorText(text) {
684
687
  const value = String(text || '')
685
688
  const match = /([^()]*)\s*$/.exec(value)
@@ -1457,7 +1460,10 @@ window.__ModuleLoader__.load({
1457
1460
  problems.push({
1458
1461
  key: 'e-' + watcher.repo,
1459
1462
  rank: 1, kind: 'error',
1460
- text: watcher.repo + ' 轮询失败:' + parts.main.slice(0, 120) + (parts.main.length > 120 ? '…' : '') + ' ' + parts.hint,
1463
+ // 审核 T33 M3:以前一律写「轮询失败」—— 而唤醒失败时轮询是**成功的**,归错了类。
1464
+ // `wake:` 前缀由 lib/watch.js 的 planWakeSettlement 打上。
1465
+ text: watcher.repo + (isWakeFailure(watcher.lastError) ? ' 唤醒失败:' : ' 轮询失败:')
1466
+ + parts.main.replace(/^wake:\s*/, '').slice(0, 120) + (parts.main.length > 120 ? '…' : '') + ' ' + parts.hint,
1461
1467
  })
1462
1468
  }
1463
1469
  // 暂停原因不在「需要关注」里重复:卡片里已经有一行加粗警告色的「暂停唤醒:…」(见 pauseNote),
package/lib/index.js CHANGED
@@ -44,7 +44,7 @@ import {
44
44
 
45
45
  export const name = 'dsh-session-superagent'
46
46
  /** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
47
- export const SERVER_VERSION = '0.9.237'
47
+ export const SERVER_VERSION = '0.9.238'
48
48
  export const inject = ['tools', 'agents', 'webServer']
49
49
  /** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
50
50
  // 本进程启动时刻:用来区分「刚重启还没轮到」与「定时器真的丢了」
@@ -716,7 +716,7 @@ function wakeMerged(ctx, sessionId, text, onSettled) {
716
716
  if (buf.timer) return { ok: true, merged: true, pending: buf.parts.length }
717
717
  buf.timer = setTimeout(() => {
718
718
  wakeBuffers.delete(sessionId)
719
- let result = { ok: false, reason: 'merged empty' }
719
+ let result = { ok: false, reason: '合并后没有内容可发(这几条都已被处理过)—— 不用管,下一轮会重新判断' }
720
720
  try {
721
721
  const merged = mergeWakeTexts(buf.parts)
722
722
  if (merged) result = wake(ctx, sessionId, merged)
@@ -736,7 +736,7 @@ function wakeMerged(ctx, sessionId, text, onSettled) {
736
736
  function wake(ctx, sessionId, text) {
737
737
  const agents = agentsService(ctx)
738
738
  const agent = agents && typeof agents.get === 'function' ? agents.get(sessionId) : undefined
739
- if (!agent) return { ok: false, reason: 'session not live' }
739
+ if (!agent) return { ok: false, reason: '这个会话已经不在宿主里了 —— 宿主重启过,或这个会话被关掉了;面板里刷新一下,还在就重建这条主理鱼' }
740
740
 
741
741
  const allowed = decideWake(agent.status)
742
742
  if (!allowed.ok) return allowed
@@ -765,7 +765,7 @@ function wake(ctx, sessionId, text) {
765
765
  inbox.append('next-turn', message)
766
766
  return { ok: true, via: 'inbox.append' }
767
767
  }
768
- return { ok: false, reason: 'no followup/steer/inbox on agent' }
768
+ return { ok: false, reason: '宿主没给这个会话提供投递入口(followup / steer / inbox 都没有)—— 换个宿主版本,或直接在会话里 @ 它' }
769
769
  } catch (error) {
770
770
  return { ok: false, reason: `throw: ${String((error && error.message) || error)}` }
771
771
  }
package/lib/watch.js CHANGED
@@ -77,7 +77,9 @@ export function recordReported(state, fresh, now = Date.now()) {
77
77
  */
78
78
  export function decideWake(status) {
79
79
  if (!status) return { ok: true }
80
- if (status !== 'idle') return { ok: false, reason: `agent busy (${status})` }
80
+ // 审核 T33 M3:reason 会直接进面板/诊断/唤醒记录 —— 以前是英文内部话,客户读不懂。
81
+ // 这里保留英文状态值(便于排查),但整条话说成客户能懂的:现在是「忙」,不是「坏了」。
82
+ if (status !== 'idle') return { ok: false, reason: '会话正忙(agent busy: ' + status + ')—— 等它空闲,这轮会自动顺延' }
81
83
  return { ok: true }
82
84
  }
83
85
 
@@ -1236,7 +1238,10 @@ export function planWakeSettlement(entry, { ok, reason, fresh = [], firstSync =
1236
1238
  lastDeferred: busy ? '会话正忙,下一轮重试' : (entry.lastDeferred || null),
1237
1239
  bumpBackoff: !busy,
1238
1240
  baseMs,
1239
- error: 'wake failed: ' + String(reason || ''),
1241
+ // 审核 T33 M3:以前是 `wake failed: session not live` —— 英文内部话,而且面板会把它
1242
+ // 显示成「轮询失败」(归错类:轮询其实成功了,失败的是唤醒)。
1243
+ // 加 `wake:` 前缀让下游能区分两类;reason 本身已经是客户能看懂的中文。
1244
+ error: 'wake: ' + String(reason || ''),
1240
1245
  }
1241
1246
  }
1242
1247
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-session-superagent",
3
- "version": "0.9.237",
3
+ "version": "0.9.238",
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",