@cuylabs/agent-runtime 0.10.0 → 0.11.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.
|
@@ -1068,11 +1068,11 @@ var AgentOrchestrator = class {
|
|
|
1068
1068
|
return current;
|
|
1069
1069
|
}
|
|
1070
1070
|
return await new Promise((resolve, reject) => {
|
|
1071
|
-
|
|
1071
|
+
const timeoutRef = {};
|
|
1072
1072
|
let abortHandler;
|
|
1073
1073
|
const cleanup = () => {
|
|
1074
|
-
if (
|
|
1075
|
-
clearTimeout(
|
|
1074
|
+
if (timeoutRef.current) {
|
|
1075
|
+
clearTimeout(timeoutRef.current);
|
|
1076
1076
|
}
|
|
1077
1077
|
if (abortHandler && options.signal) {
|
|
1078
1078
|
options.signal.removeEventListener("abort", abortHandler);
|
|
@@ -1116,10 +1116,10 @@ var AgentOrchestrator = class {
|
|
|
1116
1116
|
return;
|
|
1117
1117
|
}
|
|
1118
1118
|
const timeoutMs = Math.floor(options.timeoutMs);
|
|
1119
|
-
|
|
1119
|
+
timeoutRef.current = setTimeout(() => {
|
|
1120
1120
|
waiter.reject(new Error(`Timed out waiting for run "${normalizedRunId}" after ${timeoutMs}ms`));
|
|
1121
1121
|
}, timeoutMs);
|
|
1122
|
-
|
|
1122
|
+
timeoutRef.current.unref?.();
|
|
1123
1123
|
});
|
|
1124
1124
|
}
|
|
1125
1125
|
async close(runId, options = {}) {
|
package/dist/index.js
CHANGED
package/package.json
CHANGED