dsh-session-superagent 0.9.19 → 0.9.20
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 +21 -0
- package/README.md +1 -1
- package/client.js +11 -1
- package/lib/index.js +10 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
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.20] - 2026-11-02 —— 面板显示"还能用几次"(会话唤醒用量)
|
|
6
|
+
|
|
7
|
+
### 学到的(知识库第 69 条)
|
|
8
|
+
Google SRE 四个黄金指标里的 **saturation**:错误和延迟都是事后,**饱和是唯一能提前预警的**。
|
|
9
|
+
<https://sre.google/sre-book/monitoring-distributed-systems/#:~:text=Saturation>
|
|
10
|
+
|
|
11
|
+
### 上一轮模拟给的证据
|
|
12
|
+
离线跑一小时:**实际上报 12 / 共 30 条,被会话上限挡住 241 次** ——
|
|
13
|
+
默认参数下一半条目在排队,而界面上看不出来。
|
|
14
|
+
|
|
15
|
+
### 改法
|
|
16
|
+
`/state` 新增 `sessionUsage: { used, cap, capped }`(复用 `sessionWakesLastHour`,**零新增请求**)。
|
|
17
|
+
面板在「按仓库」旁显示:
|
|
18
|
+
- 常态 `本会话近一小时唤醒 3/12`;
|
|
19
|
+
- 到顶 `已到上限:新条目会攒到下一小时,可以把「这条会话每小时最多被唤醒」调大` + `2 条守正因上限暂停`。
|
|
20
|
+
|
|
21
|
+
只写"已到上限"等于把问题丢回客户;带上"把某个字段调大"才是可执行动作。
|
|
22
|
+
|
|
23
|
+
### 测试
|
|
24
|
+
- 新增 2 例(路由契约三字段;面板:没用满不报警 / 用满给建议 / 说清几条被挡)。合计 **164 例**。
|
|
25
|
+
|
|
5
26
|
## [0.9.19] - 2026-11-02 —— 离线跑一小时:限流/合并/去重没有互相打架
|
|
6
27
|
|
|
7
28
|
### 学到的(知识库第 68 条)
|
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
|
|
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.20'
|
|
18
18
|
let BASE = '/session-superagent'
|
|
19
19
|
/**
|
|
20
20
|
* 挑「最新的那个服务端实例」。
|
|
@@ -1272,6 +1272,16 @@ window.__ModuleLoader__.load({
|
|
|
1272
1272
|
h('div', { className: 'dt-row-meta' },
|
|
1273
1273
|
h(Pill, { active: problemsOnly, onClick: () => setProblemsOnly(!problemsOnly) }, '只看有问题的' + (problemCount > 0 ? ' (' + problemCount + ')' : '')),
|
|
1274
1274
|
problemsOnly ? h(Pill, { onClick: () => setProblemsOnly(false) }, '全部') : null),
|
|
1275
|
+
body.sessionUsage
|
|
1276
|
+
? h('div', { className: 'dt-row-meta' },
|
|
1277
|
+
h('span', null, '本会话近一小时唤醒 ' + body.sessionUsage.used + '/' + body.sessionUsage.cap),
|
|
1278
|
+
body.sessionUsage.used >= body.sessionUsage.cap
|
|
1279
|
+
? h('span', { className: 'dt-error-text' }, '已到上限:新条目会攒到下一小时,可以把「这条会话每小时最多被唤醒」调大')
|
|
1280
|
+
: null,
|
|
1281
|
+
body.sessionUsage.capped > 0
|
|
1282
|
+
? h('span', { className: 'dt-error-text' }, body.sessionUsage.capped + ' 条守正因上限暂停')
|
|
1283
|
+
: null)
|
|
1284
|
+
: null,
|
|
1275
1285
|
visible.length === 0 ? h(Hint, null, '没有符合条件的主理鱼。点上面「全部」看所有守。') : null,
|
|
1276
1286
|
h('div', { className: 'dt-rows' }, ...summarizeByRepo(visible).map((group) => h('div', { key: 'repo-' + group.repo, className: 'dt-row' },
|
|
1277
1287
|
h('div', { className: 'dt-row-main' },
|
package/lib/index.js
CHANGED
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
|
|
33
33
|
export const name = 'dsh-session-superagent'
|
|
34
34
|
/** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
|
|
35
|
-
export const SERVER_VERSION = '0.9.
|
|
35
|
+
export const SERVER_VERSION = '0.9.20'
|
|
36
36
|
export const inject = ['tools', 'agents', 'webServer']
|
|
37
37
|
/** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
|
|
38
38
|
const DEFAULT_SESSION_WAKES = 12
|
|
@@ -1229,6 +1229,15 @@ export function apply(ctx) {
|
|
|
1229
1229
|
credentials: secretsSummary(),
|
|
1230
1230
|
sessionGoal: goalView(ctx, focusSession),
|
|
1231
1231
|
stateSource,
|
|
1232
|
+
// 会话级用量:上限够不够,客户应该一眼看到(数据都在状态里,零新增请求)
|
|
1233
|
+
sessionUsage: (() => {
|
|
1234
|
+
const list = Object.values(state.watchers || {})
|
|
1235
|
+
const usage = list.length === 0 ? null : sessionWakesLastHour(list, focusSession)
|
|
1236
|
+
const cap = list.length === 0 ? null : (Number(list[0].sessionMaxWakes) || 12)
|
|
1237
|
+
const capped = list.filter((w) => w && typeof w.lastDeferred === 'string'
|
|
1238
|
+
&& (w.lastDeferred.includes('上限') || w.lastDeferred.includes('一小时内已被唤醒'))).length
|
|
1239
|
+
return usage === null ? null : { used: usage, cap, capped }
|
|
1240
|
+
})(),
|
|
1232
1241
|
// 版本漂移:文件换了但宿主还在跑老模块(客户端热重载会掩盖这件事)
|
|
1233
1242
|
installedVersion: installedVersion(),
|
|
1234
1243
|
runningVersion: SERVER_VERSION,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-session-superagent",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.20",
|
|
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",
|