autokap 1.9.4 → 1.9.5
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/opcode-runner.js +11 -3
- package/package.json +1 -1
package/dist/opcode-runner.js
CHANGED
|
@@ -432,10 +432,18 @@ async function executeOpcode(opcode, index, adapter, verifier, breaker, recovery
|
|
|
432
432
|
logger.debug(`[opcode ${index}] captureBeforeState took ${Date.now() - beforeStart}ms`);
|
|
433
433
|
}
|
|
434
434
|
// `WAIT_FOR` is a pure wait: it extends while the page is progressing, up to
|
|
435
|
-
// the global deadline.
|
|
436
|
-
//
|
|
435
|
+
// the global deadline. Artifact-producing capture opcodes (CAPTURE_SCREENSHOT,
|
|
436
|
+
// END_CLIP) also run against the global deadline, NOT the narrow compiled
|
|
437
|
+
// timeout: on a heavy, perpetually-animating page the deterministic capture
|
|
438
|
+
// (visual stabilize + screenshot / clip finalization) can exceed the 10s
|
|
439
|
+
// compiled budget on its own — especially under parallel CPU contention on the
|
|
440
|
+
// runner — even with LLM enrichment moved off this timed path. The compiled
|
|
441
|
+
// `timeoutMs` stays a floor (it never shortens the global deadline). All other
|
|
442
|
+
// opcodes are interactions bounded by the narrow per-opcode deadline
|
|
443
|
+
// (Playwright auto-waiting covers them).
|
|
437
444
|
const isPureWait = opcode.kind === 'WAIT_FOR';
|
|
438
|
-
const
|
|
445
|
+
const usesGlobalDeadline = isPureWait || isArtifactProducingOpcode(opcode.kind);
|
|
446
|
+
const actionDeadlineMs = usesGlobalDeadline ? globalDeadlineMs : deadlineMs;
|
|
439
447
|
const actionBudgetMs = getRemainingTimeMs(actionDeadlineMs);
|
|
440
448
|
if (actionBudgetMs <= 0) {
|
|
441
449
|
const reason = `timeout after ${effectiveTimeoutMs}ms`;
|