dsh-session-superagent 0.9.233 → 0.9.234
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 +30 -0
- package/README.md +1 -1
- package/client.js +1 -1
- package/lib/index.js +11 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,36 @@
|
|
|
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.234] - 2026-11-05 —— 多会话下报的是别人的额度;自称只读却写了文件
|
|
6
|
+
|
|
7
|
+
### ① `watch_status` 的 `session` 段取的是「第一条守的会话」
|
|
8
|
+
|
|
9
|
+
`statusView` 里 `sessionId = list[0].sessionId`。当这台机器上同时挂着**多个会话**的守时,
|
|
10
|
+
`used / cap` 报的是 `list[0]` 那个会话的额度 —— 客户看到「已用 11/12」,
|
|
11
|
+
其实是**另一个会话**用掉的,自己这边还很宽裕(或者反过来)。
|
|
12
|
+
|
|
13
|
+
现在优先用**当前会话**的 id;拿不到(纯 CLI 场景)才退回 `list[0]`。
|
|
14
|
+
|
|
15
|
+
### ② `watch_doctor` 自称 `Read-only`,却往工作目录写文件
|
|
16
|
+
|
|
17
|
+
它为了验证「隔离工作目录可写」,会写一个 `.dsh-doctor-probe` 再立刻删掉。
|
|
18
|
+
描述里写的是 `Read-only; prints a checklist.` —— 客户和模型都以为它完全不碰磁盘。
|
|
19
|
+
|
|
20
|
+
两条路:去掉探针检查,或者如实描述。**选了后者** —— 提前发现「目录不可写」是有价值的
|
|
21
|
+
(第一次唤醒建 worktree 才会失败,那时客户已经在等结果了)。
|
|
22
|
+
|
|
23
|
+
描述改成:*does not change any watcher config, but it does write one temporary probe file
|
|
24
|
+
inside the isolation workdir (and deletes it immediately) to prove the directory is writable.*
|
|
25
|
+
|
|
26
|
+
输出里也加了一行 `OK 隔离工作目录可写(写过一个临时探针并已删除)` —— 让客户知道刚才发生了什么。
|
|
27
|
+
|
|
28
|
+
### 证据
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
npm test → 377/377
|
|
32
|
+
preflight --fast → 全部通过
|
|
33
|
+
```
|
|
34
|
+
|
|
5
35
|
## [0.9.233] - 2026-11-05 —— 模型照着说明书做,也一定会失败的四条
|
|
6
36
|
|
|
7
37
|
### ① `watch_stop` 停不掉 Gitee 守(最危险的一条)
|
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
|
[](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
|
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.234'
|
|
18
18
|
let BASE = '/session-superagent'
|
|
19
19
|
/**
|
|
20
20
|
* 挑「最新的那个服务端实例」。
|
package/lib/index.js
CHANGED
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
|
|
44
44
|
export const name = 'dsh-session-superagent'
|
|
45
45
|
/** 服务端版本:随 package.json 同步(meta 测试守着)。客户端据此挑「最新的那个实例」。 */
|
|
46
|
-
export const SERVER_VERSION = '0.9.
|
|
46
|
+
export const SERVER_VERSION = '0.9.234'
|
|
47
47
|
export const inject = ['tools', 'agents', 'webServer']
|
|
48
48
|
/** 一条会话每小时最多被唤醒几次(跨所有守累计)。单守上限挡不住多守叠加。 */
|
|
49
49
|
// 本进程启动时刻:用来区分「刚重启还没轮到」与「定时器真的丢了」
|
|
@@ -2448,7 +2448,7 @@ const UPDATE_CACHE_MS = 10 * 60 * 1000
|
|
|
2448
2448
|
ctx.tools.register(defineTool({
|
|
2449
2449
|
name: 'watch_doctor',
|
|
2450
2450
|
description:
|
|
2451
|
-
'Self-check the watchers: gh login, repo access, ack label existence, isolation workdir.
|
|
2451
|
+
'Self-check the watchers: gh login, repo access, ack label existence, isolation workdir. Prints a checklist. It does not change any watcher config, but it does write one temporary probe file inside the isolation workdir (and deletes it immediately) to prove the directory is writable.',
|
|
2452
2452
|
parameters: {
|
|
2453
2453
|
repo: { type: 'string', description: 'only check this owner/name; default = every watcher' },
|
|
2454
2454
|
format: { type: 'string', description: "'text' (default) or 'json'." },
|
|
@@ -2589,10 +2589,13 @@ const UPDATE_CACHE_MS = 10 * 60 * 1000
|
|
|
2589
2589
|
const gitRes = await run('git', ['-C', wd, 'rev-parse', '--is-inside-work-tree'], { timeoutMs: 15000 })
|
|
2590
2590
|
lines.push(`${gitRes.code === 0 ? 'OK ' : 'FAIL'} 隔离工作目录 ${wd}:${gitRes.code === 0 ? '是 git 仓库' : '不是 git 仓库'}`)
|
|
2591
2591
|
// 目录在但不可写时,第一次唤醒建 worktree 就会失败(真机上更常见的是权限/磁盘)
|
|
2592
|
+
// 审核 T32:这里确实会**写一个探针文件**(再立刻删)。
|
|
2593
|
+
// 以前描述写「Read-only」,客户和模型都以为它完全不碰磁盘 —— 已改成如实描述。
|
|
2592
2594
|
const probe = join(wd, '.dsh-doctor-probe')
|
|
2593
2595
|
try {
|
|
2594
2596
|
writeFileSync(probe, String(Date.now()))
|
|
2595
2597
|
rmSync(probe, { force: true })
|
|
2598
|
+
lines.push(`OK 隔离工作目录可写(写过一个临时探针并已删除)`)
|
|
2596
2599
|
} catch (error) {
|
|
2597
2600
|
lines.push(`FAIL 隔离工作目录不可写:${wd}(${String((error && error.code) || error).slice(0, 40)})`)
|
|
2598
2601
|
}
|
|
@@ -2833,8 +2836,13 @@ const UPDATE_CACHE_MS = 10 * 60 * 1000
|
|
|
2833
2836
|
const state = readState()
|
|
2834
2837
|
const list = Object.values(state.watchers || {})
|
|
2835
2838
|
if (!list.length) return args && args.format === 'json' ? JSON.stringify({ schemaVersion: 1, session: null, watchers: [] }) : '(no watchers)'
|
|
2839
|
+
// 审核 T32:`session` 段以前取 `list[0].sessionId` —— 多个会话的守混在一起时,
|
|
2840
|
+
// `used / cap` 报的是**别人**的额度。现在优先用当前会话;拿不到才退回 list[0]。
|
|
2841
|
+
const wsAgents = agentsService(ctx)
|
|
2842
|
+
const wsAgent = wsAgents && typeof wsAgents.currentInitiator === 'function' ? wsAgents.currentInitiator() : undefined
|
|
2843
|
+
const wsSessionId = (wsAgent && wsAgent.id) || undefined
|
|
2836
2844
|
// 同一份数据:结构化视图 -> 文本只是它的一种渲染,两边永远对得上
|
|
2837
|
-
const view = statusView(list)
|
|
2845
|
+
const view = statusView(list, wsSessionId ? { sessionId: wsSessionId } : {})
|
|
2838
2846
|
if (args && args.format === 'json') return JSON.stringify(view, null, 2)
|
|
2839
2847
|
// 默认只写「这条守是什么」;只有当它需要你注意时才追加原因。
|
|
2840
2848
|
// 以前每行都带 lastPoll/lastWake/err=-,十条守就是十行长日志。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-session-superagent",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.234",
|
|
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",
|