@suifei/dsh-ai-team 0.4.13 → 0.4.15

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.
Files changed (2) hide show
  1. package/index.js +9 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -52,7 +52,7 @@ export const name = 'ai-team';
52
52
  // 实际使用的服务(含可选服务:缺失时 serviceOf 回退 ctx.get 并返回 undefined)。
53
53
  export const inject = ['webServer', 'permissionPresets', 'sandboxPolicy', 'tools', 'shell', 'agents', 'subagents', 'sessions'];
54
54
 
55
- const VERSION = '0.4.13';
55
+ const VERSION = '0.4.15';
56
56
  const HUMAN_ID = 'mem_human';
57
57
 
58
58
  const SKILLOPT_BACKENDS = ['mock', 'claude', 'codex', 'copilot', 'cursor', 'pi', 'opencode', 'handoff', 'azure_openai'];
@@ -540,11 +540,14 @@ export function apply(ctx, config = {}) {
540
540
  });
541
541
  console.warn('[ai-team] wake failed:', plan.memberId, error?.code ?? error?.message ?? error);
542
542
  // 一次性迁移自愈:旧形态成员会话(历史上由 agents.create 创建、
543
- // 不在 subagent catalog)无法经父→子通道投递。识别该失败后自动以
544
- // subagent 形态重建一次(重置会话),避免成员静默不再被唤醒。
543
+ // 不在 subagent catalog)或重启后不可恢复的会话(NOT_RESUMABLE /
544
+ // is unavailable)无法经父→子通道投递。识别该失败后自动以 subagent
545
+ // 形态重建一次(重置会话),避免成员静默不再被唤醒。
546
+ // 注意:member 是 try 块内变量,catch 里必须从 state 取成员。
547
+ const targetMember = projectRuntime.service.state.members?.[plan.memberId];
545
548
  const failureText = `${error?.code ?? ''} ${error?.message ?? String(error)}`;
546
- const legacySession = /subagent|not-found|not found|E_SESSION_MISSING/i.test(failureText)
547
- && typeof member?.sessionId === 'string' && member.sessionId !== '';
549
+ const legacySession = /subagent|not-found|not found|E_SESSION_MISSING|NOT_RESUMABLE|unavailable/i.test(failureText)
550
+ && typeof targetMember?.sessionId === 'string' && targetMember.sessionId !== '';
548
551
  if (legacySession) {
549
552
  try {
550
553
  const reseated = await activateMember({
@@ -558,7 +561,7 @@ export function apply(ctx, config = {}) {
558
561
  ev: 'member.autoreseat',
559
562
  projectId: projectRuntime.id,
560
563
  memberId: plan.memberId,
561
- oldSessionId: member.sessionId,
564
+ oldSessionId: targetMember.sessionId,
562
565
  newSessionId: reseated?.sessionId ?? null,
563
566
  ok: reseated?.error === undefined,
564
567
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suifei/dsh-ai-team",
3
- "version": "0.4.13",
3
+ "version": "0.4.15",
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",