dsh-session-superagent 0.9.82 → 0.9.84
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 +42 -0
- package/README.md +2 -2
- package/client.js +1 -1
- package/lib/index.js +17 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,48 @@
|
|
|
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.84] - 2026-11-02 —— ack 失败分两类:会不会自己好,客户要知道
|
|
6
|
+
|
|
7
|
+
### 为什么
|
|
8
|
+
`watch_ack` 失败原来只回一句 `[error: #7 gh exited 1] <原始 stderr>` ——
|
|
9
|
+
**客户分不清"等一下就好"和"必须我去处理"**,两种情况的正确反应完全相反。
|
|
10
|
+
|
|
11
|
+
### 改法
|
|
12
|
+
用已有的 `classifyGhError` 分类,输出两类文案(长度 35–55 字符):
|
|
13
|
+
|
|
14
|
+
| 类型 | 文案 |
|
|
15
|
+
|---|---|
|
|
16
|
+
| 可恢复(网络/限流/网关) | `[error: #7 暂时失败,稍后再 ack 一次即可(网络抖动)]` |
|
|
17
|
+
| 需处理(登录/权限/编号) | `[error: #7 需要你处理] (gh 登录失效:跑 gh auth login,或在面板填 token)` |
|
|
18
|
+
|
|
19
|
+
JSON 里同时给出 `kind` / `retryable` / `advice`。
|
|
20
|
+
|
|
21
|
+
### 文案去重(写的时候撞到两次)
|
|
22
|
+
1. 第一版:`会自动恢复:稍后再 ack 一次即可` + hint 里的"已按退避自动重试,不需要手动处理" —— **两句同义**;
|
|
23
|
+
2. 第二版:不可恢复分支既给 label 又给 hint,`gh 登录失效` **出现两次**。改成 hint 单独承担说明。
|
|
24
|
+
|
|
25
|
+
### 测试
|
|
26
|
+
- 新增 1 例:6 种错误文本的可恢复性判定,外加"没有守时"仍报错。合计 **197 例**。
|
|
27
|
+
|
|
28
|
+
## [0.9.83] - 2026-11-02 —— 空态引导不能引用不存在的控件
|
|
29
|
+
|
|
30
|
+
### 为什么
|
|
31
|
+
空态写着「③ 点「添加到当前会话」」,但那是**文案**;按钮一旦改名,引导就指向空气。
|
|
32
|
+
这类失效不会报错,只会让客户照着做却没反应。
|
|
33
|
+
|
|
34
|
+
### 做法
|
|
35
|
+
用例从引导文本里抽出所有「…」引用的名字,逐个要求它们**在「触发」页真实出现**。
|
|
36
|
+
|
|
37
|
+
### 过程中两次假通过(都是判据问题)
|
|
38
|
+
1. 第一版断言写成 `trigger.includes(name) || overview.includes(name)` ——
|
|
39
|
+
引导文本自己就含这个词,`overview` 永远为真 → **注入改名后仍 PASS**;
|
|
40
|
+
2. 收紧成只查「触发」页后仍然 PASS,因为测试桩没传 `sessionId`,
|
|
41
|
+
按钮渲染成「先打开一个会话」而引用的是「添加到当前会话」。
|
|
42
|
+
给渲染桩加上 `props` 参数、测试传 `{ sessionId: 's1' }` 后,注入改名**立刻变红**。
|
|
43
|
+
|
|
44
|
+
### 测试
|
|
45
|
+
- 新增 1 例(现在是真会红的那种)。合计 **196 例**。
|
|
46
|
+
|
|
5
47
|
## [0.9.82] - 2026-11-02 —— 跳过必须可见:skip 要带原因,用例体内不许静默 return
|
|
6
48
|
|
|
7
49
|
### 为什么
|
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)
|
|
6
|
-
[](https://github.com/MYCF711/dsh-session-superagent/releases)
|
|
7
7
|
[](https://www.npmjs.com/package/dsh-session-superagent)
|
|
8
8
|
[](https://github.com/topics/dsh-plugin)
|
|
9
9
|
|
|
@@ -121,7 +121,7 @@ dsh plugin install /path/to/dsh-session-superagent
|
|
|
121
121
|
## 开发
|
|
122
122
|
|
|
123
123
|
```sh
|
|
124
|
-
node --test #
|
|
124
|
+
node --test # 197 项单测
|
|
125
125
|
```
|
|
126
126
|
|
|
127
127
|
### 工具输出:文本给人和 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.
|
|
17
|
+
const CLIENT_VERSION = '0.9.84'
|
|
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.
|
|
43
|
+
export const SERVER_VERSION = '0.9.84'
|
|
44
44
|
export const inject = ['tools', 'agents', 'webServer']
|
|
45
45
|
/** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
|
|
46
46
|
const DEFAULT_SESSION_WAKES = 12
|
|
@@ -1740,9 +1740,22 @@ export function apply(ctx) {
|
|
|
1740
1740
|
results.push(number)
|
|
1741
1741
|
}
|
|
1742
1742
|
if (failed) {
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1743
|
+
// 失败要分两类:会自动恢复的(网络/限流/网关)和必须人动手的(登录/权限/编号)
|
|
1744
|
+
const why = classifyGhError(failed.text)
|
|
1745
|
+
const retryable = ['network', 'ratelimit', 'gateway'].includes(why.kind)
|
|
1746
|
+
// 文案不重复:可恢复的只说要等,不可恢复的只说要做什么(避免两句同义话叠在一起)
|
|
1747
|
+
const LABELS = { network: '网络抖动', ratelimit: '被 GitHub 限流', gateway: 'GitHub 或代理故障', auth: 'gh 登录失效', notfound: '仓库或编号不存在', nogh: '找不到 gh 命令', other: '未归类的错误' }
|
|
1748
|
+
const label = LABELS[why.kind] || LABELS.other
|
|
1749
|
+
const advice = retryable ? '暂时失败,稍后再 ack 一次即可' : '需要你处理'
|
|
1750
|
+
if (args && args.format === 'json') {
|
|
1751
|
+
return JSON.stringify({
|
|
1752
|
+
schemaVersion: 1, ok: false, repo: entry.repo, acked: results,
|
|
1753
|
+
failed: { number: failed.number, text: failed.text, kind: why.kind, retryable, advice },
|
|
1754
|
+
})
|
|
1755
|
+
}
|
|
1756
|
+
return retryable
|
|
1757
|
+
? `[error: #${failed.number} ${advice}(${label})]`
|
|
1758
|
+
: `[error: #${failed.number} ${advice}] ${why.hint}`
|
|
1746
1759
|
}
|
|
1747
1760
|
const latest = readState()
|
|
1748
1761
|
const live = latest.watchers && latest.watchers[entry.id]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-session-superagent",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.84",
|
|
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",
|