@tangle-network/agent-app 0.60.38 → 0.60.39

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.
@@ -42,7 +42,7 @@ import {
42
42
  flattenHistory,
43
43
  readSandboxBinaryBytes,
44
44
  statSandboxFileSize
45
- } from "../chunk-2BAASFJS.js";
45
+ } from "../chunk-O2X4FPAD.js";
46
46
  import "../chunk-MCYJON3F.js";
47
47
  import "../chunk-LWSJK546.js";
48
48
  import "../chunk-S2G5NAWV.js";
@@ -1641,6 +1641,7 @@ async function isBoxAlive(box, probe) {
1641
1641
  }
1642
1642
  }
1643
1643
  var DEFAULT_LIVENESS_CACHE_TTL_MS = 5e3;
1644
+ var PATIENT_LIVENESS_EXEC_TIMEOUT_MS = 3e4;
1644
1645
  function hasRecentLivenessVerification(box, probe, now = Date.now()) {
1645
1646
  const ttlMs = probe.cacheTtlMs ?? DEFAULT_LIVENESS_CACHE_TTL_MS;
1646
1647
  if (!Number.isFinite(ttlMs) || ttlMs <= 0) return false;
@@ -1829,6 +1830,16 @@ function resumeEnvRequiredKeys(cause) {
1829
1830
  return missingEnvKeys.filter((key) => typeof key === "string");
1830
1831
  }
1831
1832
  async function recoverUnresponsiveBox(client, box, probe, stage, name, resumeTimeout, runtimeEnv, onProgress) {
1833
+ if (probe && sandboxRuntimeUrl(box) && !sandboxEdgeFailed(box)) {
1834
+ const patient = await isBoxAlive(box, {
1835
+ ...probe,
1836
+ execTimeoutMs: Math.max(PATIENT_LIVENESS_EXEC_TIMEOUT_MS, probe.execTimeoutMs ?? 0)
1837
+ });
1838
+ if (patient.succeeded) {
1839
+ livenessVerifiedAt.set(box.id, Date.now());
1840
+ return box;
1841
+ }
1842
+ }
1832
1843
  try {
1833
1844
  await box.stop();
1834
1845
  } catch (err) {
@@ -2913,4 +2924,4 @@ export {
2913
2924
  isTerminalPromptEvent,
2914
2925
  detectInteractiveQuestion
2915
2926
  };
2916
- //# sourceMappingURL=chunk-2BAASFJS.js.map
2927
+ //# sourceMappingURL=chunk-O2X4FPAD.js.map