@suifei/dsh-ai-team 0.4.67 → 0.4.68
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 +16 -0
- package/index.js +41 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.68 - 2026-11-12
|
|
4
|
+
|
|
5
|
+
**决定性探针:boot 后真实 `persistence.stat()` 一次,暴露原始错误码**
|
|
6
|
+
|
|
7
|
+
静态分析已经把 `NOT_RESUMABLE` 逼到最后一个可能:`sessionQuery.observeSession` 的第一道真实读取 `persistence.stat(sessionId)` 抛错,而外层把它吞成 `subagent "X" is unavailable`。已排除的:
|
|
8
|
+
|
|
9
|
+
- 会话文件损坏(逐帧解压 87 事件、descriptor `mode: "continuable"`);
|
|
10
|
+
- 目录键/文件名不符合后端规则(用后端自己的 `projectKey()`/`encodeSegment()` 重算,与磁盘完全一致:`--E-works-il2c--` + `session.v4.jsonl.zstd`);
|
|
11
|
+
- 工作区未登记(7 个成员会话都在 `E:\works\il2c` 的 `sessionIds` 里);
|
|
12
|
+
- 后端未挂载(`dsh-base` 声明、宿主日志 `state: 'active'`)。
|
|
13
|
+
|
|
14
|
+
- boot 完成后取账本里任一真实 session id 调 `persistence.stat()`:
|
|
15
|
+
成功写 `persistence.stat.ok`(`full` 级),失败写 **`persistence.stat.fail`**(带 `code`/`message`,发布默认级别可见)。
|
|
16
|
+
- 顺带修掉自己引入的一处启动回归:探针最初引用了 `ctx.effect` 闭包里的 `booted`,在 `apply` 作用域下是 `ReferenceError`——干跑立刻报 `boot.fail: booted is not defined`,改为通过参数传入 session id。
|
|
17
|
+
- 测试:`node --test` **269 通过 / 1 跳过**;干跑两条分支均验证:`PROBE_STAT=ok` → `persistence.stat.ok`,`PROBE_STAT=fail` → `persistence.stat.fail`(`.fail` 行落盘)。
|
|
18
|
+
|
|
3
19
|
## 0.4.67 - 2026-11-12
|
|
4
20
|
|
|
5
21
|
**启动探针:把「关键服务缺失」变成可判定的一行**
|
package/index.js
CHANGED
|
@@ -243,6 +243,12 @@ async function boot(diag, config = {}) {
|
|
|
243
243
|
service: runtime.service,
|
|
244
244
|
dataDir,
|
|
245
245
|
defaultWorkspace,
|
|
246
|
+
sessionIds: [...runtimes.values()]
|
|
247
|
+
.flatMap((entry) => [
|
|
248
|
+
entry.service.state.hostSessionId,
|
|
249
|
+
...Object.values(entry.service.state.members ?? {}).map((member) => member?.sessionId),
|
|
250
|
+
])
|
|
251
|
+
.filter((id) => typeof id === 'string' && id !== ''),
|
|
246
252
|
};
|
|
247
253
|
}
|
|
248
254
|
|
|
@@ -272,6 +278,36 @@ export function apply(ctx, config = {}) {
|
|
|
272
278
|
} catch (probeError) {
|
|
273
279
|
diag.append({ ev: 'service.probe.fail', message: probeError?.message ?? String(probeError) });
|
|
274
280
|
}
|
|
281
|
+
/**
|
|
282
|
+
* boot 之后真实读一次已知会话,把 persistence 的原始错误暴露出来。
|
|
283
|
+
*
|
|
284
|
+
* 实机 `NOT_RESUMABLE` 排查到最后只剩「persistence 读不出会话」这一种可能:
|
|
285
|
+
* 会话文件健康(87 事件、descriptor continuable)、目录键与文件名均符合后端规则、
|
|
286
|
+
* 工作区登记齐全。`persistence.stat` 是 `sessionQuery.observeSession` 的第一道
|
|
287
|
+
* 真实读取,成功/失败都能定性。
|
|
288
|
+
*/
|
|
289
|
+
const probePersistence = async (sessionIds = []) => {
|
|
290
|
+
const persistence = serviceOf(ctx, 'sessionPersistence');
|
|
291
|
+
if (persistence === undefined || typeof persistence.stat !== 'function') return;
|
|
292
|
+
const probeId = (Array.isArray(sessionIds) ? sessionIds : []).find((id) => typeof id === 'string' && id !== '');
|
|
293
|
+
if (probeId === undefined) return;
|
|
294
|
+
try {
|
|
295
|
+
const snapshot = await persistence.stat(probeId);
|
|
296
|
+
diag.append({
|
|
297
|
+
ev: 'persistence.stat.ok',
|
|
298
|
+
sessionId: probeId,
|
|
299
|
+
revision: snapshot?.revision ?? null,
|
|
300
|
+
headerId: snapshot?.header?.id ?? null,
|
|
301
|
+
});
|
|
302
|
+
} catch (error) {
|
|
303
|
+
diag.append({
|
|
304
|
+
ev: 'persistence.stat.fail',
|
|
305
|
+
sessionId: probeId,
|
|
306
|
+
code: error?.code ?? error?.name ?? null,
|
|
307
|
+
message: error?.message ?? String(error),
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
};
|
|
275
311
|
// HTTP 层失败/拒绝的统一落点(route.reject 在 errors 白名单内)。
|
|
276
312
|
const errorResponse = (res, error) => {
|
|
277
313
|
diag.append({
|
|
@@ -377,6 +413,11 @@ export function apply(ctx, config = {}) {
|
|
|
377
413
|
? Promise.resolve().then(() => boot(diag, config))
|
|
378
414
|
.then(async (value) => {
|
|
379
415
|
booted = value;
|
|
416
|
+
// 决定性探针:真实读一次已知会话。冷恢复失败的两种表现
|
|
417
|
+
// (`agents.resume` 报 persistence 未配置、`coldResume` 报 notFound)
|
|
418
|
+
// 都会在这里露出原始错误码——不再靠日志里那句
|
|
419
|
+
// 「subagent X is unavailable」猜。
|
|
420
|
+
await probePersistence(value.sessionIds);
|
|
380
421
|
for (const runtime of value.runtimes.values()) {
|
|
381
422
|
for (const member of Object.values(runtime.service.state.members ?? {})) {
|
|
382
423
|
if (member.kind === 'agent' && typeof member.sessionId === 'string') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suifei/dsh-ai-team",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.68",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "文渊阁 (Wenyuan Pavilion) — AI Team mode for DeepSeek Harness: concurrent projects, owned tasks, threads, inbox and an append-only team ledger",
|
|
6
6
|
"license": "MIT",
|