@sema-agent/core 1.432.0 → 1.433.0

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.
@@ -16,7 +16,7 @@ export function killProcessTree(pid, opts) {
16
16
  return;
17
17
  }
18
18
  const graceMs = normalizeGraceMs(opts?.graceMs);
19
- killProcessTreeWindows(pid, graceMs, opts?.stillRunning);
19
+ killProcessTreeWindows(pid, graceMs, undefined);
20
20
  return;
21
21
  }
22
22
  const useGroupKill = opts?.detached !== false;
@@ -331,7 +331,8 @@ export class NodeExecutionEnv {
331
331
  const onAbort = () => {
332
332
  abortKillInFlight = true;
333
333
  if (child?.pid) {
334
- killProcessTree(child.pid, { force: true });
334
+ const abortTarget = child;
335
+ killProcessTree(child.pid, { stillRunning: () => abortTarget.exitCode === null && abortTarget.signalCode === null });
335
336
  }
336
337
  if (callbackError) {
337
338
  const p = partialOutput();
@@ -440,7 +441,8 @@ export class NodeExecutionEnv {
440
441
  }
441
442
  timedOut = true;
442
443
  if (child?.pid) {
443
- killProcessTree(child.pid, { force: true });
444
+ const timeoutTarget = child;
445
+ killProcessTree(child.pid, { stillRunning: () => timeoutTarget.exitCode === null && timeoutTarget.signalCode === null });
444
446
  }
445
447
  armForceSettle(err(new ExecutionError("timeout", `timeout:${options?.timeout}`, undefined, partialOutput())));
446
448
  }, timeoutMs);
@@ -578,8 +580,10 @@ export class NodeExecutionEnv {
578
580
  if (onDetach("timeout"))
579
581
  return;
580
582
  timedOut = true;
581
- if (child?.pid)
582
- killProcessTree(child.pid, { force: true });
583
+ if (child?.pid) {
584
+ const adoptFallbackTarget = child;
585
+ killProcessTree(child.pid, { stillRunning: () => adoptFallbackTarget.exitCode === null && adoptFallbackTarget.signalCode === null });
586
+ }
583
587
  armForceSettle(err(new ExecutionError("timeout", `timeout:${options?.timeout}`, undefined, partialOutput())));
584
588
  };
585
589
  if (options?.detachSignal) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sema-agent/core",
3
- "version": "1.432.0",
3
+ "version": "1.433.0",
4
4
  "description": "Stateless, task-oriented AI agent core",
5
5
  "type": "module",
6
6
  "license": "BUSL-1.1",