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.
@@ -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. All other opcodes are interactions bounded by the
436
- // narrow per-opcode deadline (Playwright auto-waiting covers them).
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 actionDeadlineMs = isPureWait ? globalDeadlineMs : deadlineMs;
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`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autokap",
3
- "version": "1.9.4",
3
+ "version": "1.9.5",
4
4
  "description": "AI-powered CLI tool for capturing clean screenshots of websites",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",