@suifei/dsh-ai-team 0.4.93 → 0.4.94
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 +14 -0
- package/index.js +22 -2
- package/lib/diaglog.js +3 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.94 - 2026-11-15
|
|
4
|
+
|
|
5
|
+
**成员会话重建后,旧会话从工作区摘下**
|
|
6
|
+
|
|
7
|
+
成员会话不可恢复(`NOT_RESUMABLE` 等)时插件会自愈重建一个新会话,但被替换的旧会话仍挂在项目工作区下。
|
|
8
|
+
宿主没有删除会话的 API,于是每次重建都在工作区列表里多留一个永不再用的会话——实机 il2c 在 11-12/13 两天
|
|
9
|
+
自愈重建 322 次,il2c 工作区下累积 323 个死成员会话(`workspace.json` 里 354 个会话只有 25 个在用或属于 Human)。
|
|
10
|
+
|
|
11
|
+
- `index.js` `activateMember`:force 重建成功、新会话挂上工作区后,对旧会话调用工作区的 `detachSession`;
|
|
12
|
+
诊断行 `workspace.detach`(`errors` 级可见)/ `workspace.detach.fail`;
|
|
13
|
+
- `member.autoreseat` 诊断行补记触发的 `failureCode` 与唤醒 `reason`,之后能区分重建成因;
|
|
14
|
+
- 测试:`node --test` **332 通过 / 1 跳过**;`host.test` 新增「旧会话摘下、新会话挂上」断言(去掉修复即失败);
|
|
15
|
+
- E2E(隔离 DSH_HOME,rc.1 与 rc.3):`member.reseat` 后 `workspace.json` 中旧会话不在、新会话在,诊断有 `workspace.detach` 行。
|
|
16
|
+
|
|
3
17
|
## 0.4.93 - 2026-11-14
|
|
4
18
|
|
|
5
19
|
**rc.2+ 宿主上成员能激活了:`startActivation` 同时给出扁平与嵌套两种 spec**
|
package/index.js
CHANGED
|
@@ -414,6 +414,20 @@ export function apply(ctx, config = {}) {
|
|
|
414
414
|
console.warn('[ai-team] member session workspace attach failed:', error?.message ?? error, '— reseat the member (team member.reseat) to recreate its session in the project workspace');
|
|
415
415
|
}
|
|
416
416
|
};
|
|
417
|
+
// 重建(reseat)替换掉的旧成员会话从工作区摘下。宿主没有删会话的 API,
|
|
418
|
+
// 不摘的话每次重建都在工作区列表里多挂一个永不再用的会话(实机 il2c:
|
|
419
|
+
// 11-12/13 两天 322 次自愈重建 → 323 个死会话挂在 il2c 工作区下)。
|
|
420
|
+
const detachMemberWorkspace = async (projectRuntime, sessionId) => {
|
|
421
|
+
if (typeof sessionId !== 'string' || sessionId === '') return;
|
|
422
|
+
const workspace = await workspaceForProject(projectRuntime);
|
|
423
|
+
if (workspace === null || workspace === undefined || typeof workspace.detachSession !== 'function') return;
|
|
424
|
+
try {
|
|
425
|
+
await workspace.detachSession(sessionId);
|
|
426
|
+
diag.append({ ev: 'workspace.detach', sessionId, projectId: projectRuntime?.id ?? null });
|
|
427
|
+
} catch (error) {
|
|
428
|
+
diag.append({ ev: 'workspace.detach.fail', sessionId, projectId: projectRuntime?.id ?? null, message: error?.message ?? String(error) });
|
|
429
|
+
}
|
|
430
|
+
};
|
|
417
431
|
// A restored member session has no live AgentOptions; without a recorded
|
|
418
432
|
// model/selection event its prompt renders with an unresolvable {{model}}.
|
|
419
433
|
const modelSelectionLogged = new Map();
|
|
@@ -1073,6 +1087,9 @@ export function apply(ctx, config = {}) {
|
|
|
1073
1087
|
memberId: plan.memberId,
|
|
1074
1088
|
oldSessionId: targetMember.sessionId,
|
|
1075
1089
|
newSessionId: reseated?.sessionId ?? null,
|
|
1090
|
+
// 记下触发码:11-12/13 的 322 次重建事后无从区分成因。
|
|
1091
|
+
failureCode,
|
|
1092
|
+
reason: plan.reason,
|
|
1076
1093
|
ok: reseated?.error === undefined,
|
|
1077
1094
|
error: reseated?.error ?? null,
|
|
1078
1095
|
});
|
|
@@ -1920,8 +1937,10 @@ export function apply(ctx, config = {}) {
|
|
|
1920
1937
|
// 久管理,插件不再持有或唤醒它;新会话落在当前项目工作目录。这是
|
|
1921
1938
|
// 修复历史"账本目录兜底 cwd"游离会话的唯一路径(会话 cwd 创建时
|
|
1922
1939
|
// 钉死,resume 不覆盖,DSH 不提供原地改 cwd 的 API)。
|
|
1923
|
-
|
|
1924
|
-
|
|
1940
|
+
const staleId = typeof member.sessionId === 'string' && member.sessionId !== '' && body.payload?.force === true
|
|
1941
|
+
? member.sessionId
|
|
1942
|
+
: null;
|
|
1943
|
+
if (staleId !== null) {
|
|
1925
1944
|
const staleActivation = activations.get(staleId);
|
|
1926
1945
|
if (staleActivation !== undefined) {
|
|
1927
1946
|
activations.delete(staleId);
|
|
@@ -2002,6 +2021,7 @@ export function apply(ctx, config = {}) {
|
|
|
2002
2021
|
}
|
|
2003
2022
|
activations.set(result.childId, result.activation);
|
|
2004
2023
|
await attachMemberWorkspace(projectRuntime, result.childId);
|
|
2024
|
+
if (staleId !== null && staleId !== result.childId) await detachMemberWorkspace(projectRuntime, staleId);
|
|
2005
2025
|
persistModelSelection(result.childId, activationMember.config, member.name);
|
|
2006
2026
|
return {
|
|
2007
2027
|
ok: true,
|
package/lib/diaglog.js
CHANGED
|
@@ -36,7 +36,9 @@ export function isErrorEvent(ev) {
|
|
|
36
36
|
// 必须在发布默认级别可见,否则只能看到一连串 wake.fail 而不知道有没有救回来。
|
|
37
37
|
|| ev === 'member.autoreseat'
|
|
38
38
|
// Human 停止时中断了哪些成员:决定「停了之后还在跑」是不是插件的锅。
|
|
39
|
-
|| ev === 'team.interrupt'
|
|
39
|
+
|| ev === 'team.interrupt'
|
|
40
|
+
// 重建后旧会话有没有从工作区摘掉:决定工作区列表是否随自愈累积死会话。
|
|
41
|
+
|| ev === 'workspace.detach');
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
/**
|
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.94",
|
|
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",
|