dsh-session-superagent 0.9.121 → 0.9.122
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 +27 -0
- package/README.md +2 -2
- package/client.js +12 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
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.122] - 2026-11-03 —— 面板上写出「第几次失败 + 下次什么时候重试」
|
|
6
|
+
|
|
7
|
+
### 学到什么(出处)
|
|
8
|
+
Kubernetes Job 的重试策略把这些数字**暴露在 status 里**给人和工具看:
|
|
9
|
+
|
|
10
|
+
> The `.spec.backoffLimit` is set by default to **6**. Failed Pods … are recreated by the Job controller with
|
|
11
|
+
> an **exponential back-off delay (10s, 20s, 40s …) capped at ten minutes**.
|
|
12
|
+
|
|
13
|
+
<https://kubernetes.io/docs/concepts/workloads/controllers/job/>
|
|
14
|
+
|
|
15
|
+
两个要点:① 默认重试上限就是 **6**(和 0.9.121 的 `RETRY_BUDGET_ATTEMPTS` 一致,属于巧合但方向对);
|
|
16
|
+
② **重试进度是可读的状态**,不是藏在日志里的行为。
|
|
17
|
+
|
|
18
|
+
### 改法
|
|
19
|
+
面板每条守在有失败时多一行:
|
|
20
|
+
```
|
|
21
|
+
已连续失败 7 次 · 下次重试约 90 分钟后(已放慢到 2 小时档)
|
|
22
|
+
```
|
|
23
|
+
数据全部来自 `/state` 已有的 `consecutiveFailures` / `nextAt`,没有新增字段、没有额外请求。
|
|
24
|
+
|
|
25
|
+
### 为什么要写
|
|
26
|
+
0.9.121 让失败后的间隔放慢到 2 小时,**如果面板不写出来,客户只会看到"它不动了"** ——
|
|
27
|
+
把"我们主动放慢"误读成"它坏了"。
|
|
28
|
+
|
|
29
|
+
### 测试
|
|
30
|
+
新增 1 例:失败 7 次 + 90 分钟后重试 → 面板出现次数、时间、以及「2 小时档」。合计 **232 例**。
|
|
31
|
+
|
|
5
32
|
## [0.9.121] - 2026-11-03 —— 重试要花预算:连续失败 6 次后放慢到 2 小时一次
|
|
6
33
|
|
|
7
34
|
### 学到什么(出处)
|
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
|
|
|
@@ -123,7 +123,7 @@ dsh plugin install /path/to/dsh-session-superagent
|
|
|
123
123
|
## 开发
|
|
124
124
|
|
|
125
125
|
```sh
|
|
126
|
-
node --test #
|
|
126
|
+
node --test # 232 项单测
|
|
127
127
|
```
|
|
128
128
|
|
|
129
129
|
### 工具输出:文本给人和 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.122'
|
|
18
18
|
let BASE = '/session-superagent'
|
|
19
19
|
/**
|
|
20
20
|
* 挑「最新的那个服务端实例」。
|
|
@@ -1093,6 +1093,17 @@ window.__ModuleLoader__.load({
|
|
|
1093
1093
|
(watcher.otherSessions && watcher.otherSessions.length > 0)
|
|
1094
1094
|
? h('div', { className: 'dt-ticket-note' }, '还有 ' + watcher.otherSessions.length + ' 个会话也在守这个仓库:' + watcher.otherSessions.join('、') + '(各自独立唤醒;但 ack 标签是仓库级的 —— 任一方 ack 后两边都会跳过,想让两边各处理各的就给对方设不同标签)')
|
|
1095
1095
|
: null,
|
|
1096
|
+
(() => {
|
|
1097
|
+
const fails = Number(watcher.consecutiveFailures) || 0
|
|
1098
|
+
if (fails < 1 || !watcher.nextAt) return null
|
|
1099
|
+
// 让「为什么很久没动」写在面板上:K8s 的 Job 也是把 backoff 状态暴露在 status 里
|
|
1100
|
+
const wait = Math.max(0, Date.now() - Date.parse(watcher.nextAt))
|
|
1101
|
+
const left = Date.parse(watcher.nextAt) - Date.now()
|
|
1102
|
+
const mins = Math.max(0, Math.round((left > 0 ? left : wait) / 60000))
|
|
1103
|
+
const slow = fails >= 6 ? '(已放慢到 2 小时档)' : ''
|
|
1104
|
+
return h('div', { className: 'dt-hint' },
|
|
1105
|
+
'已连续失败 ' + fails + ' 次 · ' + (left > 0 ? '下次重试约 ' + mins + ' 分钟后' : '等待重试') + slow)
|
|
1106
|
+
})(),
|
|
1096
1107
|
watcher.needsReauth ? h('div', { className: 'dt-banner dt-danger' },
|
|
1097
1108
|
'凭证失效:跑 gh auth login 重新登录 —— 它不会自己恢复,在此之前这条守只会一直失败') : null,
|
|
1098
1109
|
watcher.lastError ? (() => {
|
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.122'
|
|
44
44
|
export const inject = ['tools', 'agents', 'webServer']
|
|
45
45
|
/** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
|
|
46
46
|
// 本进程启动时刻:用来区分「刚重启还没轮到」与「定时器真的丢了」
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-session-superagent",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.122",
|
|
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",
|