@lmzhen/dsh-evolution-review 0.32.2 → 0.32.4

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/lib/index.js +15 -2
  2. package/package.json +6 -6
package/lib/index.js CHANGED
@@ -618,10 +618,16 @@ function apply(ctx, rawConfig = {}) {
618
618
  const startedAt = Date.now();
619
619
  const controller = new AbortController();
620
620
  let timedOut = false;
621
+ const timeoutDone = Promise.withResolvers();
621
622
  const timer = setTimeout(() => {
622
623
  timedOut = true;
623
624
  controller.abort();
624
- }, rawConfig.reviewTimeoutMs ?? DEFAULT_REVIEW_TIMEOUT_MS);
625
+ timeoutDone.resolve();
626
+ handle?.agent.cancel({
627
+ kind: "hook",
628
+ reason: "evolution-review-timeout"
629
+ });
630
+ }, config.reviewTimeoutMs);
625
631
  let handle;
626
632
  try {
627
633
  const presets = ctx.get("agentPresets");
@@ -697,7 +703,14 @@ function apply(ctx, rawConfig = {}) {
697
703
  }],
698
704
  source: { kind: "user" }
699
705
  }));
700
- await handle.agent.whenIdle();
706
+ const idle = handle.agent.whenIdle().catch((error) => {
707
+ if (collected.error === void 0) collected.error = error instanceof Error ? error.message : String(error);
708
+ });
709
+ await Promise.race([idle, timeoutDone.promise]);
710
+ if (timedOut) handle.agent.cancel({
711
+ kind: "hook",
712
+ reason: "evolution-review-timeout"
713
+ });
701
714
  offEvent();
702
715
  if (collected.finalText.trim() !== "") deliverMessage(agent, collected.finalText, "branch review result", false);
703
716
  try {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-review",
3
3
  "description": "Background review orchestration (community build)",
4
- "version": "0.32.2",
4
+ "version": "0.32.4",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -27,7 +27,7 @@
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
29
  "@deepseek-ai/schemastery": "^3.18.5",
30
- "@lmzhen/dsh-evolution-core": "^0.32.2"
30
+ "@lmzhen/dsh-evolution-core": "^0.32.4"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@deepseek-ai/cordis": "^4.0.5",
@@ -35,8 +35,8 @@
35
35
  "@deepseek-ai/dsh-llm": "^0.2.1-rc.2",
36
36
  "@deepseek-ai/dsh-session": "^0.2.1-rc.2",
37
37
  "@deepseek-ai/dsh-tools": "^0.2.1-rc.2",
38
- "@lmzhen/dsh-evolution-policy": "^0.32.2",
39
- "@lmzhen/dsh-evolution-state": "^0.32.2"
38
+ "@lmzhen/dsh-evolution-policy": "^0.32.4",
39
+ "@lmzhen/dsh-evolution-state": "^0.32.4"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@deepseek-ai/dsh-agent": "^0.2.1-rc.2",
@@ -44,8 +44,8 @@
44
44
  "@deepseek-ai/dsh-llm": "^0.2.1-rc.2",
45
45
  "@deepseek-ai/dsh-session": "^0.2.1-rc.2",
46
46
  "@deepseek-ai/dsh-tools": "^0.2.1-rc.2",
47
- "@lmzhen/dsh-evolution-core": "^0.32.2",
48
- "@lmzhen/dsh-evolution-state": "^0.32.2"
47
+ "@lmzhen/dsh-evolution-core": "^0.32.4",
48
+ "@lmzhen/dsh-evolution-state": "^0.32.4"
49
49
  },
50
50
  "engines": {
51
51
  "dsh": ">=0.2.1-rc.2 <0.2.2-0"