@meistrari/sandbox-sdk 1.0.8 → 1.0.10
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.
- package/dist/index.cjs +15 -15
- package/dist/index.mjs +15 -15
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -297,22 +297,22 @@ class SandboxClient {
|
|
|
297
297
|
const recoverViaPolling = async function* (client, runId, stdoutOffset, stderrOffset) {
|
|
298
298
|
let run;
|
|
299
299
|
try {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
};
|
|
310
|
-
return;
|
|
311
|
-
}
|
|
312
|
-
const intervalMs = 500;
|
|
313
|
-
const maxAttempts = Math.max(1, Math.floor(remainingMs / intervalMs));
|
|
314
|
-
run = await run.waitForCompletion({ intervalMs, maxAttempts });
|
|
300
|
+
const elapsedMs = Date.now() - streamStartMs;
|
|
301
|
+
const remainingMs = timeoutMs - elapsedMs;
|
|
302
|
+
if (remainingMs <= 0) {
|
|
303
|
+
yield {
|
|
304
|
+
type: "error",
|
|
305
|
+
runId,
|
|
306
|
+
content: "Timeout exceeded before polling fallback could start"
|
|
307
|
+
};
|
|
308
|
+
return;
|
|
315
309
|
}
|
|
310
|
+
const intervalMs = 500;
|
|
311
|
+
const maxAttempts = Math.max(1, Math.floor(remainingMs / intervalMs));
|
|
312
|
+
run = await pollUntilComplete(
|
|
313
|
+
async () => await client.getRun(runId),
|
|
314
|
+
{ intervalMs, maxAttempts }
|
|
315
|
+
);
|
|
316
316
|
} catch (pollError) {
|
|
317
317
|
yield {
|
|
318
318
|
type: "error",
|
package/dist/index.mjs
CHANGED
|
@@ -295,22 +295,22 @@ class SandboxClient {
|
|
|
295
295
|
const recoverViaPolling = async function* (client, runId, stdoutOffset, stderrOffset) {
|
|
296
296
|
let run;
|
|
297
297
|
try {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
};
|
|
308
|
-
return;
|
|
309
|
-
}
|
|
310
|
-
const intervalMs = 500;
|
|
311
|
-
const maxAttempts = Math.max(1, Math.floor(remainingMs / intervalMs));
|
|
312
|
-
run = await run.waitForCompletion({ intervalMs, maxAttempts });
|
|
298
|
+
const elapsedMs = Date.now() - streamStartMs;
|
|
299
|
+
const remainingMs = timeoutMs - elapsedMs;
|
|
300
|
+
if (remainingMs <= 0) {
|
|
301
|
+
yield {
|
|
302
|
+
type: "error",
|
|
303
|
+
runId,
|
|
304
|
+
content: "Timeout exceeded before polling fallback could start"
|
|
305
|
+
};
|
|
306
|
+
return;
|
|
313
307
|
}
|
|
308
|
+
const intervalMs = 500;
|
|
309
|
+
const maxAttempts = Math.max(1, Math.floor(remainingMs / intervalMs));
|
|
310
|
+
run = await pollUntilComplete(
|
|
311
|
+
async () => await client.getRun(runId),
|
|
312
|
+
{ intervalMs, maxAttempts }
|
|
313
|
+
);
|
|
314
314
|
} catch (pollError) {
|
|
315
315
|
yield {
|
|
316
316
|
type: "error",
|